示例#1
0
文件: DDNodeEx.cs 项目: drOpen/DrData
        /// <summary>
        /// Returns true if specified type of node should be skip
        /// </summary>
        /// <param name="type">type of node to analyze</param>
        /// <param name="skipByType">set 'true' for skip nodes by specified types of nodes. Overwise, set 'false, for process only specified types of nodes </param>
        /// <param name="types">array of types of nodes to skip or process depends by <paramref name="skipByType"/></param>
        /// <returns></returns>
        private static bool mustSkipByNodeType(DDType type, bool skipByType, params DDType[] types)
        {
            bool bMustSkip = !skipByType;

            foreach (var t in types)
            {
                if (type == t)
                {
                    bMustSkip = skipByType;
                    break;
                }
            }
            return(bMustSkip);
        }
示例#2
0
 public DDNode(string name, DDType type)
 {
     if (!IsNameCorect(name))
     {
         throw new DDNodeIncorrectNameException(name);
     }
     attributes = new DDAttributesCollection();
     Name       = name;
     childNodes = new Dictionary <string, DDNode>();
     if ((type == null) || (type.Name == null))
     {
         Type.Name = new DDType(string.Empty);
     }
     else
     {
         Type = type;
     }
 }
示例#3
0
 public DDNode(DDType type)
     : this(Guid.NewGuid().ToString(), type)
 {
 }
示例#4
0
 public DDNode(Enum name, DDType type)
     : this(name.ToString(), type)
 {
 }
示例#5
0
 private DDNode(string name, DDNode parent, DDType type)
     : this(name, type)
 {
     Parent = parent;
 }