Click here to Skip to main content
15,897,519 members
Articles / Programming Languages / C#

Linux Todolist

Rate me:
Please Sign up or sign in to vote.
4.59/5 (15 votes)
28 Jan 2008GPL35 min read 74.1K   2.3K   53  
A simple todolist designed for an Asus Eee Pc
using System;
using System.Collections;
using System.Xml;
using log4net;

using uk.org.aspellclark.common;

namespace uk.org.aspellclark.todolist.engine
{
    /// <summary>
    ///   <name>CTask</name>
    ///   <namespace>uk.org.aspellclark.todolist.engine</namespace>
    ///   <version>1.0</version>
    ///   <author>Andy Aspell-Clark</author>
    ///   <description>This class contains the data for a single task
    ///   </description>
    ///   <history>
    ///     <historyitem> 1 Jan 2008  1.0 ARAC  Initial Version.</historyitem>
    ///   </history>
    /// </summary>
    public class CTask
    {
        #region Member variables
		// Create a logger for use in this class
		private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);


        private Int64 m_iColour;
        private Int16 m_iParentTaskId;
        private Int16 m_iPercentComplete;
        private Int16 m_iPriority = 5;
        private Int64 m_iPriorityColour = 5;
        private Int16 m_iPosition;
        private Int16 m_iRisk = 5;
        private Int16 m_iTaskId;
        private Int16 m_iTimeEstimate = 5;
        private Decimal m_dTimeSpent = 5;
        private Single m_sngHoursEst;

        private string m_strAllocatedBy;
        private string m_strAllocatedTo;
        private string m_strAllocatedTo1;
        private string m_strCategory;
        private string m_strCommentsType;
        private string m_strCost;
        private string m_strCreatedBy;
        private string m_strDependancy;
        private string m_strExternalId;
        private string m_strFileLink;
        private string m_strFlag;
        private string m_strFileRefPath;
        private string m_strNotes;
        private string m_strPriorityWebColour;
        private string m_strRTFComments;
        private string m_strStatus;
        private string m_strTextColour;
        private string m_strTextWebColour;
        private string m_strTimeESpentUnits;
        private string m_strTimeEstUnits;
        private string m_strTitle;
        private string m_strVersion;
        private string m_strWebColour;

        private bool m_bComplete = false;

        #region Times
        private DateTime m_dtCompletedDate;
        private string m_strCompletedDate = null;

        private DateTime m_dtCreationDate;
        private string m_strCreationDate = null;

        private DateTime m_dtStartDate;
        private string m_strStartDate = null;

        private DateTime m_dtDueDate;
        private string m_strDueDate = null;

        private DateTime m_dtDoneDate;
        private string m_strDoneDate = null;

        private string m_sTimeSpentUnits = "H";
        private string m_sTimeEstUnits = "H";
        #endregion

        
        private ArrayList childTasks = new ArrayList();
        #endregion


        #region Properties

        public String AllocatedBy
        {
            get { return m_strAllocatedBy; }
            set { m_strAllocatedBy = value; }
        }
        public String AllocatedTo
        {
            get { return m_strAllocatedTo; }
            set { m_strAllocatedTo = value; }
        }
        public String AllocatedTo1
        {
            get { return m_strAllocatedTo1; }
            set { m_strAllocatedTo1 = value; }
        }
        public String Category
        {
            get { return m_strCategory; }
            set { m_strCategory = value; }
        }
        public Int64 Colour
        {
            get { return m_iColour; }
            set { m_iColour = value; }
        }
        public String CommentsType
        {
            get { return m_strCommentsType; }
            set { m_strCommentsType = value; }
        }
        public Boolean Complete
        {
            get { return m_bComplete; }
            set
            {
                m_bComplete = value;
                if (value == true) { m_iPercentComplete = 100; }
                else { m_iPercentComplete = 0; }
            }
        }
        public String CreatedBy
        {
            get { return m_strCreatedBy; }
            set { m_strCreatedBy = value; }
        }
        public DateTime CreationDate
        {
            get { return m_dtCreationDate; }
            set { m_dtCreationDate = value; m_strCreationDate = FormatDateString(value.ToString("yyyy-mm-dd")); }
        }
        public DateTime DoneDate
        {
            get { return m_dtDoneDate; }
            set { m_dtDoneDate = value; m_strDoneDate = FormatDateString(value.ToString("yyyy-mm-dd")); }
        }
        public string DoneDateStr
        {
            get { return m_dtDoneDate.ToString("yyyy-mm-dd"); }
        }
        public DateTime DueDate
        {
            get { return m_dtDueDate; }
            set { m_dtDueDate = value; m_strDueDate = FormatDateString(value.ToString("yyyy-mm-dd")); }
        }
        public string DueDateStr
        {
            get { return m_dtDueDate.ToString("yyyy-mm-dd"); }
        }
        public String FileLink
        {
            get { return m_strFileLink; }
            set { m_strFileLink = value; }
        }
        public String FileRefPath
        {
            get { return m_strFileRefPath; }
            set { m_strFileRefPath = value; }
        }
        public Single HoursEst
        {
            get { return m_sngHoursEst; }
            set { m_sngHoursEst = value; }
        }
        public String CommentsStr
        {
            get { return m_strNotes; }
            set { m_strNotes = value; }
        }
        public Int16 ParentTaskId
        {
            get { return m_iParentTaskId; }
            set
            {
                if (value >= 0 && value <= 16384)
                {
                    m_iParentTaskId = value;
                }
            }
        }
        public Int16 PercentComplete
        {
            get { return m_iPercentComplete; }
            set
            {
                if (value >= 0 && value <= 100)
                {
                    m_iPercentComplete = value;
                    if (value == 100) { m_bComplete = true; }
                    else { m_bComplete = false; }
                }
            }
        }
        public Int16 Position
        {
            get { return m_iPosition; }
            set
            {
                if (value >= 0 && value <= 100)
                {
                    m_iPosition = value;
                }
            }
        }
        public Int16 Priority
        {
            get { return m_iPriority; }
            set
            {
                if (value >= 0 && value <= 10)
                {
                    m_iPriority = value;
                }
            }
        }
        public Int64 PriorityColour
        {
            get { return m_iPriorityColour; }
            set { m_iPriorityColour = value; }
        }
        public string PriorityWebColour
        {
            get { return m_strPriorityWebColour; }
            set { m_strPriorityWebColour = value; }
        }
        public Int16 Risk
        {
            get { return m_iRisk; }
            set { m_iRisk = value; }
        }
        public string RtfComments
        {
            get { return m_strRTFComments; }
            set { m_strRTFComments = value; }
        }
        public DateTime StartDate
        {
            get { return m_dtStartDate; }
            set { m_dtStartDate = value; m_strStartDate = FormatDateString(value.ToString("yyyy-mm-dd")); }
        }
        public string StartDateStr
        {
            get { return m_dtStartDate.ToString("yyyy-mm-dd"); }
        }
        public String Status
        {
            get { return m_strStatus; }
            set { m_strStatus = value; }
        }
        public Int16 TaskId
        {
            get { return m_iTaskId; }
            set
            {
                if (value >= 0 && value <= 16384)
                {
                    m_iTaskId = value;
                }
            }
        }
        public String TextColour
        {
            get { return m_strTextColour; }
            set { m_strTextColour = value; }
        }
        public String TextWebColour
        {
            get { return m_strTextWebColour; }
            set { m_strTextWebColour = value; }
        }
        public String TimeEstUnits
        {
            get { return m_strTimeEstUnits; }
            set { m_strTimeEstUnits = value; }
        }
        public String TimeESpentUnits
        {
            get { return m_strTimeESpentUnits; }
            set { m_strTimeESpentUnits = value; }
        }
        public Decimal TimeSpent
        {
            get { return m_dTimeSpent; }
            set { m_dTimeSpent = value; }
        }
        public String Title
        {
            get { return m_strTitle; }
            set { m_strTitle = value; }
        }
        public String VersionStr
        {
            get { return m_strVersion; }
            set { m_strVersion = value; }
        }
        public String WebColour
        {
            get { return m_strWebColour; }
            set { m_strWebColour = value; }
        }


        #endregion


        private String FormatDateString(String strDate)
        {
            String strReturn;

            try
            {
                strReturn = Convert.ToDateTime(strDate).ToString("MM/dd/yyyy");
            }
            catch
            {
                strReturn = strDate;
            }

            return strReturn;
        }

        public void DumpTaskDetails()
        {
        	log.Info("AllocatedTo       : " + this.AllocatedTo);
        	log.Info("AllocatedTo1      : " + this.AllocatedTo1);
        	log.Info("AllocatedBy       : " + this.AllocatedBy);
        	log.Info("Category          : " + this.Category);
        	log.Info("Colour            : " + this.Colour);
        	log.Info("CommentsStr       : " + this.CommentsStr);
        	log.Info("CommentsType      : " + this.CommentsType);
        	log.Info("Complete          : " + this.Complete);
        	log.Info("CreatedBy         : " + this.CreatedBy);
        	log.Info("CreationDate      : " + this.CreationDate);
        	log.Info("DoneDate          : " + this.DoneDate);
        	log.Info("DueDate           : " + this.DueDate);
        	log.Info("FileRefPath       : " + this.FileRefPath);
        	log.Info("HoursEst          : " + this.HoursEst);
        	log.Info("ParentTaskId      : " + this.ParentTaskId);
        	log.Info("PercentComplete   : " + this.PercentComplete);
        	log.Info("Position          : " + this.Position);
        	log.Info("Priority          : " + this.Priority);
        	log.Info("PriorityColour    : " + this.PriorityColour);
        	log.Info("PriorityWebColour : " + this.PriorityWebColour);
        	log.Info("Risk              : " + this.Risk);
        	log.Info("RtfComments       : " + this.RtfComments);
        	log.Info("StartDate         : " + this.StartDate);
        	log.Info("Status            : " + this.Status);
        	log.Info("TaskId            : " + this.TaskId);
        	log.Info("TextColour        : " + this.TextColour);
        	log.Info("TextWebColour     : " + this.TextWebColour);
        	log.Info("TimeSpent         : " + this.TimeSpent);
        	//log.Info("AllocatedBy       : " + this.);
        	//log.Info("AllocatedBy       : " + this.);
        	log.Info("Title             : " + this.Title);
        }

        /// <summary>
        /// Reads in this tasks properties from the xml node
        /// </summary>
        /// <param name="xmlNode"></param>
        public void ReadFromXml(XmlNode xmlNode)
        {
            try
            {
	            if (xmlNode.Name.ToUpper() == "TASK")
	            {
	                if (xmlNode.Attributes.GetNamedItem("ALLOCATEDBY") != null)
	                {
		                    if (xmlNode.Attributes.GetNamedItem("ALLOCATEDBY").InnerText.Length > 0)
		                    {
		                        AllocatedBy = xmlNode.Attributes.GetNamedItem("ALLOCATEDBY").InnerText;
		                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("CATEGORY") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("CATEGORY").InnerText.Length > 0)
	                    {
	                        Category = xmlNode.Attributes.GetNamedItem("CATEGORY").InnerText;
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("COLOUR") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("COLOUR").InnerText.Length > 0)
	                    {
	                        Colour = Convert.ToInt64(xmlNode.Attributes.GetNamedItem("COLOUR").InnerText);
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("COMMENTS") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("COMMENTS").InnerText.Length > 0)
	                    {
	                        CommentsStr = xmlNode.Attributes.GetNamedItem("COMMENTS").InnerText;
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("COMMENTSTYPE") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("COMMENTSTYPE").InnerText.Length > 0)
	                    {
	                        this.CommentsType = xmlNode.Attributes.GetNamedItem("COMMENTSTYPE").InnerText;
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("CREATIONDATE") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("CREATIONDATE").InnerText.Length > 0)
	                    {
	                        CreationDate = CommonFunctions.OleDateToDateTime(Convert.ToDouble(xmlNode.Attributes.GetNamedItem("CREATIONDATE").InnerText));
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("CUSTOMCOMMENTS") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("CUSTOMCOMMENTS").InnerText.Length > 0)
	                    {
	                        RtfComments = xmlNode.Attributes.GetNamedItem("CUSTOMCOMMENTS").InnerText;
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("DUEDATE") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("DUEDATE").InnerText.Length > 0)
	                    {
	                        DueDate = CommonFunctions.OleDateToDateTime(Convert.ToDouble(xmlNode.Attributes.GetNamedItem("DUEDATE").InnerText));
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("DONEDATE") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("DONEDATE").InnerText.Length > 0)
	                    {
	                        DoneDate = CommonFunctions.OleDateToDateTime(Convert.ToDouble(xmlNode.Attributes.GetNamedItem("DONEDATE").InnerText));
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("FILEREFPATH") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("FILEREFPATH").InnerText.Length > 0)
	                    {
	                        FileRefPath = xmlNode.Attributes.GetNamedItem("FILEREFPATH").InnerText;
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("ID") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("ID").InnerText.Length > 0)
	                    {
	                        TaskId = Convert.ToInt16(xmlNode.Attributes.GetNamedItem("ID").InnerText);
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("LASTMOD") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("LASTMOD").InnerText.Length > 0)
	                    {
	                        //LastMod = CommonFunctions.OleDateToDateTime(Convert.ToDouble(xmlNode.Attributes.GetNamedItem("LASTMOD").InnerText));
	                    }
	                }
	
	                Title = xmlNode.Attributes.GetNamedItem("TITLE").InnerText;
	
	                if (xmlNode.Attributes.GetNamedItem("PERCENTDONE") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("PERCENTDONE").InnerText.Length > 0)
	                    {
	                        PercentComplete = Convert.ToInt16(xmlNode.Attributes.GetNamedItem("PERCENTDONE").InnerText);
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("PERSON") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("PERSON").InnerText.Length > 0)
	                    {
	                        AllocatedTo = xmlNode.Attributes.GetNamedItem("PERSON").InnerText;
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("POS") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("POS").InnerText.Length > 0)
	                    {
	                        Position = Convert.ToInt16(xmlNode.Attributes.GetNamedItem("POS").InnerText);
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("PRIORITY") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("PRIORITY").InnerText.Length > 0)
	                    {
	                        Priority = Convert.ToInt16(xmlNode.Attributes.GetNamedItem("PRIORITY").InnerText);
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("PRIORITYCOLOR") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("PRIORITYCOLOR").InnerText.Length > 0)
	                    {
	                        PriorityColour = Convert.ToInt64(xmlNode.Attributes.GetNamedItem("PRIORITYCOLOR").InnerText);
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("PRIORITYWEBCOLOR") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("PRIORITYWEBCOLOR").InnerText.Length > 0)
	                    {
	                        PriorityWebColour = xmlNode.Attributes.GetNamedItem("PRIORITYWEBCOLOR").InnerText;
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("RISK") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("RISK").InnerText.Length > 0)
	                    {
	                        Risk = Convert.ToInt16(xmlNode.Attributes.GetNamedItem("RISK").InnerText);
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("STARTDATE") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("STARTDATE").InnerText.Length > 0)
	                    {
	                        StartDate = CommonFunctions.OleDateToDateTime(Convert.ToDouble(xmlNode.Attributes.GetNamedItem("STARTDATE").InnerText));
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("STATUS") != null)
	                {
	                    if (xmlNode.Attributes.GetNamedItem("STATUS").InnerText.Length > 0)
	                    {
	                        Status = xmlNode.Attributes.GetNamedItem("STATUS").InnerText;
	                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("TEXTCOLOUR") != null)
	                {
		                    if (xmlNode.Attributes.GetNamedItem("TEXTCOLOUR").InnerText.Length > 0)
		                    {
		                        TextColour = xmlNode.Attributes.GetNamedItem("TEXTCOLOUR").InnerText;
		                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("TEXTWEBCOLOUR") != null)
	                {
		                    if (xmlNode.Attributes.GetNamedItem("TEXTWEBCOLOUR").InnerText.Length > 0)
		                    {
		                        TextWebColour = xmlNode.Attributes.GetNamedItem("TEXTWEBCOLOUR").InnerText;
		                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("TIMEESTIMATE") != null)
	                {
		                    if (xmlNode.Attributes.GetNamedItem("TIMEESTIMATE").InnerText.Length > 0)
		                    {
		                        HoursEst = Convert.ToSingle(xmlNode.Attributes.GetNamedItem("TIMEESTIMATE").InnerText);
		                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("TIMESPENT") != null)
	                {
		                    if (xmlNode.Attributes.GetNamedItem("TIMESPENT").InnerText.Length > 0)
		                    {
		                        TimeSpent = Convert.ToDecimal(xmlNode.Attributes.GetNamedItem("TIMESPENT").InnerText);
		                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("VERSION") != null)
	                {
		                    if (xmlNode.Attributes.GetNamedItem("VERSION").InnerText.Length > 0)
		                    {
		                        this.VersionStr = xmlNode.Attributes.GetNamedItem("VERSION").InnerText;
		                    }
	                }
	                if (xmlNode.Attributes.GetNamedItem("WEBCOLOUR") != null)
	                {
		                    if (xmlNode.Attributes.GetNamedItem("WEBCOLOUR").InnerText.Length > 0)
		                    {
		                        WebColour = xmlNode.Attributes.GetNamedItem("WEBCOLOUR").InnerText;
		                    }
	                }
	                //check to see if we have any child tasks
	                if (xmlNode.HasChildNodes == true)
	                {
						//log.Info("CTask: checking for child nodes of ["+this.Title+"] inside if");
						//log.Info("CTask: ["+this.Title+"] says it has ["+xmlNode.ChildNodes.Count+"] child nodes");
	                    for (int i = 0; i < xmlNode.ChildNodes.Count; i++)
	                    {
	                    	//log.Info("CTask: ["+this.Title+"] reading child node ["+i+"]");
	                    	CTask newTask = new CTask();
	                        newTask.ReadFromXml(xmlNode.ChildNodes[i]);
	                        childTasks.Add(newTask);
	                    }
	                }
	            }
            }
            catch (Exception e)
            {
				log.Error("CTask:exception  ["+e.Message+"] caught reading xml task ["+this.Title+"]");
				//DumpTaskDetails();
            }

            if (PercentComplete == 100)
            {
                Complete = true;
            }
        }//readFromXml()

        /// <summary>
        /// 
        /// </summary>
        /// <param name="xmlWriter"></param>
        public void writeToXml(XmlTextWriter xmlWriter)
        {
            xmlWriter.WriteStartElement("TASK");

            xmlWriter.WriteAttributeString("", "ID", "", TaskId.ToString());
            DateTime lastModded = DateTime.Now;
            xmlWriter.WriteAttributeString("", "LASTMODSTRING", "", lastModded.ToString("yyyy-mm-dd"));
            xmlWriter.WriteAttributeString("", "LASTMOD", "", CommonFunctions.DateTimeToOleDate(lastModded).ToString());

            if (AllocatedBy != null && AllocatedBy != "")
            {
                xmlWriter.WriteAttributeString("", "ALLOCATEDBY", "", AllocatedBy);
            }
            if (AllocatedTo != null && AllocatedTo != "" && AllocatedTo.Length>0)
            {
                xmlWriter.WriteAttributeString("", "PERSON", "", AllocatedTo);
            }
            if (AllocatedTo1 != null && AllocatedTo1 != "" && AllocatedTo1.Length > 0)
            {
                xmlWriter.WriteAttributeString("", "PERSON1", "", AllocatedTo);
            }
            if (Category != null)
            {
                xmlWriter.WriteAttributeString("", "CATEGORY", "", Category);
            }

            xmlWriter.WriteAttributeString("", "COLOR", "", Colour.ToString());

            if (CommentsStr != null)
            {
                xmlWriter.WriteAttributeString("", "COMMENTS", "", CommentsStr);
            }
            if (CommentsType != null)
            {
                xmlWriter.WriteAttributeString("", "COMMENTSTYPE", "", CommentsType);
            }
            if (CreatedBy != null)
            {
                xmlWriter.WriteAttributeString("", "CREATEDBY", "", CreatedBy);
            }
            if (m_strCreationDate != null)
            {
                xmlWriter.WriteAttributeString("", "CREATIONDATESTRING", "", CreationDate.ToString("yyyy-mm-dd"));
                xmlWriter.WriteAttributeString("", "CREATIONDATE", "", CommonFunctions.DateTimeToOleDate(CreationDate).ToString());
            }
            if (m_strDueDate != null)
            {
                xmlWriter.WriteAttributeString("", "DUEDATESTRING", "", DueDate.ToString("yyyy-mm-dd"));
                xmlWriter.WriteAttributeString("", "DUEDATE", "",
                    CommonFunctions.DateTimeToOleDate(DueDate).ToString());
            }
            if (m_strDoneDate != null)
            {
                xmlWriter.WriteAttributeString("", "DONEDATESTRING", "", DoneDate.ToString("yyyy-mm-dd"));
                xmlWriter.WriteAttributeString("", "DONEDATE", "",
                    CommonFunctions.DateTimeToOleDate(DoneDate).ToString());
            }
            if (PercentComplete > -1)
            {
                xmlWriter.WriteAttributeString("", "PERCENTDONE", "", PercentComplete.ToString());
            }
            if (Position > 0)
            {
                xmlWriter.WriteAttributeString("", "POS", "", Position.ToString());
            }
            xmlWriter.WriteAttributeString("", "PRIORITY", "", Priority.ToString());
            xmlWriter.WriteAttributeString("", "PRIORITYCOLOR", "", PriorityColour.ToString());
            if (PriorityWebColour != null)
            {
                xmlWriter.WriteAttributeString("", "PRIORITYWEBCOLOR", "", PriorityWebColour);
            }
            if (Risk > 0)
            {
                xmlWriter.WriteAttributeString("", "RISK", "", Risk.ToString());
            }
            if (m_strStartDate != null)
            {
                xmlWriter.WriteAttributeString("", "STARTDATESTRING", "", StartDate.ToString("yyyy-mm-dd"));
                xmlWriter.WriteAttributeString("", "STARTDATE", "", CommonFunctions.DateTimeToOleDate(StartDate).ToString());
            }
            if (Status != null)
            {
                xmlWriter.WriteAttributeString("", "STATUS", "", Status);
            }
            else
            {
                xmlWriter.WriteAttributeString("", "STATUS", "", "todo");
            }
            if (TextColour != "")
            {
                xmlWriter.WriteAttributeString("", "TEXTCOLOR", "", TextColour);
            }
            if (TextWebColour != "")
            {
                xmlWriter.WriteAttributeString("", "TEXTWEBCOLOR", "", TextWebColour);
            }
            if (HoursEst > -1)
            {
            	xmlWriter.WriteAttributeString("", "TIMEESTIMATE", "", HoursEst.ToString());
            }
            if (TimeESpentUnits != null)
            {
                xmlWriter.WriteAttributeString("", "TIMEESPENTUNITS", "", TimeESpentUnits);
            }
            if (TimeEstUnits != "")
            {
                xmlWriter.WriteAttributeString("", "TIMEESTUNITS", "", TimeEstUnits);
            }
            xmlWriter.WriteAttributeString("", "TIMESPENT", "", this.TimeSpent.ToString());


            xmlWriter.WriteAttributeString("", "TITLE", "", Title);
            if (this.VersionStr != "")
            {
                xmlWriter.WriteAttributeString("", "VERSION", "", this.VersionStr);
            }
            if (WebColour != "")
            {
                xmlWriter.WriteAttributeString("", "WEBCOLOR", "", WebColour);
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public void endWriteToXml(XmlTextWriter xmlWriter)
        {
            xmlWriter.WriteEndElement();
        }
    }//class()
}//namespace()

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Software Developer (Senior) Airbus Defense and Space
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions