Пример #1
0
        /// <summary>
        /// Creates a new empty element.
        /// Adaptee is set to null, an empty comments collection is created.
        /// </summary>
        /// <param name="_schema">
        /// Reference to the Schema instance that is the top
        /// of this model hierarchy.
        /// </param>
        /// <param name="_metaclass">
        /// UML metaclass(es) that this element is instance of.
        /// Bitwise combination of StereotypeTarget values.
        /// </param>
        protected _Element(Schema _schema, StereotypeTarget _metaclass)
        {
            adaptedElement = default(NUmlType);

            comments = new ObservableCollection <Comment>();
            comments.CollectionChanged += OnCommentsChanged;

            appliedStereotypes = new ObservableCollection <StereotypeInstance>();

            schema    = _schema;
            metaclass = _metaclass;

            if (schema.Model != null && schema.Model.VersionManager != null)
            {
                schema.Model.VersionManager.SetAsFirstVersion(this, schema.Model.Version);
            }

#if DEBUG
            ElementWatcher.InvokeElementCreated(this);
#endif
            Guid = XCaseGuid.NewGuid();
        }
Пример #2
0
 /// <summary>
 /// Creates new instance of <see cref="Diagram" />.
 /// </summary>
 /// <param name="capt">caption of the diagram</param>
 protected Diagram(String capt)
 {
     diagramElements = new Dictionary <Element, ViewHelper>();
     caption         = capt;
     Guid            = XCaseGuid.NewGuid();
 }
Пример #3
0
 /// <summary>
 /// Creates new instance of <see cref="Diagram" />.
 /// </summary>
 protected Diagram()
     : this("Undefined")
 {
     Guid = XCaseGuid.NewGuid();
 }