/// <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(); }
/// <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); }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }
/// <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; }