Пример #1
0
 public Model(String name, String prefix, Int32 id, Package owner)
     : base(name,prefix,id,owner)
 {
     this.glossary = new GlossaryItems(this);
     this.stakeholders = new Stakeholders(this);
     this.creationDate = DateTime.Now;
 }
Пример #2
0
 internal Package(String name, String prefix, Int32 id, Package owner)
     : base(name,prefix,id,owner)
 {
     this.actors = new Actors(this);
     this.packages = new Packages(this);
     this.useCases = new UseCases(this);
 }
 internal IdentificableObject(String name, String prefix, Int32 id, Package owner)
 {
     MakeUniqueID();
     this.name = name;
     this.prefix = prefix;
     this.id = id;
     this.owner = owner;
 }
Пример #4
0
 internal Actors(Package owner)
 {
     base.Owner = owner;
 }
Пример #5
0
 internal Stakeholder(String name, String prefix, Int32 id, Package owner)
     : base(name,prefix,id,owner)
 {
 }
Пример #6
0
		internal Actor(String name, String prefix, Int32 id, Package owner)
			: base(name,prefix,id,owner)
		{
		}
Пример #7
0
 internal Packages(Package owner)
 {
     base.Owner = owner;
 }
Пример #8
0
 internal GlossaryItem(String name, String prefix, Int32 id, Package owner)
     : base(name,prefix,id,owner)
 {
 }
Пример #9
0
 public void AddPackage(Package package)
 {
     package.Owner = this;
     Packages.Add(package);
 }
Пример #10
0
        internal void PurgeReferences(
			object element,
			Package targetPackage,
			String oldNameStartTag,
			String oldNameEndTag,
			String newNameStartTag,
			String newNameEndTag,
			Boolean dontMark)
        {
            Package currentPackage = this;

            if(targetPackage == null)
            {
                while(currentPackage.Owner != null)
                {
                    currentPackage = currentPackage.Owner;
                }
            }

            if(element.GetType() == typeof(Package))
            {
                foreach(Actor actor in ((Package)element).Actors)
                {
                    currentPackage.PurgeReferences(
                        actor,
                        null,
                        oldNameStartTag,
                        oldNameEndTag,
                        newNameStartTag,
                        newNameEndTag,
                        dontMark);
                }
                foreach(UseCase useCase in ((Package)element).UseCases)
                {
                    currentPackage.PurgeReferences(
                        useCase,
                        null,
                        oldNameStartTag,
                        oldNameEndTag,
                        newNameStartTag,
                        newNameEndTag,
                        dontMark);
                }
                foreach(Package package in ((Package)element).Packages)
                {
                    currentPackage.PurgeReferences(
                        package,
                        null,
                        oldNameStartTag,
                        oldNameEndTag,
                        newNameStartTag,
                        newNameEndTag,
                        dontMark);
                }
                if(!dontMark)
                {
                    this.ChangeReferences(
                        ((Package)element).Name,
                        oldNameStartTag,
                        oldNameEndTag,
                        ((Package)element).Name,
                        newNameStartTag,
                        newNameEndTag,
                        false);
                    this.ChangeReferences(
                        ((Package)element).Path,
                        oldNameStartTag,
                        oldNameEndTag,
                        ((Package)element).Path,
                        newNameStartTag,
                        newNameEndTag,
                        false);
                }
            }

            if(element.GetType() == typeof(UseCase))
            {
                foreach(Package package in this.Packages)
                {
                    package.PurgeReferences(
                        element,
                        null,
                        oldNameStartTag,
                        oldNameEndTag,
                        newNameStartTag,
                        newNameEndTag,
                        dontMark);
                }
                if(!dontMark)
                {
                    this.ChangeReferences(
                        ((UseCase)element).Name,
                        oldNameStartTag,
                        oldNameEndTag,
                        ((UseCase)element).Name,
                        newNameStartTag,
                        newNameEndTag,
                        false);
                    this.ChangeReferences(
                        ((UseCase)element).Path,
                        oldNameStartTag,
                        oldNameEndTag,
                        ((UseCase)element).Path,
                        newNameStartTag,
                        newNameEndTag,
                        false);
                }
                // remove use case references in use case's steps
                foreach(UseCase useCase in this.UseCases)
                {
                    foreach(Step step in useCase.Steps)
                    {
                        if(step.Dependency.PartnerUniqueID == ((UseCase)element).UniqueID)
                        {
                            step.Dependency.Type = DependencyItem.ReferenceType.None;
                            step.Dependency.PartnerUniqueID = "";
                            step.Dependency.Stereotype = "";
                        }
                    }
                }
            }

            if(element.GetType() == typeof(Actor))
            {
                foreach(UseCase useCase in this.UseCases)
                {
                    ActiveActor tmpAActor = null;
                    foreach(ActiveActor aactor in useCase.ActiveActors)
                    {
                        if(aactor.ActorUniqueID == ((Actor)element).UniqueID)
                        {
                            tmpAActor = aactor;
                        }
                    }
                    if(tmpAActor != null)
                    {
                        useCase.ActiveActors.Remove(tmpAActor);
                    }
                }
                foreach(Package package in this.Packages)
                {
                    package.PurgeReferences(
                        element,
                        null,
                        oldNameStartTag,
                        oldNameEndTag,
                        newNameStartTag,
                        newNameEndTag,
                        dontMark);
                }
                if(!dontMark)
                {
                    this.ChangeReferences(
                        ((Actor)element).Name,
                        oldNameStartTag,
                        oldNameEndTag,
                        ((Actor)element).Name,
                        newNameStartTag,
                        newNameEndTag,
                        false);
                    this.ChangeReferences(
                        ((Actor)element).Path,
                        oldNameStartTag,
                        oldNameEndTag,
                        ((Actor)element).Path,
                        newNameStartTag,
                        newNameEndTag,
                        false);
                }
            }
        }
Пример #11
0
        public void RemovePackage(
			Package package,
			String oldNameStartTag,
			String oldNameEndTag,
			String newNameStartTag,
			String newNameEndTag,
			Boolean dontMarkOccurrences)
        {
            this.PurgeReferences(
                package,
                null,
                oldNameStartTag,
                oldNameEndTag,
                newNameStartTag,
                newNameEndTag,
                dontMarkOccurrences);
            Packages.Remove(package);
        }
Пример #12
0
 public Package NewPackage(String name, String prefix, Int32 id)
 {
     Package package = new Package(name,prefix,id,this);
     return package;
 }
Пример #13
0
 internal UseCases(Package owner)
 {
     base.Owner = owner;
 }
Пример #14
0
 public Model(String name, String prefix, Int32 id, Package owner)
     : base(name,prefix,id,owner)
 {
     this.glossary = new GlossaryItems(this);
 }
Пример #15
0
		internal GlossaryItems(Package owner)
		{
			base.Owner = owner;
		}
Пример #16
0
 internal Stakeholders(Package owner)
 {
     base.Owner = owner;
 }