Ejemplo n.º 1
0
        public void LoadSavedState(SimpleSummaryItemState itemState)
        {
            ckItem.Checked    = itemState.ShowValue;
            ckDetails.Checked = itemState.ShowDescription;
            ckMonthly.Checked = itemState.ShowMonthly;
            ckTotal.Checked   = itemState.ShowTotal;

            textEditItem.EditValue    = !string.IsNullOrEmpty(itemState.Value) ? itemState.Value : null;
            memoEditDetails.EditValue = !string.IsNullOrEmpty(itemState.Description) ? itemState.Description : null;
            spinEditMonthly.EditValue = itemState.ShowMonthly ? itemState.Monthly : null;
            spinEditTotal.EditValue   = itemState.ShowTotal ? itemState.Total : null;
        }
 public void SaveItems()
 {
     ViewSettingsManager.Instance.SimpleSummaryState.ItemsState.Clear();
     foreach (var item in _itemsCollection)
     {
         var itemState = new SimpleSummaryItemState();
         itemState.Order           = item.ItemNumber;
         itemState.ShowValue       = item.ShowValue;
         itemState.ShowDescription = item.ShowDescription;
         itemState.ShowMonthly     = item.ShowMonthly;
         itemState.ShowTotal       = item.ShowTotal;
         itemState.Value           = item.ItemTitle;
         itemState.Description     = item.ItemDetail;
         itemState.Monthly         = item.MonthlyValue;
         itemState.Total           = item.TotalValue;
         ViewSettingsManager.Instance.SimpleSummaryState.ItemsState.Add(itemState);
     }
     ViewSettingsManager.Instance.SimpleSummaryState.ItemsState.Sort((x, y) => x.Order.CompareTo(y.Order));
 }
 public IEnumerable <SimpleSummaryItemState> GetItems()
 {
     _itemStates.Clear();
     foreach (var item in _itemsCollection)
     {
         var itemState = new SimpleSummaryItemState();
         itemState.Order           = item.ItemNumber;
         itemState.ShowValue       = item.ShowValue;
         itemState.ShowDescription = item.ShowDescription;
         itemState.ShowMonthly     = item.ShowMonthly;
         itemState.ShowTotal       = item.ShowTotal;
         itemState.Value           = item.ItemTitle;
         itemState.Description     = item.ItemDetail;
         itemState.Monthly         = item.MonthlyValue;
         itemState.Total           = item.TotalValue;
         _itemStates.Add(itemState);
     }
     _itemStates.Sort((x, y) => x.Order.CompareTo(y.Order));
     return(_itemStates);
 }