Exemplo n.º 1
0
        private void grdActivitiesRepository_ItemDropped(object sender, EventArgs e)
        {
            Activity dragedItem = (Activity)((DragInfo)sender).Data;

            if (dragedItem != null)
            {
                ////check if the Activity is part of a group which not exist in ActivitiesGroups repository
                SharedRepositoryOperations.AddItemToRepository(dragedItem);

                //refresh and select the item
                try
                {
                    Activity dragedItemInGrid = ((IEnumerable <Activity>)xActivitiesRepositoryGrid.DataSourceList).Where(x => x.Guid == dragedItem.Guid).FirstOrDefault();
                    if (dragedItemInGrid != null)
                    {
                        xActivitiesRepositoryGrid.Grid.SelectedItem = dragedItemInGrid;
                    }
                }
                catch (Exception ex) { Reporter.ToLog(eAppReporterLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {ex.Message}", ex); }
            }
        }
Exemplo n.º 2
0
        private void grdActivitiesGroupsRepository_ItemDropped(object sender, EventArgs e)
        {
            ActivitiesGroup dragedItem = (ActivitiesGroup)((DragInfo)sender).Data;

            if (dragedItem != null)
            {
                //add the Group to repository
                // App.LocalRepository.AddItemToRepositoryWithPreChecks(dragedItem, mBusinessFlow);
                SharedRepositoryOperations.AddItemToRepository(dragedItem);
                //refresh and select the item
                try
                {
                    ActivitiesGroup dragedItemInGrid = ((IEnumerable <ActivitiesGroup>)grdActivitiesGroupsRepository.DataSourceList).Where(x => x.Guid == dragedItem.Guid).FirstOrDefault();
                    if (dragedItemInGrid != null)
                    {
                        grdActivitiesGroupsRepository.Grid.SelectedItem = dragedItemInGrid;
                    }
                }
                catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {ex.Message}"); }
            }
        }
Exemplo n.º 3
0
        private void grdActions_ItemDropped(object sender, EventArgs e)
        {
            Act dragedItem = (Act)((DragInfo)sender).Data;

            if (dragedItem != null)
            {
                // App.LocalRepository.AddItemToRepositoryWithPreChecks(dragedItem, null);
                SharedRepositoryOperations.AddItemToRepository(dragedItem);
                //refresh and select the item
                try
                {
                    xActionsGrid.DataSourceList = WorkSpace.Instance.SolutionRepository.GetAllRepositoryItems <Act>();

                    Act dragedItemInGrid = ((IEnumerable <Act>)xActionsGrid.DataSourceList).Where(x => x.Guid == dragedItem.Guid).FirstOrDefault();
                    if (dragedItemInGrid != null)
                    {
                        xActionsGrid.Grid.SelectedItem = dragedItemInGrid;
                    }
                }
                catch (Exception ex) { Reporter.ToLog(eLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {ex.Message}"); }
            }
        }
Exemplo n.º 4
0
        private void grdVariables_ItemDropped(object sender, EventArgs e)
        {
            VariableBase dragedItem = (VariableBase)((DragInfo)sender).Data;

            if (dragedItem != null)
            {
                //App.LocalRepository.AddItemToRepositoryWithPreChecks(dragedItem, null);

                SharedRepositoryOperations.AddItemToRepository(dragedItem);

                //refresh and select the item
                try
                {
                    VariableBase dragedItemInGrid = ((IEnumerable <VariableBase>)xVariablesGrid.DataSourceList).Where(x => x.Guid == dragedItem.Guid).FirstOrDefault();
                    if (dragedItemInGrid != null)
                    {
                        xVariablesGrid.Grid.SelectedItem = dragedItemInGrid;
                    }
                }
                catch (Exception ex) { Reporter.ToLog(eAppReporterLogLevel.ERROR, $"Method - {MethodBase.GetCurrentMethod().Name}, Error - {ex.Message}", ex); }
            }
        }