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();
        }
Beispiel #2
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();
 }
Beispiel #4
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 #5
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 #6
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();
 }
Beispiel #8
0
 private void OnSelectedTabPageChanged(Object sender, TabPageChangedEventArgs e)
 {
     LoadChildTabData();
     SlideContainer.RaiseOutputStatuesChanged();
     SlideContainer.RaiseSlideTypeChanged();
 }