コード例 #1
0
		internal ConstantDeclaration(
			string name,
			Declaration declaringType, 
			Type t, 
			SnippetExpression expression
			)
			:base(name,declaringType)
		{
			if (t==null)
				throw new ArgumentNullException("t");
			if (expression == null)
				throw new ArgumentNullException("t");
			this.type = t;
			this.expression = expression;
		}
コード例 #2
0
 internal ConstantDeclaration(
     string name,
     Declaration declaringType,
     Type t,
     SnippetExpression expression
     )
     : base(name, declaringType)
 {
     if (t == null)
     {
         throw new ArgumentNullException("t");
     }
     if (expression == null)
     {
         throw new ArgumentNullException("t");
     }
     this.type       = t;
     this.expression = expression;
 }
コード例 #3
0
        public ConstantDeclaration AddConstant(Type type, string name, SnippetExpression expression)
        {
            if (type == null)
            {
                throw new ArgumentNullException("type");
            }
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }
            if (expression == null)
            {
                throw new ArgumentNullException("expression");
            }
            if (this.constants.Contains(name))
            {
                throw new ArgumentException("field already existing in class");
            }

            ConstantDeclaration c = new ConstantDeclaration(this.Conformer.ToCamel(name), this, type, expression);

            this.constants.Add(c);
            return(c);
        }
コード例 #4
0
		public ConstantDeclaration AddConstant(Type type, string name,SnippetExpression expression)
		{
			if (type==null)
				throw new ArgumentNullException("type");
			if (name==null)
				throw new ArgumentNullException("name");
			if (expression==null)
				throw new ArgumentNullException("expression");
			if (this.constants.Contains(name))
				throw new ArgumentException("field already existing in class");

			ConstantDeclaration c = new ConstantDeclaration(this.Conformer.ToCamel(name),this,type,expression);
			this.constants.Add(c);
			return c;
		}