Пример #1
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">Name of the member</param>
 /// <param name="baseType">The base type for this member entry</param>
 protected MemberEntry(string name, ParserType baseType)
 {
     // TODO: Validate the name to make sure it is a valid identifier
     Name = name;
     Uuid = Guid.NewGuid();
     BaseType = baseType;
 }
Пример #2
0
        internal ParserType GetReference(string reference)
        {
            ParserType ret = null;

            string[] vals = reference.Split('/');
            if (Parent != null)
            {
                SequenceParserType currParent = Parent;

                for (int i = 0; i < vals.Length - 1; ++i)
                {
                    MemberEntry ent = currParent.FindMember(vals[i]);

                    SequenceParserType s = ent.BaseType as SequenceParserType;
                    if (s == null)
                    {
                        currParent = null;
                        break;
                    }
                    else
                    {
                        currParent = s;
                    }
                }

                if (currParent != null)
                {
                    MemberEntry ent = currParent.FindMember(vals[vals.Length - 1]);
                }
            }

            return(ret);
        }
Пример #3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="name">Name of the member</param>
 /// <param name="baseType">The base type for this member entry</param>
 protected MemberEntry(string name, ParserType baseType)
 {
     // TODO: Validate the name to make sure it is a valid identifier
     Name     = name;
     Uuid     = Guid.NewGuid();
     BaseType = baseType;
 }
Пример #4
0
        /// <summary>
        /// Copy the type
        /// </summary>
        /// <returns>The new copied type, has a new UUID</returns>
        public ParserType Copy()
        {
            ParserType ret = GeneralUtils.CloneObject(this);

            ret.Uuid = Guid.NewGuid();

            return(ret);
        }
Пример #5
0
        private void RemoveTreeNode(ParserType type)
        {
            if(_nodeMap.ContainsKey(type.Uuid))
            {
                TreeNode parentNode = _nodeMap[type.Uuid].Parent;
                _nodeMap[type.Uuid].Remove();
                _nodeMap.Remove(type.Uuid);
                _document.RemoveParserType(type);

                if (parentNode.Nodes.Count == 0)
                {
                    parentNode.ImageIndex = FOLDER_OPEN_IMAGE;
                    parentNode.SelectedImageIndex = FOLDER_OPEN_IMAGE;
                }
            }
        }
Пример #6
0
        private TreeNode AddTreeNode(TreeNode rootNode, ParserType type, bool editName)
        {
            TreeNode node = new TreeNode(type.Name, 2, 2);
            node.Tag = type;
            rootNode.Nodes.Add(node);

            if (editName)
            {
                node.EnsureVisible();
                node.BeginEdit();
            }

            _nodeMap.Add(type.Uuid, node);

            return node;
        }
Пример #7
0
 private TreeNode AddTreeNode(ParserType type, bool editName)
 {
     if ((type is EnumParserType) && (_enumNode != null))
     {
         return AddTreeNode(_enumNode, type, editName);
     }
     else if (type is SequenceParserType)
     {
         return AddTreeNode(_sequenceNode, type, editName);
     }
     else if (type is StreamParserType)
     {
         return AddTreeNode(_parserNode, type, editName);
     }
     else if (type is ScriptParserType)
     {
         return AddTreeNode(_scriptNode, type, editName);
     }
     else
     {
         throw new ArgumentException(Properties.Resources.ParserDocumentControl_InvalidParserType, "type");
     }
 }
Пример #8
0
 public StreamParserType(string name, ParserType baseType)
     : base(name)
 {
     _baseType = baseType;
 }
Пример #9
0
 public StreamParserType(string name, ParserType baseType)
     : base(name)
 {
     _baseType = baseType;
 }