示例#1
0
文件: Tag.cs 项目: sr3dna/big5sync
 /// <summary>
 /// Creates a new Tag object
 /// </summary>
 /// <param name="tagname">The string value that represents the name to be given to the tag</param>
 /// <param name="created">The long value that represents the created date of the tag</param>
 /// <remarks>The last updated date of the tag is set to the created date that is passed as
 /// parameter. The boolean value that represents whether the tag is deleted is set to false by
 /// default. The deleted date of the tag is set to 0 by default. The updated date of filter
 /// is set to the created date that is passed as parameter. New instance of a list of tagged paths
 /// is created. New instance of a list of filters is created. New instance of tag config is
 /// created.</remarks>
 public Tag(string tagname, long created)
 {
     this._tagName = tagname;
     this._createdDate = created;
     this._lastUpdatedDate = created;
     this._isDeleted = false;
     this._deletedDate = 0;
     this._pathList = new List<TaggedPath>();
     this._filters = new List<Filter>();
     this._filtersUpdatedDate = created;
     this._config = new TagConfig();
 }
示例#2
0
 /// <summary>
 /// Creates a tag config from the Xml element that is passed as parameter
 /// </summary>
 /// <param name="configNode">The XmlElement object that represents the Xml element that is to
 /// be used to create the tag config</param>
 /// <returns>the tag config that is created if no FormatException thrown; otherwise, null</returns>
 private static TagConfig CreateTagConfig(XmlElement configNode)
 {
     try
     {
         TagConfig config = new TagConfig();
         foreach (XmlElement configChild in configNode.ChildNodes)
         {
             if (configChild.Name.Equals(ELE_CONFIG_SEAMLESS))
             {
                 try
                 {
                     config.IsSeamless = bool.Parse(configChild.InnerText);
                 }
                 catch (FormatException)
                 {
                     return null;
                 }
             }
         }
         return config;
     }
     catch (XmlException)
     {
         return null;
     }
 }