Beispiel #1
0
            public void MarkStart(Excel.MarkType type = MarkType.None)
            {
                if (Common.DisplayXlLocationUpdates)
                {
                    StackFrame frame  = new StackFrame(1);
                    MethodBase caller = frame.GetMethod();

                    Excel.DisplayInWatchWindow(this, caller.Name);
                }

                // TODO(crhodes)
                // Previous code called ClearOffsets then DisplayInWatchWindow
                // Decide how to handle.  See above


                // Seems like we always want to do this.
                //
                ClearOffsets(clearOffsetMax: true);

                //Excel.DisplayInWatchWindow(this, caller.Name);

                switch (type)
                {
                case Excel.MarkType.None:
                    MarkStartRow    = nextRange.Row;
                    MarkStartColumn = nextRange.Column;

                    break;

                case Excel.MarkType.Group:
                    GroupStartRow    = nextRange.Row;
                    GroupStartColumn = nextRange.Column;

                    break;

                case Excel.MarkType.Table:
                    TableStartRow    = nextRange.Row;
                    TableStartColumn = nextRange.Column;

                    break;

                case Excel.MarkType.GroupTable:
                    GroupStartRow    = nextRange.Row;
                    GroupStartColumn = nextRange.Column;
                    TableStartRow    = nextRange.Row;
                    TableStartColumn = nextRange.Column;

                    break;
                }

                Excel.DisplayInWatchWindow(this, "End");
            }
Beispiel #2
0
            public void MarkEnd(Excel.MarkType type = MarkType.None, string tableName = null)
            {
                if (Common.DisplayXlLocationUpdates)
                {
                    StackFrame frame  = new StackFrame(1);
                    MethodBase caller = frame.GetMethod();

                    Excel.DisplayInWatchWindow(this, caller.Name);
                }

                switch (type)
                {
                case Excel.MarkType.None:
                    MarkEndRow    = nextRange.Row + RowsAdded;
                    MarkEndColumn = nextRange.Column + ColumnsAdded;

                    break;

                case Excel.MarkType.Group:
                    GroupEndRow    = nextRange.Row + RowOffset - 1;
                    GroupEndColumn = nextRange.Column + ColumnOffsetMax;

                    if (ColumnOffsetMax != 0)
                    {
                        // We have used ColumnOffsetMax and it was
                        // incremented past end
                        GroupEndColumn--;
                    }

                    break;

                case Excel.MarkType.Table:
                    TableEndRow = nextRange.Row + RowOffset - 1;
                    //TableEndColumn = currentRange.Column + ColumnOffset - 1;
                    TableEndColumn = nextRange.Column + ColumnOffsetMax - 1;

                    CreateTable(tableName);
                    //if (tableName != null)
                    //{
                    //    CreateTable(tableName);
                    //}

                    break;

                case Excel.MarkType.GroupTable:
                    GroupEndRow    = nextRange.Row + RowOffset - 1;
                    GroupEndColumn = nextRange.Column + ColumnOffsetMax;

                    if (ColumnOffsetMax != 0)
                    {
                        // We have used ColumnOffsetMax and it was
                        // incremented past end
                        GroupEndColumn--;
                    }

                    TableEndRow = nextRange.Row + RowOffset - 1;
                    //TableEndColumn = currentRange.Column + ColumnOffset - 1;
                    TableEndColumn = nextRange.Column + ColumnOffsetMax - 1;

                    CreateTable(tableName);
                    //if (tableName != null)
                    //{
                    //    CreateTable(tableName);
                    //}

                    break;
                }

                Excel.DisplayInWatchWindow(this, "End");
            }