DataDictionary.Types.Structure.SetUpdateInformation C# (CSharp) Méthode

SetUpdateInformation() public méthode

Sets the update information for this structure
public SetUpdateInformation ( ModelElement source ) : void
source ModelElement The source structure for which this structure has been created (as an update)
Résultat void
        public override void SetUpdateInformation(ModelElement source)
        {
            base.SetUpdateInformation(source);
            Structure sourceStructure = (Structure) source;

            foreach (StructureElement element in Elements)
            {
                StructureElement baseElement = sourceStructure.FindStructureElement(element.Name);
                if (baseElement != null)
                {
                    element.SetUpdateInformation(baseElement);
                }
            }

            foreach (Procedure procedure in Procedures)
            {
                Procedure baseProcedure = sourceStructure.FindProcedure(procedure.Name);
                if (baseProcedure != null)
                {
                    procedure.SetUpdateInformation(baseProcedure);
                }
            }

            foreach (Rule rule in Rules)
            {
                Rule baseRule = sourceStructure.FindRule(rule.Name);
                if (baseRule != null)
                {
                    rule.SetUpdateInformation(baseRule);
                }
            }

            foreach (StateMachine stateMachine in StateMachines)
            {
                StateMachine baseStateMachine = sourceStructure.FindStateMachine(stateMachine.Name);
                if (baseStateMachine != null)
                {
                    stateMachine.SetUpdateInformation(baseStateMachine);
                }
            }
        }

Usage Example

Exemple #1
0
        /// <summary>
        ///     Creates a copy of the structure in the designated dictionary. The namespace structure is copied over.
        ///     The new structure is set to update this one.
        /// </summary>
        /// <param name="dictionary">The target dictionary of the copy</param>
        /// <returns></returns>
        public Structure CreateStructureUpdate(Dictionary dictionary)
        {
            Structure retVal = (Structure)acceptor.getFactory().createStructure();

            retVal.Name       = Name;
            retVal.Comment    = Comment;
            retVal.IsAbstract = IsAbstract;
            retVal.SetUpdateInformation(this);

            String[] names = FullName.Split('.');
            names = names.Take(names.Count() - 1).ToArray();
            NameSpace nameSpace = dictionary.GetNameSpaceUpdate(names, Dictionary);

            nameSpace.appendStructures(retVal);

            return(retVal);
        }