Пример #1
0
        /// <summary>
        ///     Implements IForcesModel.GetDecisions()
        /// </summary>
        /// <returns></returns>
        public IEAElement[] GetDecisions()
        {
            IEARepository repository = EAMain.Repository;

            IEAElement[] topicsElements = (from diagramObject in _diagram.GetElements()
                                           select repository.GetElementByID(diagramObject.ElementID)
                                           into element
                                           where
                                           EAMain.IsTopic(element) &&
                                           !element.TaggedValueExists(EATaggedValueKeys.IsForceElement, _diagram.GUID)
                                           select element).ToArray();



            ITopic[] topics = (from element in topicsElements select Topic.Load(element)).ToArray();

            IEnumerable <IEAElement> decisionsFromTopic =
                (from ITopic topic in topics select topic.GetDecisionsForTopic()).SelectMany(x => x);


            IEnumerable <IEAElement> decisionsDirectlyFromDiagram = (from diagramObject in _diagram.GetElements()
                                                                     select
                                                                     repository.GetElementByID(
                                                                         diagramObject.ElementID)
                                                                     into element
                                                                     where
                                                                     element.TaggedValueExists(
                                                                         EATaggedValueKeys.IsDecisionElement,
                                                                         _diagram.GUID)
                                                                     select element);

            return(decisionsFromTopic.Union(decisionsDirectlyFromDiagram).ToArray());
        }
Пример #2
0
        /// <summary>
        ///     Implements IForcesModel.GetForces()
        /// </summary>
        /// <returns></returns>
        public IEnumerable <IEAElement> GetForces()
        {
            IEARepository repository = EAMain.Repository;

            return((from diagramObject in _diagram.GetElements()
                    select repository.GetElementByID(diagramObject.ElementID)
                    into element
                    where element.TaggedValueExists(EATaggedValueKeys.IsForceElement, _diagram.GUID)
                    select element).ToArray());
        }
Пример #3
0
        public IEAElement GetChronologyTopicElement()
        {
            IEADiagram    diagram    = GetDecisionChronologicalDiagram();
            IEARepository repository = EAMain.Repository;

            IEAElement[] elements = (from diagramObject in diagram.GetElements()
                                     select repository.GetElementByID(diagramObject.ElementID)
                                     into elem
                                     where EAConstants.TopicMetaType == elem.MetaType
                                     select elem).ToArray();
            Assert.IsNotNull(elements);
            IEAElement element = elements.ElementAt(0);

            Assert.IsNotNull(element);
            return(element);
        }
Пример #4
0
        private IEAElement GetStakeholderActorElement()
        {
            IEADiagram    diagram    = GetDecisionStakeholderDiagram();
            IEARepository repository = EAMain.Repository;

            IEAElement[] elements = (from diagramObject in diagram.GetElements()
                                     select repository.GetElementByID(diagramObject.ElementID)
                                     into elem
                                     where EAConstants.StakeholderMetaType == elem.MetaType
                                     select elem).ToArray();
            Assert.IsNotNull(elements);
            IEAElement element = elements.ElementAt(0);

            Assert.IsNotNull(element);
            return(element);
        }