Example #1
0
        /// <exception cref="BadSyntaxException">
        /// The <paramref name="name"/> does not fit to the syntax.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="parent"/> is null.
        /// </exception>
        protected Member(string name, OperationContainer parent)
        {
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            Name           = name;
            Parent         = parent;
            Type           = DefaultType;
            AccessModifier = AccessModifier.Default;
            IsStatic       = (parent is IOverridableType &&
                              ((IOverridableType)parent).Modifier == InheritanceModifier.Static);
        }
Example #2
0
        /// <exception cref="ArgumentException">
        /// <paramref name="memberType"/> is empty string.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="list"/> is null.-or-
        /// <paramref name="memberType"/> is null.-or-
        /// <paramref name="node"/> is null.-or-
        /// <paramref name="parent"/> is null.
        /// </exception>
        internal static void LoadMembers <T>(IList <T> list, string memberType, XmlNode node,
                                             OperationContainer parent) where T : Member
        {
            if (list == null)
            {
                throw new ArgumentNullException("list");
            }
            if (memberType == null)
            {
                throw new ArgumentNullException("memberType");
            }
            if (node == null)
            {
                throw new ArgumentNullException("node");
            }
            if (parent == null)
            {
                throw new ArgumentNullException("parent");
            }

            if (memberType == "")
            {
                throw new ArgumentException(
                          "error_empty_string", "memberType");
            }

            XmlElement child = node[memberType];

            while (child != null)
            {
                if (child.Name == memberType)
                {
                    string name = child.GetAttribute("name");
                    string type = child.GetAttribute("type");
                    try
                    {
                        Member member = GetMemberFromName(type, name, parent);
                        member.InitFromString(child.InnerText);
                        list.Add((T)member);
                    }
                    catch
                    {
                        // Skips incorrect node
                    }
                }
                child = child.NextSibling as XmlElement;
            }
        }
Example #3
0
 /// <exception cref="BadSyntaxException">
 /// The <paramref name="name"/> does not fit to the syntax.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 internal CSharpMethod(string name, OperationContainer parent) : base(name, parent)
 {
     IsOperator           = false;
     IsConversionOperator = false;
 }
Example #4
0
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 internal Destructor(OperationContainer parent) : base(null, parent)
 {
     parentName     = Parent.Name;
     AccessModifier = AccessModifier.Default;
 }
Example #5
0
 /// <exception cref="BadSyntaxException">
 /// The <paramref name="name"/> does not fit to the syntax.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 internal CSharpField(string name, OperationContainer parent) : base(name, parent)
 {
     IsConst = false;
 }
Example #6
0
 /// <exception cref="BadSyntaxException">
 /// The <paramref name="name"/> does not fit to the syntax.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 protected Field(string name, OperationContainer parent) : base(name, parent)
 {
     IsReadonly   = false;
     InitialValue = null;
 }
Example #7
0
 /// <exception cref="BadSyntaxException">
 /// The <paramref name="name"/> does not fit to the syntax.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 internal Event(string name, OperationContainer parent) : base(name, parent)
 {
 }
Example #8
0
 /// <exception cref="BadSyntaxException">
 /// The <paramref name="name"/> does not fit to the syntax.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 protected Method(string name, OperationContainer parent) : base(name, parent)
 {
 }
Example #9
0
 /// <exception cref="BadSyntaxException">
 /// The <paramref name="name"/> does not fit to the syntax.
 /// </exception>
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 protected Operation(string name, OperationContainer parent) : base(name, parent)
 {
     parameterList = ParameterCollection.GetCollection(Language);
     Modifier      = OperationModifier.None;
 }
Example #10
0
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 protected Constructor(OperationContainer parent) : base(null, parent)
 {
     parentName = Parent.Name;
 }