Ejemplo n.º 1
0
        private void WorkItemIDDoubleClick(WorkItemActionRequestWrapper request)
        {
            long startTicks = Log.EVENT_HANDLER("Enter", Common.PROJECT_NAME);

            ProcessDoubleClick(request);

            Log.EVENT_HANDLER("Exit", Common.PROJECT_NAME, startTicks);
        }
Ejemplo n.º 2
0
        private void InitializeViewModel()
        {
            long startTicks = Log.VIEWMODEL("Enter", Common.PROJECT_NAME);

            // TODO(crhodes)
            // Initialize any controls and/or properties that need to be

            WorkItemActionRequest = new WorkItemActionRequestWrapper(
                new WorkItemActionRequest());

            GetWorkItemInfoCommand = new DelegateCommand(OnGetWorkItemInfoExecute, OnGetWorkItemInfoCanExecute);
            AddPivotSummaryCommand = new DelegateCommand(OnAddPivotSummaryExecute, OnAddPivotSummaryCanExecute);

            WorkItemID_DoubleClickCommand = new DelegateCommand(OnWorkItemID_DoubleClick, OnWorkItemID_DoubleClickCanExecute);

            //InitializeRows();

            Log.VIEWMODEL("Exit", Common.PROJECT_NAME, startTicks);
        }
Ejemplo n.º 3
0
        private static void ProcessDoubleClick(WorkItemActionRequestWrapper request)
        {
            long startTicks = Log.EVENT_HANDLER("Enter", Common.PROJECT_NAME);

            string selectedCell = (string)Globals.ThisAddIn.Application.ActiveCell.Value.ToString();

            Range selectedRange = Globals.ThisAddIn.Application.Selection;

            selectedRange.SpecialCells(XlCellType.xlCellTypeVisible).Select();
            Range selectedVisibleRange = Globals.ThisAddIn.Application.Selection;

            StringBuilder selectedCellsText = new StringBuilder();

            // TODO(crhodes)
            // Is the outer if even needed if only one cell?

            if (selectedRange.Count > 1)
            {
                foreach (Range cell in selectedVisibleRange.Cells)
                {
                    if (selectedCellsText.Length > 0)
                    {
                        selectedCellsText.Append($", {cell.Value}");
                    }
                    else
                    {
                        selectedCellsText.Append($"{cell.Value}");
                    }
                }
            }
            else
            {
                selectedCellsText.Append($"{selectedRange.Value}");
            }

            request.WorkItemID = selectedCellsText.ToString();

            Log.EVENT_HANDLER("Exit", Common.PROJECT_NAME, startTicks);
        }