コード例 #1
0
		public GeneralizationRelationship Clone(CompositeType derivedType, CompositeType baseType)
		{
			GeneralizationRelationship generalization = 
				new GeneralizationRelationship(derivedType, baseType);
			generalization.CopyFrom(this);
			return generalization;
		}
コード例 #2
0
 public CompositeTypeEditor SetCompositeType(CompositeType type, bool memberOnly = false)
 {
     MemberOnly = memberOnly;
     SetTypeBase(type);
     compositeType = type;
     LanguageSpecificInitialization();
     InitEditStack();
     memberListEditor.ValueChanged += new EditValueChangedEventHandler(memberEditor_ValueChanged);
     return this;
 }
コード例 #3
0
ファイル: Member.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="name"/> does not fit to the syntax.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		protected Member(string name, CompositeType parent)
		{
			if (parent == null)
				throw new ArgumentNullException("parent");
            if (parent.Language != this.Language)
				throw new ArgumentException(Strings.ErrorLanguagesDoNotEqual);

			Initializing = true;
			Parent = parent;
			Name = name;
			ValidType = DefaultType;
			Initializing = false;
		}
コード例 #4
0
ファイル: UmlField.cs プロジェクト: BachelorEric/ModelFirst
        protected internal override Field Clone(CompositeType newParent)
		{
			UmlField field = new UmlField(newParent);
			field.CopyFrom(this);
			return field;
		}
コード例 #5
0
ファイル: UmlField.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal UmlField(CompositeType parent) : this("newField", parent)
		{
		}
コード例 #6
0
ファイル: Field.cs プロジェクト: BachelorEric/ModelFirst
		protected internal abstract Field Clone(CompositeType newParent);
コード例 #7
0
ファイル: Language.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="ArgumentException">
		/// <paramref name="operation"/> cannot be overridden.不能被重寫
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="operation"/> is null.
		/// </exception>
		protected internal abstract Operation Override(Operation operation, CompositeType newParent);
コード例 #8
0
		/// <exception cref="ArgumentException">
		/// The language does not support explicit interface implementation.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="operation"/> is null.-or-
		/// <paramref name="newParent"/> is null.
		/// </exception>
		protected internal override Operation Implement(Operation operation,
			CompositeType newParent, bool explicitly)
		{
			if (newParent == null)
				throw new ArgumentNullException("newParent");
			if (operation == null)
				throw new ArgumentNullException("operation");

			Operation newOperation = operation.Clone(newParent);

			newOperation.AccessModifier = AccessModifier.Public;
			newOperation.ClearModifiers();
			newOperation.IsStatic = false;

			if (explicitly) {
				newOperation.Name = string.Format("{0}.{1}",
					((InterfaceType) operation.Parent).Name, newOperation.Name);
			}

			return newOperation;
		}
コード例 #9
0
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		protected Constructor(CompositeType parent) : base(null, parent)
		{
		}
コード例 #10
0
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="name"/> does not fit to the syntax.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal UmlProperty(string name, CompositeType parent) : base(name, parent)
		{
		}
コード例 #11
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal CSharpMethod(CompositeType parent) : this("NewMethod", parent)
		{
		}
コード例 #12
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal UmlProperty(CompositeType parent) : this("NewProperty", parent)
		{
		}
コード例 #13
0
		public override Operation Clone(CompositeType newParent)
		{
			UmlProperty property = new UmlProperty(newParent);
			property.CopyFrom(this);
			return property;
		}
コード例 #14
0
ファイル: UmlEvent.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal UmlEvent(CompositeType parent) : this("NewEvent", parent)
		{
		}
コード例 #15
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal CSharpProperty(CompositeType parent) : this("NewProperty", parent)
		{
		}
コード例 #16
0
ファイル: Event.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="name"/> does not fit to the syntax.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		protected Event(string name, CompositeType parent) : base(name, parent)
		{
		}
コード例 #17
0
ファイル: UmlField.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="name"/> does not fit to the syntax.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal UmlField(string name, CompositeType parent) : base(name, parent)
		{
			IsConstant = false;
		}
コード例 #18
0
		public override Operation Clone(CompositeType newParent)
		{
			UmlConstructor constructor = new UmlConstructor(newParent);
			constructor.CopyFrom(this);
			return constructor;
		}
コード例 #19
0
		public override Operation Clone(CompositeType newParent)
		{
			CSharpMethod method = new CSharpMethod(newParent);
			method.CopyFrom(this);
			return method;
		}
コード例 #20
0
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal UmlConstructor(CompositeType parent) : base(parent)
		{
		}
コード例 #21
0
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="name"/> does not fit to the syntax.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal CSharpMethod(string name, CompositeType parent) : base(name, parent)
		{
		}
コード例 #22
0
		public override Operation Clone(CompositeType newParent)
		{
			CSharpEvent newEvent = new CSharpEvent(newParent);
			newEvent.CopyFrom(this);
			return newEvent;
		}
コード例 #23
0
		/// <exception cref="ArgumentException">
		/// <paramref name="operation"/> cannot be overridden.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="operation"/> is null.
		/// </exception>
		protected internal override Operation Override(Operation operation, CompositeType newParent)
		{
			if (operation == null)
				throw new ArgumentNullException("operation");

			if (!operation.IsVirtual && !operation.IsAbstract && !operation.IsOverride ||
				operation.IsSealed)
			{
				throw new ArgumentException(
					Strings.ErrorCannotOverride, "operation");
			}

			Operation newOperation = operation.Clone(newParent);
			newOperation.IsVirtual = false;
			newOperation.IsAbstract = false;
			newOperation.IsOverride = true;

			return newOperation;
		}
コード例 #24
0
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="name"/> does not fit to the syntax.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal CSharpEvent(string name, CompositeType parent) : base(name, parent)
		{
		}
コード例 #25
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal CSharpField(CompositeType parent) : this("newField", parent)
		{
		}
コード例 #26
0
ファイル: Field.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="name"/> does not fit to the syntax.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		protected Field(string name, CompositeType parent) : base(name, parent)
        {
		}
コード例 #27
0
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		internal CSharpEvent(CompositeType parent) : this("NewEvent", parent)
		{
		}
コード例 #28
0
		/// <exception cref="RelationshipException">
		/// Cannot create generalization.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="derivedType"/> is null.-or-
		/// <paramref name="baseType"/> is null.
		/// </exception>
		internal GeneralizationRelationship(CompositeType derivedType, CompositeType baseType)
			: base(derivedType, baseType)
		{
			Attach();
		}
コード例 #29
0
ファイル: Method.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="BadSyntaxException">
		/// The <paramref name="name"/> does not fit to the syntax.
		/// </exception>
		/// <exception cref="ArgumentException">
		/// The language of <paramref name="parent"/> does not equal.
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="parent"/> is null.
		/// </exception>
		protected Method(string name, CompositeType parent) : base(name, parent)
		{
		}
コード例 #30
0
ファイル: Language.cs プロジェクト: BachelorEric/ModelFirst
		/// <exception cref="ArgumentException">
		/// The language does not support explicit interface implementation.
        /// 語言不支持顯式接口實現
		/// </exception>
		/// <exception cref="ArgumentNullException">
		/// <paramref name="operation"/> is null.-or-
		/// <paramref name="newParent"/> is null.
		/// </exception>
		protected internal abstract Operation Implement(Operation operation,
			CompositeType newParent, bool explicitly);