コード例 #1
0
        private void listActions_ItemDropped(object sender, EventArgs e)
        {
            object droppedItem = ((DragInfo)sender).Data as object;

            if (droppedItem != null)
            {
                int mouseIndex     = -1;
                int lastAddedIndex = -1;
                Act actDroppedOn   = DragDrop2.GetRepositoryItemHit(ListView) as Act;

                if (actDroppedOn != null)
                {
                    mouseIndex = ListView.DataSourceList.IndexOf(actDroppedOn);
                }

                lastAddedIndex = ActionsFactory.AddActionsHandler(droppedItem, mContext, mouseIndex);

                if (lastAddedIndex > mouseIndex)
                {
                    ListView.xListView.SelectedItems.Clear();
                    for (int itemIndex = mouseIndex; itemIndex < lastAddedIndex; itemIndex++)
                    {
                        RepositoryItemBase repoBaseItem = ListView.DataSourceList[itemIndex] as RepositoryItemBase;
                        if (repoBaseItem != null)
                        {
                            ListView.xListView.SelectedItems.Add(repoBaseItem);
                        }
                    }
                }
            }
        }
コード例 #2
0
        public void AddActionClicked(object sender, RoutedEventArgs e)
        {
            Act selectedAct;

            if (IsLegacyPlatform)
            {
                if (AvailableActions.CurrentItem == null)
                {
                    Reporter.ToUser(eUserMsgKey.AskToSelectAction);
                    return;
                }

                selectedAct = AvailableActions.CurrentItem as Act;
                SetActionDetails(selectedAct);
            }
            else
            {
                if (DefaultAction == null)
                {
                    Reporter.ToUser(eUserMsgKey.AskToSelectAction);
                    return;
                }

                DefaultAction.Description = string.Format("{0} : {1} - {2}", (DefaultAction as ActUIElement).ElementAction, mElementInfo.ElementTypeEnum.ToString(), mElementInfo.ElementName);
                selectedAct = DefaultAction;
            }

            ActionsFactory.AddActionsHandler(selectedAct, mContext);
        }
コード例 #3
0
 private void AddAction()
 {
     if (ActionsTabs.SelectedContent != null && ((ucGrid)ActionsTabs.SelectedContent).CurrentItem != null)
     {
         Act selectedAction = ((ucGrid)ActionsTabs.SelectedContent).CurrentItem as Act;
         ActionsFactory.AddActionsHandler(selectedAction, mContext);
     }
 }
コード例 #4
0
        private void AddActionListView(object sender, RoutedEventArgs e)
        {
            List <RepositoryItemBase> list = new List <RepositoryItemBase>();
            List <object>             SelectedItemsList = mListView.List.SelectedItems.Cast <object>().ToList();

            foreach (Act act in SelectedItemsList)
            {
                list.Add(act);
                ActionsFactory.AddActionsHandler(act, mContext);
            }
        }
コード例 #5
0
        private void AddActionButton_Click(object sender, RoutedEventArgs e)
        {
            if (mActions.CurrentItem == null)
            {
                Reporter.ToUser(eUserMsgKey.AskToSelectAction);
                return;
            }

            Act selectedAct = mActions.CurrentItem as Act;

            SetActionDetails(selectedAct);
            ActionsFactory.AddActionsHandler(selectedAct, mContext);
        }
コード例 #6
0
 private void AddFromPOMNavPage(object sender, RoutedEventArgs e)
 {
     if (xMainElementsGrid.Grid.SelectedItems != null && xMainElementsGrid.Grid.SelectedItems.Count > 0)
     {
         foreach (ElementInfo elemInfo in xMainElementsGrid.Grid.SelectedItems)
         {
             ActionsFactory.AddActionsHandler(elemInfo, mContext);
         }
     }
     else
     {
         Reporter.ToUser(eUserMsgKey.NoItemWasSelected);
     }
 }
コード例 #7
0
 private void AddFromPOMNavPage(object sender, RoutedEventArgs e)
 {
     if (mListView.List.SelectedItems != null && mListView.List.SelectedItems.Count > 0)
     {
         foreach (ElementInfo selectedItem in mListView.List.SelectedItems)
         {
             ActionsFactory.AddActionsHandler(selectedItem, mContext);
         }
     }
     else
     {
         Reporter.ToUser(eUserMsgKey.NoItemWasSelected);
     }
 }
コード例 #8
0
 private void AddMultipleActions(object sender, RoutedEventArgs e)
 {
     if (ActionsTabs.SelectedContent != null)
     {
         ucGrid actionsGrid = ((ucGrid)ActionsTabs.SelectedContent);
         if (actionsGrid.Grid.SelectedItems != null && actionsGrid.Grid.SelectedItems.Count > 0)
         {
             foreach (Act selectedAct in actionsGrid.Grid.SelectedItems)
             {
                 ActionsFactory.AddActionsHandler(selectedAct, mContext);
             }
         }
         else
         {
             Reporter.ToUser(eUserMsgKey.NoItemWasSelected);
         }
     }
 }
コード例 #9
0
        private void DroppedItemHandler(object droppedItem, int mouseIndex)
        {
            int lastAddedIndex = -1;

            lastAddedIndex = ActionsFactory.AddActionsHandler(droppedItem, mContext, mouseIndex);

            if (lastAddedIndex > mouseIndex)
            {
                ListView.xListView.SelectedItems.Clear();
                for (int itemIndex = mouseIndex; itemIndex < lastAddedIndex; itemIndex++)
                {
                    RepositoryItemBase repoBaseItem = ListView.DataSourceList[itemIndex] as RepositoryItemBase;
                    if (repoBaseItem != null)
                    {
                        ListView.xListView.SelectedItems.Add(repoBaseItem);
                    }
                }
            }
        }
コード例 #10
0
 private void AddFromRepository(object sender, RoutedEventArgs e)
 {
     if (mListView.List.SelectedItems != null && mListView.List.SelectedItems.Count > 0)
     {
         if (mContext.BusinessFlow == null)
         {
             return;
         }
         List <Act> list = new List <Act>();
         foreach (Act selectedItem in mListView.List.SelectedItems)
         {
             ActionsFactory.AddActionsHandler(selectedItem, mContext);
         }
     }
     else
     {
         Reporter.ToUser(eUserMsgKey.NoItemWasSelected);
     }
 }
コード例 #11
0
        private void AddFromRepository(object sender, RoutedEventArgs e)
        {
            if (mContext.BusinessFlow == null)
            {
                return;
            }

            if (xActionsGrid.Grid.SelectedItems != null && xActionsGrid.Grid.SelectedItems.Count > 0)
            {
                foreach (Act selectedItem in xActionsGrid.Grid.SelectedItems)
                {
                    ActionsFactory.AddActionsHandler(selectedItem, mContext);
                    //mContext.BusinessFlow.AddAct((Act)selectedItem.CreateInstance(true));
                }
            }
            else
            {
                Reporter.ToUser(eUserMsgKey.NoItemWasSelected);
            }
        }