Exemple #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();
        }