Esempio n. 1
0
        private void InsertXY(List <GPoint> XY, string col1Name, string col2Name)
        {
            InsertNewColumn();
            var col1 = this.CurrentSelectionRange.Col;
            var col2 = this.CurrentSelectionRange.EndCol;

            CurrentWorksheet[0, col1] = col1Name;
            CurrentWorksheet[0, col2] = col2Name;
            for (int row = 0; row < XY.Count; row++)
            {
                CurrentWorksheet[row + 1, col1] = XY[row].X;
                CurrentWorksheet[row + 1, col2] = XY[row].Y;
                if (XY[row].IsNoise)
                {
                    CurrentWorksheet.SetRangeStyles(row + 1, col2, 1, 1, new WorksheetRangeStyle
                    {
                        Flag      = PlainStyleFlag.BackColor,
                        BackColor = unvell.ReoGrid.Graphics.SolidColor.Red
                    });
                }
            }

            CurrentWorksheet.AutoFitColumnWidth(col1);
            CurrentWorksheet.AutoFitColumnWidth(col2);
        }
        public bool ProcessMessage(IntPtr hwnd, UInt32 message, UInt32 wParam, UInt32 lParam, UInt32 time, Int32 xPos, Int32 yPos)
        {
            const int WM_KEYDOWN    = 0x0100;
            const int WM_SYSKEYDOWN = 0x0104;

            switch (message)
            {
            case WM_KEYDOWN:
            case WM_SYSKEYDOWN:
                if (CurrentWorksheet.IsEditing && (wParam == (UInt32)Keys.Escape))
                {
                    CurrentWorksheet.EndEdit(EndEditReason.Cancel);
                    return(true);
                }
                else if (!CurrentWorksheet.IsEditing && (wParam == (UInt32)Keys.F2))
                {
                    CurrentWorksheet.StartEdit();
                    return(true);
                }
                // else
                return(CommandHandling.ProcessMenuShortcut(wParam, MenuBar.Items));
            }

            return(false);
        }
 public void WriteCell(int row, int column, bool i)
 {
     if (row >= 0 && column >= 0)
     {
         CurrentWorksheet.Cells[row, column].PutValue(i);
         CurrentWorksheet.AutoFitColumn(column);
     }
     else
     {
         throw new IndexOutOfRangeException();
     }
 }
Esempio n. 4
0
        public void Process()
        {
            lock (CurrentWorksheet)
            {
                if (CurrentWorksheet == null)
                {
                    Console.WriteLine("**************** acivity:" + WorkFlowName + " process doing nothing !!!***************");
                    return;
                }
                if (CurrentActivityStatus == ACTIVITY_STATUS.Finished || CurrentActivityStatus == ACTIVITY_STATUS.Cancel)
                {
                    Console.WriteLine(">>>>> acivity:" + WorkFlowName + " status is cancel or finished, no process");
                    return;
                }
                if (CurrentWorksheet.CurrentStatus == NODE_ACTION_STATUS.Assigned)
                {
                    SetStatus(ACTIVITY_STATUS.Started);
                }
                if (CurrentActivityStatus == ACTIVITY_STATUS.Started)
                {
                    Console.WriteLine(">>>>> acivity:" + WorkFlowName + " started, process...");
                    if (CanTransiteNextNode())
                    {
                        CurrentNode = NextNode;
                        Console.WriteLine(">>>>> acivity:" + WorkFlowName + " transite to next node: " + CurrentNode.ToString());
                        NextNode = CODE_CHECK_NODE.NONE;
                        Console.WriteLine(">>>>> acivity:" + WorkFlowName + " --WORKSHEET changed !!! ");
                        CurrentWorksheet.CurrentNode   = CurrentNode;
                        CurrentWorksheet.CurrentStatus = NODE_ACTION_STATUS.Assigned;
                    }

                    switch (CurrentWorksheet.CurrentStatus)
                    {
                    case NODE_ACTION_STATUS.Reject:
                    case NODE_ACTION_STATUS.Deny:
                    case NODE_ACTION_STATUS.Cancelled:
                        if (SetWorksheetStatus(NODE_ACTION_STATUS.Cancelled))
                        {
                            SetStatus(ACTIVITY_STATUS.Cancel);
                            worksheetsHistory.Add((Node)CurrentWorksheet.Clone());
                            CurrentWorksheet = null;
                        }
                        break;
                    }
                }
            }
        }