public void Execute(RationallyView view, Shape changedShape)
 {
     if (changedShape.Text != string.Empty)
     {
         Globals.RationallyAddIn.Model.DecisionName = changedShape.Text;
     }
 }
        public void Execute(RationallyView view, Shape changedShape)
        {
            ForceDescriptionComponent forceDescription = (ForceDescriptionComponent)view.GetComponentByShape(changedShape);

            if (forceDescription != null)
            {
                Globals.RationallyAddIn.Model.Forces[forceDescription.Index].Description = forceDescription.Text;
            }
        }
示例#3
0
        public void Execute(RationallyView view, Shape changedShape)
        {
            VisioShape comp = view.Children.Find(x => x is PlanningContainer);

            if (comp is PlanningContainer)
            {
                comp.MsvSdContainerLocked = false;
            }
        }
示例#4
0
        public void Execute(RationallyView view, Shape changedShape)
        {
            VisioShape comp = view.Children.Find(x => x is RelatedDocumentsContainer);

            if (comp is RelatedDocumentsContainer)
            {
                comp.MsvSdContainerLocked = false; //Child shapes can now be removed.
            }
        }
 public void Execute(RationallyView view, Shape changedShape)
 {
     if (!Globals.RationallyAddIn.Application.IsUndoingOrRedoing)
     {
         //find shape in view tree
         RelatedURLURLComponent urlUrl = (RelatedURLURLComponent)Globals.RationallyAddIn.View.GetComponentByShape(changedShape);
         //locate connected model object
         RelatedDocument document = Globals.RationallyAddIn.Model.Documents[urlUrl.Index];
         //update the url value
         document.Path = urlUrl.Text;
     }
 }
示例#6
0
 public void Execute(RationallyView view, Shape changedShape)
 {
     if (!Globals.RationallyAddIn.Application.IsUndoingOrRedoing)
     {
         //find shape in view tree
         RelatedDocumentTitleComponent relatedDocumentTitle = (RelatedDocumentTitleComponent)Globals.RationallyAddIn.View.GetComponentByShape(changedShape);
         //locate connected model object
         RelatedDocument document = Globals.RationallyAddIn.Model.Documents[relatedDocumentTitle.Index];
         //update the document name
         document.Name = relatedDocumentTitle.Text;
     }
 }
示例#7
0
        public void Execute(RationallyView view, Shape changedShape)
        {
            RelatedDocumentsContainer relatedDocumentsContainer = (RelatedDocumentsContainer)view.Children.First(x => x is RelatedDocumentsContainer);

            foreach (RelatedDocumentContainer relatedDocumentContainer in relatedDocumentsContainer.Children.Where(c => c is RelatedDocumentContainer).Cast <RelatedDocumentContainer>().ToList())
            {
                if ((relatedDocumentContainer.Children.Where(c => c.Shape.Equals(changedShape)).ToList().Count > 0) && !relatedDocumentContainer.Deleted) //check if this related document contains the to be deleted component and is not already deleted
                {
                    relatedDocumentContainer.Deleted = true;
                    relatedDocumentContainer.Shape.Delete(); //delete the parent wrapper of s
                }
            }
        }
示例#8
0
        public void Execute(RationallyView view, Shape changedShape)
        {
            ForceConcernComponent forceConcern = (ForceConcernComponent)view.GetComponentByShape(changedShape);

            if (forceConcern != null)
            {
                if (forceConcern.Text == string.Empty)
                {
                    forceConcern.Text = ForceConcernComponent.DefaultConcern;
                }
                Globals.RationallyAddIn.Model.Forces[forceConcern.Index].Concern = forceConcern.Text;
            }
        }
        public void Execute(RationallyView view, Shape changedShape)
        {
            AlternativesContainer cont = (AlternativesContainer)view.Children.First(x => x is AlternativesContainer);

            foreach (AlternativeShape alternativeContainer in cont.Children.Where(c => c is AlternativeShape).Cast <AlternativeShape>().ToList())
            {
                if ((alternativeContainer.Children.Where(c => c.Shape.Equals(changedShape)).ToList().Count > 0) && !alternativeContainer.Deleted) //check if this alternative contains the to be deleted component and is not already deleted
                {
                    alternativeContainer.Deleted = true;
                    alternativeContainer.Shape.Delete(); //delete the parent wrapper of s
                }
            }
        }
示例#10
0
        public void Execute(RationallyView view, Shape changedShape)
        {
            ForcesContainer forcesContainer = (ForcesContainer)view.Children.First(c => c is ForcesContainer);

            foreach (ForceContainer forceContainer in forcesContainer.Children.Where(c => c is ForceContainer).Cast <ForceContainer>().ToList()) //find all candidate containers
            {
                if ((forceContainer.Children.Where(c => c.Shape.Equals(changedShape)).ToList().Count > 0) && !forceContainer.Deleted)            //find the right container of changedShape and the container was not part of the selection at the querycancel shapedelete event
                {
                    forceContainer.Deleted = true;
                    forceContainer.Shape.Delete();
                }
            }
        }
示例#11
0
        public void Execute(RationallyView view, Shape changedShape)
        {
            StakeholdersContainer cont = (StakeholdersContainer)view.Children.First(x => x is StakeholdersContainer);

            foreach (StakeholderContainer stakeholderContainer in cont.Children.Where(c => c is StakeholderContainer).Cast <StakeholderContainer>().ToList())
            {
                if ((stakeholderContainer.Children.Where(c => c.Shape.Equals(changedShape)).ToList().Count > 0) && !stakeholderContainer.Deleted) //check if this stakeholder contains the to be deleted component and is not already deleted
                {
                    stakeholderContainer.Deleted = true;
                    stakeholderContainer.Shape.Delete(); //delete the parent wrapper of s
                }
            }
        }
        public void Execute(RationallyView view, Shape changedShape)
        {
            AlternativeStateShape alternativeState = (AlternativeStateShape)view.GetComponentByShape(changedShape);

            if (alternativeState == null)
            {
                return;
            }

            int index = alternativeState.Index;

            Globals.RationallyAddIn.Model.Alternatives[index].Status = alternativeState.Text;
        }
示例#13
0
        public void Execute(RationallyView view, Shape changedShape)
        {
            PlanningContainer cont = (PlanningContainer)view.Children.First(x => x is PlanningContainer);

            foreach (PlanningItemComponent planningComponent in cont.Children.Where(c => c is PlanningItemComponent).Cast <PlanningItemComponent>().ToList())
            {
                //check if this planning component contains the to be deleted component and is not already deleted
                if (planningComponent.ExistsInTree(changedShape) && !planningComponent.Deleted)
                {
                    planningComponent.Deleted = true;
                    planningComponent.Shape.Delete(); //delete the parent wrapper of s
                }
            }
        }
        public void Execute(RationallyView view, Shape changedShape)
        {
            ForcesContainer forcesContainer = (ForcesContainer)view.Children.First(c => c is ForcesContainer);

            ForceValueComponent forceValue = (ForceValueComponent)view.GetComponentByShape(changedShape);
            string forceVal = forceValue.Text == string.Empty ? "0" : forceValue.Text;

            Globals.RationallyAddIn.Model.Forces[forceValue.Index].ForceValueDictionary[forceValue.ForceAlternativeId] = forceVal;
            RepaintHandler.Repaint(forceValue); //repaint the force value, for coloring
            ForceTotalsRow forceTotalsRow = forcesContainer.Children.First(c => c is ForceTotalsRow) as ForceTotalsRow;

            if (forceTotalsRow != null)
            {
                RepaintHandler.Repaint(forceTotalsRow.Children.Where(c => c is ForceTotalComponent).FirstOrDefault(c => c.ForceAlternativeId == forceValue.ForceAlternativeId));
            }
        }
        public void Execute(RationallyView view, Shape changedShape)
        {
            VisioShape planningItemTextComponent = new VisioShape(view.Page)
            {
                Shape = changedShape
            };

            if (Globals.RationallyAddIn.Model.PlanningItems.Count <= planningItemTextComponent.Index)
            {
                return;
            }

            PlanningItem toUpdate = Globals.RationallyAddIn.Model.PlanningItems[planningItemTextComponent.Index];

            toUpdate.ItemText = planningItemTextComponent.Text;
        }
        public static void HandleEvent(string eventKey, RationallyView view, Shape changedShape)
        {
            if (registry == null)
            {
                registry = new Dictionary <string, List <IQueryDeleteEventHandler> >();
            }

            if (registry.ContainsKey(eventKey))
            {
                registry[eventKey].ForEach(eh => eh.Execute(view, changedShape));
            }
            else
            {
                Log.Info("NOTICE: query delete event requested on key with to registered handlers: " + eventKey);
            }
        }
        public void Execute(RationallyView view, Shape changedShape)
        {
            VisioShape alternativeTitleComponent = new VisioShape(view.Page)
            {
                Shape = changedShape
            };

            if (Globals.RationallyAddIn.Model.Alternatives.Count <= alternativeTitleComponent.Index)
            {
                return;
            }

            Alternative alternativeToUpdate = Globals.RationallyAddIn.Model.Alternatives[alternativeTitleComponent.Index];

            alternativeToUpdate.Title = alternativeTitleComponent.Text;
        }
示例#18
0
        public void Execute(RationallyView view, Shape changedShape)
        {
            VisioShape stakeholderRoleComponent = new VisioShape(view.Page)
            {
                Shape = changedShape
            };

            if (Globals.RationallyAddIn.Model.Stakeholders.Count <= stakeholderRoleComponent.Index)
            {
                return;
            }

            Stakeholder toUpdate = Globals.RationallyAddIn.Model.Stakeholders[stakeholderRoleComponent.Index];

            toUpdate.Role = stakeholderRoleComponent.Text;
        }
        private void RationallyAddIn_Startup(object sender, EventArgs e)
        {
            //init for logger
            XmlConfigurator.Configure();
            Log.Info("======== NEW SESSION ========");
            Model       = new RationallyModel();
            View        = new RationallyView(Application.ActivePage);
            rebuildTree = false;

            Application.MarkerEvent                += Application_MarkerEvent;
            Application.TemplatePaths               = Constants.MyShapesFolder;
            Application.DocumentCreated            += DelegateCreateDocumentEvent;
            Application.DocumentOpened             += Application_DocumentOpenendEvent;
            Application.ShapeAdded                 += Application_ShapeAddedEvent;
            Application.QueryCancelSelectionDelete += Application_QueryCancelSelectionDelete;
            Application.BeforeShapeDelete          += Application_DeleteShapeEvent;
            Application.CellChanged                += Application_CellChangedEvent;
            Application.TextChanged                += Application_TextChangedEvent;
            Application.NoEventsPending            += NoEventsPendingEventHandler;

            Application.BeforePageDelete += Application_BeforePageDeleteEvent;
            Application.WindowActivated  += Application_WindowActivatedEvent;

            Application.MouseDown += Application_MouseDown;

            RegisterDeleteEventHandlers();
            RegisterQueryDeleteEventHandlers();
            RegisterMarkerEventHandlers();
            RegisterTextChangedEventHandlers();

            Log.Info($"MyShapesFolder is {Constants.MyShapesFolder}");
            Log.Info("Eventhandlers registered");


            showRationallyUpdatePopup = NewVersionAvailable = CheckRationallyVersion();
        }
 public void Execute(RationallyView view, Shape changedShape) => Globals.RationallyAddIn.Model.Version = changedShape.Text;
 public void Execute(RationallyView view, Shape forcesContainer) => Globals.RationallyAddIn.View.GetComponentByShape(forcesContainer).RemoveDeleteLock(true);