public GeneralizationRelationship Clone(CompositeType derivedType, CompositeType baseType) { GeneralizationRelationship generalization = new GeneralizationRelationship(derivedType, baseType); generalization.CopyFrom(this); return generalization; }
public void ShowDialog(CompositeType parent) { if (parent == null) return; this.parent = parent; this.Text = string.Format(Strings.MembersOfType, parent.Name); LanguageSpecificInitialization(parent.Language); FillMembersList(); if (lstMembers.Items.Count > 0) { lstMembers.Items[0].Focused = true; lstMembers.Items[0].Selected = true; } toolNewField.Visible = parent.SupportsFields; toolNewConstructor.Visible = parent.SupportsConstuctors; toolNewDestructor.Visible = parent.SupportsDestructors; toolNewProperty.Visible = parent.SupportsProperties; toolNewEvent.Visible = parent.SupportsEvents; toolOverrideList.Visible = parent is SingleInharitanceType; toolImplementList.Visible = parent is IInterfaceImplementer; toolImplementList.Enabled = (parent is IInterfaceImplementer) && ((IInterfaceImplementer) parent).ImplementsInterface; toolSepAddNew.Visible = parent is SingleInharitanceType || parent is IInterfaceImplementer; errorProvider.SetError(txtSyntax, null); errorProvider.SetError(txtName, null); errorProvider.SetError(cboType, null); error = false; base.ShowDialog(); }
/// <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; }
private void WriteCompositeType(CompositeType type) { // Writing type declaration WriteLine(type.GetDeclaration()); WriteLine("{"); IndentLevel++; if (type is ClassType) { foreach (TypeBase nestedType in ((ClassType) type).NestedChilds) { WriteType(nestedType); AddBlankLine(); } } if (type.SupportsFields) { foreach (Field field in type.Fields) WriteField(field); } bool needBlankLine = (type.FieldCount > 0 && type.OperationCount > 0); foreach (Operation operation in type.Operations) { if (needBlankLine) AddBlankLine(); needBlankLine = true; WriteOperation(operation); } // Writing closing bracket of the type block IndentLevel--; WriteLine("}"); }
private void WriteCompositeType(CompositeType type) { // Writing type declaration WriteLine(type.GetDeclaration() + " {"); AddBlankLine(); IndentLevel++; if (type is ClassType) { foreach (TypeBase nestedType in ((ClassType) type).NestedChilds) { WriteType(nestedType); AddBlankLine(); } } if (type.FieldCount > 0) { foreach (Field field in type.Fields) WriteField(field); AddBlankLine(); } if (type.OperationCount > 0) { foreach (Method method in type.Operations) { WriteMethod(method); AddBlankLine(); } } // Writing closing bracket of the type block IndentLevel--; WriteLine("}"); }
/// <exception cref="ArgumentNullException"> /// <paramref name="parent"/> is null. /// </exception> internal CSharpProperty(CompositeType parent) : this("NewProperty", parent) { }
/// <exception cref="ArgumentException"> /// The language of <paramref name="parent"/> does not equal. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parent"/> is null. /// </exception> protected Destructor(CompositeType parent) : base(null, parent) { }
/// <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) { }
/// <exception cref="ArgumentException"> /// The language of <paramref name="parent"/> does not equal. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parent"/> is null. /// </exception> internal CSharpConstructor(CompositeType parent) : base(parent) { }
/// <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) { }
/// <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) { }
/// <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) { }
/// <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 CSharpField(string name, CompositeType parent) : base(name, parent) { IsConstant = false; }
public abstract Operation Clone(CompositeType newParent);
/// <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> protected Property(string name, CompositeType parent) : base(name, parent) { }
/// <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 Operation(string name, CompositeType parent) : base(name, parent) { argumentList = Language.CreateParameterCollection(); }
/// <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);
/// <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);
/// <exception cref="ArgumentNullException"> /// <paramref name="parent"/> is null. /// </exception> internal CSharpEvent(CompositeType parent) : this("NewEvent", parent) { }
protected internal abstract Field Clone(CompositeType newParent);
protected override Field Clone(CompositeType newParent) { CSharpField field = new CSharpField(newParent); field.CopyFrom(this); return field; }
/// <exception cref="ArgumentException"> /// The language of <paramref name="parent"/> does not equal. /// </exception> protected Destructor(CompositeType parent) : base(null, parent) { }
public NestingRelationship Clone(CompositeType parentType, TypeBase innerType) { NestingRelationship nesting = new NestingRelationship(parentType, innerType); nesting.CopyFrom(this); return nesting; }
/// <exception cref="ArgumentException"> /// The language does not support explicit interface implementation. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parent"/> is null.-or- /// <paramref name="operation"/> is null. /// </exception> protected internal abstract Operation Implement(CompositeType parent, Operation operation, bool explicitly);
/// <exception cref="ArgumentNullException"> /// <paramref name="parent"/> is null. /// </exception> internal CSharpMethod(CompositeType parent) : this("NewMethod", parent) { }
/// <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) { }
protected internal abstract Field Clone(CompositeType newParent);
/// <exception cref="RelationshipException"> /// Cannot create nesting relationship. /// </exception> internal NestingRelationship(CompositeType parentType, TypeBase innerType) : base(parentType, innerType) { RelationshipType = RelationshipType.Nesting; Attach(); }
public override Operation Clone(CompositeType newParent) { CSharpConstructor constructor = new CSharpConstructor(newParent); constructor.CopyFrom(this); return constructor; }
/// <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 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; }
public override Operation Clone(CompositeType newParent) { CSharpProperty property = new CSharpProperty(newParent); property.CopyFrom(this); return property; }
/// <exception cref="ArgumentException"> /// <paramref name="operation"/> cannot be overridden. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="operation"/> is null. /// </exception> protected 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; }
/// <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 CSharpProperty(string name, CompositeType parent) : base(name, parent) { }
public abstract Operation Clone(CompositeType newParent);
public override Operation Clone(CompositeType newParent) { CSharpEvent newEvent = new CSharpEvent(newParent); newEvent.CopyFrom(this); return newEvent; }
/// <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 Operation(string name, CompositeType parent) : base(name, parent) { argumentList = Language.CreateParameterCollection(); }
/// <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) { }
/// <exception cref="RelationException"> /// Cannot create nesting relationship. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parentClass"/> is null.-or- /// <paramref name="innerClass"/> is null. /// </exception> internal NestingRelation(CompositeType parentType, TypeBase innerType) : base(parentType, innerType) { Attach(); }
/// <exception cref="ArgumentNullException"> /// <paramref name="parent"/> is null. /// </exception> internal CSharpField(CompositeType parent) : this("newField", parent) { }
/// <exception cref="ArgumentException"> /// The language of <paramref name="parent"/> does not equal. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parent"/> is null. /// </exception> internal CSharpDestructor(CompositeType parent) : base(parent) { AccessModifier = AccessModifier.Default; }
/// <exception cref="RelationshipException"> /// Cannot create nesting relationship. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parentClass"/> is null.-or- /// <paramref name="innerClass"/> is null. /// </exception> internal NestingRelationship(CompositeType parentType, TypeBase innerType) : base(parentType, innerType) { Attach(); }
public override Operation Clone(CompositeType newParent) { CSharpMethod method = new CSharpMethod(newParent); method.CopyFrom(this); return method; }
public override Operation Clone(CompositeType newParent) { return new CSharpDestructor(newParent); }
/// <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(); }