Exemple #1
0
        /// <exception cref="BadSyntaxException">
        /// The name does not fit to the syntax.
        /// </exception>
        /// <exception cref="ReservedNameException">
        /// The parameter name is already exists.
        /// </exception>
        public Parameter AddParameter(string declaration)
        {
            Parameter parameter = argumentList.Add(declaration);

            parameter.Modified += delegate { Changed(); };
            Changed();
            return(parameter);
        }
Exemple #2
0
        /// <exception cref="BadSyntaxException">
        /// The name does not fit to the syntax.
        /// </exception>
        /// <exception cref="ReservedNameException">
        /// The parameter name is already exists.
        /// </exception>
        public Parameter AddParameter(string declaration)
        {
            Parameter parameter = _argumentList.Add(declaration);

            OnBeginUndoableOperation();
            parameter.BeginUndoableOperation += delegate { OnBeginUndoableOperation(); };
            parameter.Modified += delegate { Changed(); };
            Changed();
            return(parameter);
        }
Exemple #3
0
        /// <exception cref="BadSyntaxException">
        /// An error occured while deserializing.
        /// </exception>
        /// <exception cref="InvalidOperationException">
        /// The XML document is corrupt.
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="node"/> is null.
        /// </exception>
        protected internal override void Deserialize(XmlElement node)
        {
            RaiseChangedEvent = false;

            XmlElement returnTypeNode = node["ReturnType"];

            if (returnTypeNode != null)
            {
                ReturnType = returnTypeNode.InnerText;
            }

            XmlNodeList nodeList = node.SelectNodes("Param");

            foreach (XmlNode parameterNode in nodeList)
            {
                argumentList.Add(parameterNode.InnerText);
            }

            base.Deserialize(node);
            RaiseChangedEvent = true;
        }