private void SaveAction(Action <TableModel> saveAction)
 {
     tableState = this.tableState.saveCurrentTransaction(() =>
     {
         saveAction(this);
     });
 }
예제 #2
0
        public static void AddRow(ITableState tableState, int rowIndex, IEnumerable <string> values)
        {
            var  splitter           = tableState.SplitterState;
            var  rowBackgroundStyle = (rowIndex & 1) == 0 ? evenRowStyle : oddRowStyle;
            Rect rowRect            = GUILayoutUtility.GetRect(GUIClip.visibleRect.width, 16f);

            rowRect.x += 2;
            if (Event.current.type == EventType.Repaint)
            {
                rowBackgroundStyle.Draw(rowRect, GUIContent.none, false, false, false, false);
                int columnIndex = 0;
                foreach (var value in values)
                {
                    if (columnIndex != 0)
                    {
                        valueStyle.alignment = TextAnchor.MiddleRight;
                    }
                    rowRect.width = (float)splitter.realSizes[columnIndex] - 4f;
                    valueStyle.Draw(rowRect, value, false, false, false, false);
                    rowRect.x           += (float)splitter.realSizes[columnIndex];
                    valueStyle.alignment = TextAnchor.MiddleLeft;
                    ++columnIndex;
                }
            }
        }
예제 #3
0
 public void ToVacant(Action <Table> saveDetails)
 {
     state = this.state.PayOut(() => {
         saveDetails(this);
         transactionEnded();
     });
 }
예제 #4
0
 public void TimeOut()
 {
     state = this.state.TimeOut(() => {
         this.timeEnded(DateTime.Now);
         this.transaction.timeOut(this);
     });
 }
        public Transaction GetTransaction()
        {
            Transaction ret = new Transaction();

            tableState = this.tableState.GetTransaction(() => {
                ret = currentTransaction;
            });
            return(ret);
        }
예제 #6
0
        public int GetTransactionTypeCode()
        {
            int ret = 0;

            state = this.state.GetTransactionType(() => {
                ret = transaction.TransactionType();
            });
            return(ret);
        }
예제 #7
0
        public void TimeIn(ITableTransaction transType, Action <Table> saveCurrentTransaction, DateTime timeStarted)
        {
            state = this.state.TimeIn(() => {
                transaction      = transType;
                this.timeStarted = timeStarted;
                Console.WriteLine(state.StateType());
            });

            state = this.state.saveCurrentTransaction(() =>
            {
                saveCurrentTransaction(this);
            });
        }
예제 #8
0
 public static void BeginTable(ITableState tableState, GUIStyle style, params GUILayoutOption[] options)
 {
     GUILayout.BeginHorizontal();
     SplitterGUILayout.BeginHorizontalSplit(tableState.SplitterState);
     foreach (var header in tableState.Headers)
     {
         GUILayout.Toggle(false, header, headerStyle);
     }
     SplitterGUILayout.EndHorizontalSplit();
     GUILayout.EndHorizontal();
     GUILayout.Space(1f);
     tableState.ScrollPosition = EditorGUILayout.BeginScrollView(tableState.ScrollPosition, style, options);
 }
예제 #9
0
        public Expression <Func <Item, bool> > GetFilter(ITableState <Item> state)
        {
            if ((Searchable || SearchExpression != null) && Property != null && !string.IsNullOrEmpty(state.SearchText))
            {
                var filter = FilterService.GetFilter(this, state.SearchText);
                if (filter == null)
                {
                    return(null);
                }

                return(PredicateBuilder
                       .New <Item>()
                       .And(NotNull())
                       .And(filter));
            }

            return(null);
        }
예제 #10
0
 public DbTableBuilder(ITableTransaction transType, ITableState tableState, Transaction currentTransaction)
 {
     this.TransactionType = transType;
     this.TableState      = tableState;
     this.Transaction     = currentTransaction;
 }
예제 #11
0
 public TheGridDataFactory(List <IColumn <Item> > columns, ITableState <Item> state)
 {
     this.columns = columns;
     this.state   = state;
 }
예제 #12
0
 public void SetTableState(ITableState newState)
 {
     _tableModel.SetState(newState);
 }
 public TableModel(ITableState state, ITableTransaction rentTrans, Transaction trans)
 {
     tableState         = state;
     currentTransaction = trans;
     rentTransaction    = rentTrans;
 }
 public void SetState(ITableState newState)
 {
     tableState = newState;
 }
예제 #15
0
 public Table(ITableState dbState)
 {
     this.state = dbState;
 }