Ejemplo n.º 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);
        }
Ejemplo n.º 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;
            }
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 4
0
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 internal Destructor(OperationContainer parent) : base(null, parent)
 {
     parentName     = Parent.Name;
     AccessModifier = AccessModifier.Default;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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)
 {
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 10
0
 /// <exception cref="ArgumentNullException">
 /// <paramref name="parent"/> is null.
 /// </exception>
 protected Constructor(OperationContainer parent) : base(null, parent)
 {
     parentName = Parent.Name;
 }