Exemple #1
0
        /// <summary>
        /// Returns a value indicating whether the source element represented by the
        /// specified root ProtoElement can be added to this element.
        /// </summary>
        /// <param name="rootElement">The root ProtoElement representing a source element.  This can be null,
        /// in which case the ElementGroupPrototype does not contain an ProtoElements
        /// and the code should inspect the ElementGroupPrototype context information.</param>
        /// <param name="elementGroupPrototype">The ElementGroupPrototype that contains the root ProtoElement.</param>
        /// <returns>
        /// True if the source element represented by the ProtoElement can be added to this target element.
        /// </returns>
        protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
        {
            Guard.NotNull(() => rootElement, rootElement);
            Guard.NotNull(() => elementGroupPrototype, elementGroupPrototype);

            return(false);
        }
        /// <summary>
        /// Returns a value indicating whether the source element represented by the
        /// specified root ProtoElement can be added to this element.
        /// </summary>
        /// <param name="rootElement">The root ProtoElement representing a source element.  This can be null,
        /// in which case the ElementGroupPrototype does not contain an ProtoElements
        /// and the code should inspect the ElementGroupPrototype context information.</param>
        /// <param name="elementGroupPrototype">The ElementGroupPrototype that contains the root ProtoElement.</param>
        /// <returns>
        /// True if the source element represented by the ProtoElement can be added to this target element.
        /// </returns>
        protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
        {
            Guard.NotNull(() => rootElement, rootElement);
            Guard.NotNull(() => elementGroupPrototype, elementGroupPrototype);

            return false;
        }
Exemple #3
0
 /// <summary>
 /// Determines whether this instance [can merge interface layer] the specified root element.
 /// </summary>
 /// <param name="rootElement">The root element.</param>
 /// <param name="elementGroupPrototype">The element group prototype.</param>
 /// <returns>
 ///     <c>true</c> if this instance [can merge interface layer] the specified root element; otherwise, <c>false</c>.
 /// </returns>
 private bool CanMergeInterfaceLayer(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
 {
     if (elementGroupPrototype == null)
     {
         throw new ArgumentNullException("elementGroupPrototype");
     }
     return(InterfaceLayer == null);
 }
 protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
 {
     if (this.Parent != null)
     {
         // forward to parent
         return(this.Parent.internalCanMerge(this, rootElement, elementGroupPrototype));
     }
     return(base.CanMerge(rootElement, elementGroupPrototype));
 }
 protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
 {
     if (this.Parent != null)
     {
         // forward to parent
         return this.Parent.internalCanMerge(this, rootElement, elementGroupPrototype);
     }
     return base.CanMerge(rootElement, elementGroupPrototype);
 }
Exemple #6
0
        protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
        {
            if (rootElement != null &&
                rootElement.ElementId == Guid.Empty)
            {
                var rootElementDomainInfo = Partition.DomainDataDirectory.GetDomainClass(rootElement.DomainClassId);

                if (rootElementDomainInfo.IsDerivedFrom(NavigationProperty.DomainClassId))
                {
                    return(false);
                }
            }
            return(base.CanMerge(rootElement, elementGroupPrototype));
        }
        protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
        {
            if (rootElement != null
                && rootElement.ElementId == Guid.Empty)
            {
                var rootElementDomainInfo = Partition.DomainDataDirectory.GetDomainClass(rootElement.DomainClassId);

                if (rootElementDomainInfo.IsDerivedFrom(NavigationProperty.DomainClassId))
                {
                    return false;
                }
            }
            return base.CanMerge(rootElement, elementGroupPrototype);
        }
Exemple #8
0
        internal virtual bool internalCanMerge(VDWidget origianlTargetWidget, ProtoElementBase sourceRootElement, ElementGroupPrototype elementGroupPrototype)
        {
            if (elementGroupPrototype == null)
            {
                throw new ArgumentNullException("elementGroupPrototype");
            }

            if (sourceRootElement != null)
            {
                DomainClassInfo rootElementDomainInfo = this.Partition.DomainDataDirectory.GetDomainClass(sourceRootElement.DomainClassId);
                if (rootElementDomainInfo.IsDerivedFrom(VDWidget.DomainClassId))
                {
                    return(MergeManager.Instance.CanMerge(rootElementDomainInfo.Id, this.GetDomainClass().Id));
                }
            }

            return(base.CanMerge(sourceRootElement, elementGroupPrototype));
        }
Exemple #9
0
        /// <summary>
        /// Determines whether this instance [can merge layer] the specified root element.
        /// </summary>
        /// <param name="rootElement">The root element.</param>
        /// <param name="elementGroupPrototype">The element group prototype.</param>
        /// <returns>
        ///     <c>true</c> if this instance [can merge layer] the specified root element; otherwise, <c>false</c>.
        /// </returns>
        private bool CanMergeLayer(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
        {
            if (elementGroupPrototype == null)
            {
                throw new ArgumentNullException("elementGroupPrototype");
            }

            if (rootElement != null)
            {
                DomainClassInfo rootElementDomainInfo =
                    Partition.DomainDataDirectory.GetDomainClass(rootElement.DomainClassId);

                if (rootElementDomainInfo.IsDerivedFrom(Layer.DomainClassId))
                {
                    return(Component.GetLayerLevel(rootElement.DomainClassId) == Level);
                }
            }
            return(false);
        }
        /// <summary>
        /// Returns a value indicating whether the source element represented by the
        /// specified root ProtoElement can be added to this element.
        /// </summary>
        /// <param name="rootElement">The root ProtoElement representing a source element.  This can be null,
        /// in which case the ElementGroupPrototype does not contain an ProtoElements
        /// and the code should inspect the ElementGroupPrototype context information.</param>
        /// <param name="elementGroupPrototype">The ElementGroupPrototype that contains the root ProtoElement.</param>
        /// <returns>
        /// True if the source element represented by the ProtoElement can be added to this target element.
        /// </returns>
        protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
        {
            Guard.NotNull(() => rootElement, rootElement);
            Guard.NotNull(() => elementGroupPrototype, elementGroupPrototype);

            if (rootElement != null)
            {
                var rootElementDomainInfo = this.Partition.DomainDataDirectory.GetDomainClass(rootElement.DomainClassId);

                if (rootElementDomainInfo.IsDerivedFrom(ElementSchema.DomainClassId) ||
                    rootElementDomainInfo.IsDerivedFrom(CollectionSchema.DomainClassId) ||
                    rootElementDomainInfo.IsDerivedFrom(ExtensionPointSchema.DomainClassId))
                {
                    return(true);
                }
            }

            return(base.CanMerge(rootElement, elementGroupPrototype));
        }
Exemple #11
0
        /// <summary>
        /// Check whether this model class is an acceptor for the content of a prototype
        /// </summary>
        /// <param name="elementGroupPrototype"></param>
        /// <param name="protoElement"></param>
        /// <returns></returns>
        protected override bool CanAddChildElement(ElementGroupPrototype elementGroupPrototype, ProtoElementBase protoElement)
        {
            if (protoElement != null)
            {
                bool          canAdd        = false;
                MetaClassInfo metaClassInfo = this.Store.MetaDataDirectory.FindMetaClass(protoElement.MetaClassId);

                if (typeof(ISpySoft.SFSchemaLanguage.DomainModel.SchemaModelItem).IsAssignableFrom(metaClassInfo.ImplementationClass))
                {
                    canAdd = true;
                }

                return(canAdd);
            }
            return(false);
        }
Exemple #12
0
 /// <summary>
 /// Returns a value indicating whether the source element represented by the
 /// specified root ProtoElement can be added to this element.
 /// </summary>
 /// <param name="rootElement">
 /// The root ProtoElement representing a source element.  This can be null,
 /// in which case the ElementGroupPrototype does not contain an ProtoElements
 /// and the code should inspect the ElementGroupPrototype context information.
 /// </param>
 /// <param name="elementGroupPrototype">The ElementGroupPrototype that contains the root ProtoElement.</param>
 /// <returns>true if the source element represented by the ProtoElement can be added to this target element.</returns>
 protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
 {
     return(internalCanMerge(this, rootElement, elementGroupPrototype));
 }
Exemple #13
0
 //Prevent pasting of sockets
 protected override bool CanMerge(ProtoElementBase rootElement, ElementGroupPrototype elementGroupPrototype)
 {
     return(false);
 }