/// <exception cref="RelationshipException"> /// Cannot create realization. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="implementer"/> is null.-or- /// <paramref name="baseType"/> is null. /// </exception> internal RealizationRelationship(TypeBase implementer, InterfaceType baseType) : base(implementer, baseType) { if (!(implementer is IInterfaceImplementer)) throw new RelationshipException(Strings.ErrorNotInterfaceImplementer); Attach(); }
void InitEditor(TypeBase typeBase) { if (typeBase is CompositeType) { editor = new CompositeTypeEditor().SetCompositeType((CompositeType)typeBase); } else if (typeBase is EnumType) { editor = new EnumTypeEditor().SetEnumType((EnumType)typeBase); } else if (typeBase is DelegateType) { editor = new DelegateTypeEditor().SetDelegateType((DelegateType)typeBase); } else throw new NotSupportedException(typeBase.GetType().FullName); Handler.EditHandler = editor; editor.Dock = System.Windows.Forms.DockStyle.Fill; Controls.Add(editor); UpdateName(); typeBase.Renamed += new EventHandler(typeBase_StateChanged); typeBase.StateChanged += new EventHandler(typeBase_StateChanged); }
protected void SetTypeBase(TypeBase typeBase) { type = typeBase; type.Clean(); type.Modified += new EventHandler(type_Modified); type.ProjectInfo.Saved += new EventHandler(Project_Saved); }
public TypeNode(TypeBase type) { ImageKey = type.EntityType.ToString(); SelectedImageKey = ImageKey; TypeBase = type; TypeBase.Renamed += new EventHandler(TypeBase_Renamed); Text = TypeBase.Name; }
/// <exception cref="ArgumentNullException"> /// <paramref name="first"/> is null.-or- /// <paramref name="second"/> is null. /// </exception> protected TypeRelationship(TypeBase first, TypeBase second) { if (first == null) throw new ArgumentNullException("first"); if (second == null) throw new ArgumentNullException("second"); this.first = first; this.second = second; }
public void ShowDialog(TypeBase typeBase, bool memberOnly = false) { type = typeBase; TypeBase copy = null; if (typeBase is CompositeType) { if (type is ClassType) copy = ((ClassType)type).Clone(); else if (type is StructureType) copy = ((StructureType)type).Clone(); else if (type is InterfaceType) copy = ((InterfaceType)type).Clone(); copy.ProjectInfo = type.ProjectInfo; editor = new CompositeTypeEditor().SetCompositeType((CompositeType)copy, memberOnly); MinimumSize = new Size(790, 610); Size = new Size(1000, 700); } else if (typeBase is EnumType) { copy = ((EnumType)type).Clone(); copy.ProjectInfo = type.ProjectInfo; editor = new EnumTypeEditor().SetEnumType((EnumType)copy, memberOnly); } else if (typeBase is DelegateType) { copy = ((DelegateType)type).Clone(); copy.ProjectInfo = type.ProjectInfo; editor = new DelegateTypeEditor().SetDelegateType((DelegateType)copy, memberOnly); } else throw new NotSupportedException(typeBase.GetType().FullName); UpdateButtons(); editor.EditStateChanged += new EventHandler(editor_EditStateChanged); editor.Dock = System.Windows.Forms.DockStyle.Fill; kryptonPanelMain.Controls.Add(editor); ShowDialog(); }
protected override void CopyFrom(TypeBase type) { base.CopyFrom(type); CompositeType compositeType = (CompositeType) type; fields.Clear(); fields.Capacity = compositeType.fields.Capacity; operations.Clear(); operations.Capacity = compositeType.operations.Capacity; foreach (Field field in compositeType.fields) { AddField(field.Clone(this)); } foreach (Operation operation in compositeType.operations) { AddOperation(operation.Clone(this)); } }
internal void RemoveNestedChild(TypeBase type) { if (type != null && nestedChildren.Remove(type)) Changed(); }
internal void AddNestedChild(TypeBase type) { if (type != null && !nestedChildren.Contains(type)) { nestedChildren.Add(type); Changed(); } }
public MemberInfo(TypeBase type) { Type = type; }
/// <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 TypeDocument(TypeBase document, IDockForm dockForm) { InitializeComponent(); DockForm = dockForm; InitEditor(document); }
/// <exception cref="ArgumentNullException"> /// <paramref name="type"/> is null. /// </exception> public static Image GetImage(TypeBase type) { if (type == null) throw new ArgumentNullException("type"); return GetImage(type.EntityType, type.AccessModifier); }
public TypeModel(TypeBase type, IEnumerable<TypeBase> types, IRazorTemplate template) : base(type.ProjectInfo.Name, template) { Type = type; Types = types; }
public string GetNested(TypeBase type) { var model = new TypeModel(type, Types, Template); return RazorHelper.Parse(Template.Template, model); }
public DependencyRelationship Clone(TypeBase first, TypeBase second) { DependencyRelationship dependency = new DependencyRelationship(first, second); dependency.CopyFrom(this); return dependency; }
/// <exception cref="ArgumentNullException"> /// <paramref name="first"/> is null.-or- /// <paramref name="second"/> is null. /// </exception> internal DependencyRelationship(TypeBase first, TypeBase second) : base(first, second) { Attach(); }
public NestingRelationship Clone(CompositeType parentType, TypeBase innerType) { NestingRelationship nesting = new NestingRelationship(parentType, innerType); nesting.CopyFrom(this); return nesting; }
public AssociationRelationship Clone(TypeBase first, TypeBase second) { AssociationRelationship association = new AssociationRelationship(first, second); association.CopyFrom(this); return association; }
public RealizationRelationship Clone(TypeBase implementer, InterfaceType baseType) { RealizationRelationship realization = new RealizationRelationship(implementer, baseType); realization.CopyFrom(this); return realization; }
protected override void CopyFrom(TypeBase type) { base.CopyFrom(type); EnumType enumType = (EnumType) type; values.Clear(); values.Capacity = enumType.values.Capacity; foreach (EnumValue value in enumType.values) { values.Add(value.Clone()); } }
protected override void CopyFrom(TypeBase type) { base.CopyFrom(type); DelegateType delegateType = (DelegateType) type; returnType = delegateType.returnType; argumentList = delegateType.argumentList.Clone(); }
protected virtual void CopyFrom(TypeBase type) { Id = type.Id; name = type.name; access = type.access; comments = type.comments; }
/// <exception cref="ArgumentNullException"> /// <paramref name="first"/> or <paramref name="second"/> is null. /// </exception> internal AssociationRelationship(TypeBase first, TypeBase second) : base(first, second) { Attach(); }
protected override void CopyFrom(TypeBase type) { base.CopyFrom(type); ClassType classType = (ClassType) type; modifier = classType.modifier; strategy = classType.strategy; }
/// <exception cref="ArgumentNullException"> /// <paramref name="first"/> is null.-or- /// <paramref name="second"/> is null. /// </exception> internal AssociationRelationship(TypeBase first, TypeBase second, AssociationType type) : base(first, second) { this.associationType = type; Attach(); }
/// <exception cref="ArgumentNullException"> /// <paramref name="typeBase"/> is null. /// </exception> protected TypeShape(TypeBase typeBase) : base(typeBase) { MinimumSize = new Size(DefaultWidth, MinimumSize.Height); typeBase.Modified += new EventHandler(typeBase_Modified); }
protected override void CopyFrom(TypeBase type) { base.CopyFrom(type); tableName = ((SingleInharitanceType)type).TableName; }
private bool IsNestedAncestor(TypeBase type) { if (NestingParent != null && NestingParent.IsNestedAncestor(type)) return true; else return (type == this); }