Ejemplo n.º 1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="us">User short profile</param>
 public TlUser(TlUserBrief us)
 {
     ID = new Guid(us.ID.ToByteArray());
     DisplayName = (string)us.DisplayName.Clone();
     Title = (string)us.Title.Clone();
     AvatarSmallURL = (string)us.AvatarSmallURL.Clone();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns user file with specified ID
 /// </summary>
 /// <param name="user">User profile which contains ID to search</param>
 /// <returns>User profile or null if user was not found</returns>
 public TlUser GetUser(TlUserBrief user)
 {
     return GetUser(user.ID);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Parses XML node
        /// </summary>
        /// <param name="nodeNameLowerCase">XMLNode node name (lower case)</param>
        /// <param name="node">XMLNode node</param>
        /// <returns>True if XML node conains object data, otherwise returns false</returns>
        protected override bool ParseItem(string nodeNameLowerCase, XmlNode node)
        {
            base.ParseItem(nodeNameLowerCase, node);

            if (nodeNameLowerCase == "description")
                Description = node.InnerText;
            else if (nodeNameLowerCase == "canedit")
                CanEdit = HelperXML.GetBool(node);
            else if (nodeNameLowerCase == "responsible")
            {
                Responsible = new TlUserBrief();
                Responsible.Connection = Connection;
                Responsible.Deserialize(node);
            }
            else if (nodeNameLowerCase == "isprivate")
                IsPrivate = HelperXML.GetBool(node);
            else if (nodeNameLowerCase == "taskcount")
                TaskCount = HelperXML.GetInt32(node);
            else if (nodeNameLowerCase == "milestonecount")
                MilestoneCount = HelperXML.GetInt32(node);
            else if (nodeNameLowerCase == "participantcount")
                ParticipantCount = HelperXML.GetInt32(node);
            else
                return false;
            return true;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Parses XML node
        /// </summary>
        /// <param name="nodeNameLowerCase">XMLNode node name (lower case)</param>
        /// <param name="node">XMLNode node</param>
        /// <returns>True if XML node conains object data, otherwise returns false</returns>
        protected override bool ParseItem(string nodeNameLowerCase, XmlNode node)
        {
            base.ParseItem(nodeNameLowerCase, node);

            if (nodeNameLowerCase == "canedit")
                CanEdit = HelperXML.GetBool(node);
            else if (nodeNameLowerCase == "security")
                ParseSecurity(node);
            else if (nodeNameLowerCase == "projectfolder")
                ProjectFolder = HelperXML.GetInt32(node);
            else if (nodeNameLowerCase == "responsible")
            {
                Responsible = new TlUserBrief();
                Responsible.Connection = Connection;
                Responsible.Deserialize(node);
            }
            else if (nodeNameLowerCase == "isprivate")
                IsPrivate = HelperXML.GetBool(node);
            else if (nodeNameLowerCase == "createdby")
            {
                CreatedBy = new TlUserBrief();
                CreatedBy.Connection = Connection;
                CreatedBy.Deserialize(node);
            }
            else if (nodeNameLowerCase == "created")
                Created = HelperXML.GetDateTime(node);
            else if (nodeNameLowerCase == "updated")
                Updated = HelperXML.GetDateTime(node);
            else
                return false;

            return true;
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Parses XML node
 /// </summary>
 /// <param name="nodeNameLowerCase">XMLNode node name (lower case)</param>
 /// <param name="node">XMLNode node</param>
 /// <returns>True if XML node conains object data, otherwise returns false</returns>
 protected override bool ParseItem(string nodeNameLowerCase, XmlNode node)
 {
     if (nodeNameLowerCase == "id")
         ID = HelperXML.GetInt32(node);
     else if (nodeNameLowerCase == "date")
         Date = HelperXML.GetDateTime(node);
     else if (nodeNameLowerCase == "hours")
         Hours = HelperXML.GetFloat(node, "en-US");
     else if (nodeNameLowerCase == "note")
         Notes = node.InnerText;
     else if (nodeNameLowerCase == "relatedproject")
         RelatedProjectID = HelperXML.GetInt32(node);
     else if (nodeNameLowerCase == "relatedtask")
         RelatedTaskID = HelperXML.GetInt32(node);
     else if (nodeNameLowerCase == "createdby")
     {
         CreatedBy = new TlUserBrief();
         CreatedBy.Connection = Connection;
         CreatedBy.Deserialize(node);
     }
     else
         return false;
     return true;
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Parses XML node
        /// </summary>
        /// <param name="nodeNameLowerCase">XMLNode node name (lower case)</param>
        /// <param name="node">XMLNode node</param>
        /// <returns>True if XML node conains object data, otherwise returns false</returns>
        protected override bool ParseItem(string nodeNameLowerCase, XmlNode node)
        {
            if (nodeNameLowerCase == "canedit")
                CanEdit = HelperXML.GetBool(node);
            else if (nodeNameLowerCase == "id")
                ID = HelperXML.GetInt32(node);
            else if (nodeNameLowerCase == "title")
                Title = node.InnerText;
            else if (nodeNameLowerCase == "description")
                Description = node.InnerText;
            else if (nodeNameLowerCase == "isnotify")
                IsNotify = HelperXML.GetBool(node);
            else if (nodeNameLowerCase == "iskey")
                IsKey = HelperXML.GetBool(node);
            else if (nodeNameLowerCase == "deadline")
                Deadline = HelperXML.GetDateTime(node);
            else if (nodeNameLowerCase == "projectowner")
            {
                ProjectOwner = new TlProjectBrief();
                ProjectOwner.Connection = Connection;
                ProjectOwner.Deserialize(node);
            }
            else if (nodeNameLowerCase == "status")
                Status = (TlProjectMilestoneStatus)HelperXML.GetInt32(node);
            else if (nodeNameLowerCase == "responsible")
            {
                Responsible = new TlUserBrief();
                Responsible.Connection = Connection;
                Responsible.Deserialize(node);
            }
            else if (nodeNameLowerCase == "created")
                Created = HelperXML.GetDateTime(node);
            else if (nodeNameLowerCase == "createdby")
            {
                CreatedBy = new TlUserBrief();
                CreatedBy.Connection = Connection;
                CreatedBy.Deserialize(node);
            }
            else if (nodeNameLowerCase == "updated")
                Updated = HelperXML.GetDateTime(node);
            else if (nodeNameLowerCase == "updatedby")
            {
                UpdatedBy = new TlUserBrief();
                UpdatedBy.Connection = Connection;
                UpdatedBy.Deserialize(node);
            }
            else
                return false;

            return true;
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Clears item data
        /// </summary>
        public override void Clear()
        {
            base.Clear();

            CanEdit = false;
            ID = 0;
            Title = "";
            Description = "";
            IsNotify = false;
            IsKey = false;
            Deadline = null;
            ProjectOwner = null;
            Status = TlProjectMilestoneStatus.Open;
            Responsible = null;
            Created = null;
            CreatedBy = null;
            Updated = null;
            UpdatedBy = null;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Clears item data
        /// </summary>
        public override void Clear()
        {
            base.Clear();

            CanEdit = false;
            ID = 0;
            Title = "";
            Description = "";
            Deadline = null;
            Priority = TlProjectTaskPriority.Normal;
            MilestoneID = 0;
            ProjectOwner = null;
            Status = TlProjectTaskStatus.Unclassified;
            IsExpired = false;
            Responsible = null;
            Created = null;
            CreatedBy = null;
            Updated = null;
            UpdatedBy = null;
        }