示例#1
0
        ///--------------------------------------------------------------------------------
        /// <summary>This property returns a copy of the forward engineering data for the solution.</summary>
        ///--------------------------------------------------------------------------------
        public IdentifierType GetForwardInstance(Solution forwardSolution)
        {
            bool           isCustomized = false;
            IdentifierType forwardItem  = new IdentifierType();

            if (ForwardInstance != null)
            {
                forwardItem.TransformDataFromObject(ForwardInstance, null, false);
                isCustomized = true;
            }
            else
            {
            }
            if (isCustomized == false)
            {
                return(null);
            }
            forwardItem.SpecSourceName = DefaultSourceName;
            if (forwardSolution.ReferencedModelIDs.Find("ItemName", forwardItem.SpecSourceName) == null)
            {
                forwardSolution.ReferencedModelIDs.Add(CreateIDReference());
            }

            #region protected
            #endregion protected

            return(forwardItem);
        }
示例#2
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method assigns a value to a property, and updates corresponding
        /// forward and reverse engineering data.</summary>
        ///
        /// <param name="propertyName">The property name.</param>
        /// <param name="propertyValue">The property value.</param>
        ///--------------------------------------------------------------------------------
        public virtual bool AssignProperty(string propertyName, object propertyValue)
        {
            if (this.SetPropertyValue(propertyName, propertyValue) == true)
            {
                if (ReverseInstance == null)
                {
                    ReverseInstance = new IdentifierType();
                    ReverseInstance.TransformDataFromObject(this, null, false);
                }
                else
                {
                    ReverseInstance.SetPropertyValue(propertyName, propertyValue);
                }
                if (ForwardInstance != null)
                {
                    this.TransformDataFromObject(ForwardInstance, null, false, true);
                }
            }
            else
            {
                return(false);
            }

            #region protected
            #endregion protected

            return(true);
        }
示例#3
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method copies changed metadata between the input
        /// instance and the current instance.</summary>
        ///
        /// <param name="inputIdentifierType">The identifiertype to get metadata.</param>
        ///--------------------------------------------------------------------------------
        public void CopyChangedMetadata(IdentifierType inputIdentifierType)
        {
            IdentifierTypeName = inputIdentifierType.IdentifierTypeName;
            Description        = inputIdentifierType.Description;

            #region protected
            #endregion protected
        }
示例#4
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method determines whether or not any metadata is
        /// different between the input instance and the current instance.</summary>
        ///
        /// <param name="inputIdentifierType">The identifiertype to compare metadata.</param>
        ///--------------------------------------------------------------------------------
        public bool IsIdenticalMetadata(IdentifierType inputIdentifierType)
        {
            if (IdentifierTypeName.GetString() != inputIdentifierType.IdentifierTypeName.GetString())
            {
                return(false);
            }
            if (Description.GetString() != inputIdentifierType.Description.GetString())
            {
                return(false);
            }

            #region protected
            #endregion protected

            return(true);
        }
示例#5
0
 ///--------------------------------------------------------------------------------
 /// <summary>This method adds a tag to TagList.</summary>
 ///--------------------------------------------------------------------------------
 public override void AddTag(string tagName)
 {
     if (ReverseInstance == null)
     {
         ReverseInstance = new IdentifierType();
         ReverseInstance.TransformDataFromObject(this, null, false);
     }
     base.AddTag(tagName);
     if (ForwardInstance == null)
     {
         ForwardInstance = new IdentifierType();
         ForwardInstance.IdentifierTypeCode = IdentifierTypeCode;
     }
     if (ForwardInstance.TagList.Find(t => t.TagName == tagName) == null)
     {
         ForwardInstance.TagList.Add(new Tag(Guid.NewGuid(), tagName));
     }
 }
示例#6
0
        ///--------------------------------------------------------------------------------
        /// <summary>This method determines whether the input instance metadata is
        /// effectively empty.</summary>
        ///
        /// <param name="inputIdentifierType">The identifiertype to compare metadata.</param>
        ///--------------------------------------------------------------------------------
        public bool IsEmptyMetadata(IdentifierType inputIdentifierType)
        {
            if (inputIdentifierType == null)
            {
                return(true);
            }
            if (inputIdentifierType.TagList.Count > 0)
            {
                return(false);
            }
            if (!String.IsNullOrEmpty(inputIdentifierType.IdentifierTypeName))
            {
                return(false);
            }
            if (!String.IsNullOrEmpty(inputIdentifierType.Description))
            {
                return(false);
            }

            #region protected
            #endregion protected

            return(true);
        }