private void OnItemStateChanged(Object sender, ItemChangedEventArgs e)
        {
            if (!_allowToSave)
            {
                return;
            }

            var itemInfo = e.ItemInfo;

            if (e.Checked)
            {
                var itemControl = new ItemControl(itemInfo, this);
                xtraTabControl.TabPages.Add(itemControl);
                itemControl.LoadData();
            }
            else
            {
                var itemControl = xtraTabControl.TabPages
                                  .OfType <ItemControl>()
                                  .FirstOrDefault(control =>
                                                  String.Equals(control.ItemInfo.Id, itemInfo.Id, StringComparison.OrdinalIgnoreCase));
                if (itemControl != null)
                {
                    SlideContainer.EditedContent.ApproachState.TabA.Items.RemoveAll(item =>
                                                                                    String.Equals(item.Id, itemControl.ItemInfo.Id, StringComparison.OrdinalIgnoreCase));
                    xtraTabControl.TabPages.Remove(itemControl);
                }
            }

            SlideContainer.RaiseSlideTypeChanged();
            RaiseEditValueChanged();
        }
 private void OnEditValueChanged(object sender, EventArgs e)
 {
     if (AllowToSave)
     {
         SlideContainer.RaiseDataChanged();
     }
 }
Beispiel #3
0
 private void OnSelectedTabPageChanged(object sender, TabPageChangedEventArgs e)
 {
     if (!_allowToSave)
     {
         return;
     }
     SlideContainer.RaiseSlideTypeChanged();
 }
 private void OnEditValueChanged(object sender, EventArgs e)
 {
     RaiseEditValueChanged();
     if (!_allowHandleEvents)
     {
         return;
     }
     SlideContainer.RaiseSlideTypeChanged();
 }
 private void OnInvestmentEditValueChanged(object sender, EventArgs e)
 {
     if (!AllowToSave)
     {
         return;
     }
     SlideContainer.EditedContent.SimpleSummaryState.MonthlyValue = simpleSummaryItemContainer.TotalMonthlyValue == (decimal?)spinEditMonthly.EditValue ? null : (decimal?)spinEditMonthly.EditValue;
     SlideContainer.EditedContent.SimpleSummaryState.TotalValue   = simpleSummaryItemContainer.TotalTotalValue == (decimal?)spinEditTotal.EditValue ? null : (decimal?)spinEditTotal.EditValue;
     SlideContainer.RaiseDataChanged();
 }
 public void RaiseEditValueChanged()
 {
     if (!_allowToHandleEvents)
     {
         return;
     }
     _dataChanged = true;
     Container.RaiseEditValueChanged();
     SlideContainer.RaiseOutputStatuesChanged();
 }
 private void OnOutputToggled(object sender, EventArgs e)
 {
     layoutControlItemHeader.Enabled     =
         layoutControlItemCombo1.Enabled = layoutControlGroupToggles.Enabled = toggleSwitchOutput.IsOn;
     UpdateTabPageHeaderState(toggleSwitchOutput.IsOn);
     if (!_allowToHandleEvents)
     {
         return;
     }
     OnEditValueChanged(sender, e);
     SlideContainer.RaiseOutputStatuesChanged();
 }
 private void OnOutputClick(object sender, EventArgs e)
 {
     if (_currentSlide == null)
     {
         return;
     }
     SaveSlideObject();
     SlideContainer.OnCustomSlideOutput(sender, new SlideMasterEventArgs
     {
         SlideMaster = _currentSlide
     });
 }
Beispiel #9
0
        private void OnMenuItemCloneClick(object sender, EventArgs e)
        {
            if (!(_menuHitInfo.Page is ProductItemControl productControl))
            {
                return;
            }

            var itemControl = new ProductItemControl(productControl.ItemInfo,
                                                     productControl.ItemState.Clone(),
                                                     this);

            xtraTabControl.TabPages.Insert(xtraTabControl.TabPages.IndexOf(_menuHitInfo.Page), itemControl);
            itemControl.InitControl();

            Contents.UpdateSlideCount(xtraTabControl.TabPages.OfType <ProductItemControl>().Count());

            SlideContainer.RaiseSlideTypeChanged();
            RaiseEditValueChanged();
        }
Beispiel #10
0
        private void OnTabClose(object sender, EventArgs e)
        {
            var arg = (ClosePageButtonEventArgs)e;

            if (!(arg.Page is ProductItemControl itemControl))
            {
                return;
            }

            if (PopupMessageHelper.Instance.ShowWarningQuestion(String.Format("Delete {0}?", itemControl.ItemInfo.Title)) != DialogResult.Yes)
            {
                return;
            }

            xtraTabControl.TabPages.Remove(itemControl);

            Contents.UpdateSlideCount(xtraTabControl.TabPages.OfType <ProductItemControl>().Count());

            SlideContainer.RaiseSlideTypeChanged();
            RaiseEditValueChanged();
        }
Beispiel #11
0
        private void OnProductItemClicked(Object sender, ProductClickedEventArgs e)
        {
            if (!_allowToSave)
            {
                return;
            }

            var itemInfo = e.ItemInfo;

            var itemControl = new ProductItemControl(itemInfo,
                                                     new IntegratedSolutionState.ProductItemState(itemInfo.ProductId),
                                                     this);

            xtraTabControl.TabPages.Add(itemControl);
            itemControl.InitControl();

            Contents.UpdateSlideCount(xtraTabControl.TabPages.OfType <ProductItemControl>().Count());

            SlideContainer.RaiseSlideTypeChanged();
            RaiseEditValueChanged();
        }
 private void OnEditValueChanged(object sender, EventArgs e)
 {
     RaiseEditValueChanged();
     SlideContainer.RaiseSlideTypeChanged();
 }
 private void OnAddItemClick(object sender, EventArgs e)
 {
     simpleSummaryItemContainer.AddItem();
     UpdateTotalItems();
     SlideContainer.RaiseDataChanged();
 }
 private void OnItemCollectionChanged(object sender, EventArgs e)
 {
     SlideContainer.RaiseDataChanged();
     UpdateTotalItems();
     UpdateTotalValues();
 }
Beispiel #15
0
 private void OnSelectedTabPageChanged(Object sender, TabPageChangedEventArgs e)
 {
     LoadChildTabData();
     SlideContainer.RaiseOutputStatuesChanged();
     SlideContainer.RaiseSlideTypeChanged();
 }
Beispiel #16
0
 public void RaiseDataChanged()
 {
     _dataChanged = true;
     SlideContainer.RaiseDataChanged();
 }