Ejemplo n.º 1
0
 public AddForm(string viewName, ViewControl control)
 {
     InitializeComponent();
     addControl = new AddControl(viewName, control);
     this.Controls.Add(addControl);
     this.Size = addControl.Size;
 }
Ejemplo n.º 2
0
 protected virtual void OnAddControl(ScaleValuesData model)
 {
     if (AddControl != null)
     {
         AddControl.Invoke(model);
     }
 }
        private void AddProducts(object sender, RoutedEventArgs e)
        {
            AddControl add     = new AddControl();
            StackPanel element = new StackPanel();

            element.Orientation = Orientation.Horizontal;

            element.Children.Add(new TextBlock()
            {
                Text = "Добавление товара "
            });


            Button btn = new Button();

            btn.Click          += deleteBtnClk;
            btn.Content         = "✕";
            btn.Background      = Brushes.Transparent;
            btn.BorderThickness = new Thickness(0);


            element.Children.Add(btn);
            TabItem item = new TabItem()
            {
                Content = add,
                Header  = element
            };

            ControlView.Items.Add(item);
            ControlView.SelectedItem = item;
        }
Ejemplo n.º 4
0
 public FormMain()
 {
     controlChange = new ChangeControlShow(changeControlShow);
     addControl = new AddControl(addControlAction);
     setWbDT = new SetWebBowserDocText(setWbDocumentText);
     this.login = Login.get();
     InitializeComponent();
     score = new Score();
     elective = new Elective();
 }
Ejemplo n.º 5
0
 public FormMain()
 {
     controlChange = new ChangeControlShow(changeControlShow);
     addControl    = new AddControl(addControlAction);
     setWbDT       = new SetWebBowserDocText(setWbDocumentText);
     this.login    = Login.get();
     InitializeComponent();
     score    = new Score();
     elective = new Elective();
 }
Ejemplo n.º 6
0
        public void Init(Desire d)
        {
            switch (d)
            {
            case Desire.Add:
                Content = new AddControl();
                break;

            case Desire.Info:
                Content = new InfoControl();
                break;
            }
        }
Ejemplo n.º 7
0
        public async void UpdateResourceList()
        {
            ResourceModel resModel = await GetResource();

            resourceList.SuspendLayout();
            if (resourceList.InvokeRequired)
            {
                if (Disposing || IsDisposed)
                {
                    return;
                }
                ClearControl @delegate = new ClearControl(resourceList.Controls.Clear);
                Invoke(@delegate);
            }
            else


            {
                resourceList.Controls.Clear();
            }


            int index = 1;

            foreach (ResourceData resData in resModel.ResourceList)
            {
                if (index <= resModel.ResourceList.Count && index <= PrePageCount)
                {
                    PicturePlane pictureBox = new PicturePlane();
                    pictureBox.Dock = DockStyle.Fill;
                    pictureBox.SetImage(resModel.ResourceList[index - 1].IconUrl);
                    pictureBox.Picture.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(PictureBoxCtrl_DoubleClick);
                    pictureBox.Tag         = resModel.ResourceList[index - 1];
                    pictureBox.Picture.Tag = resModel.ResourceList[index - 1];


                    if (App.ResourceType == ResourceType.Icon || App.ResourceType == ResourceType.Upload_icon)
                    {
                        pictureBox.SetMarkVisible(false);
                        pictureBox.SetMenuVisible(true);
                        pictureBox.Padding       = new Padding(5);
                        pictureBox.ApplyFunction = new PicturePlane.DelegateApply(ApplyIcon);
                    }
                    else if (App.ResourceType == ResourceType.Upload_template || App.ResourceType == ResourceType.Upload_legend)
                    {
                        pictureBox.SetMenuVisible(true);
                        pictureBox.SetMarkVisible(false);
                        pictureBox.ApplyFunction = new PicturePlane.DelegateApply(ApplyTemplate);
                    }
                    else
                    {
                        pictureBox.SetMenuVisible(true);
                        if (resData.MarkFlag == "1" || App.ItemType == ResourceType.Wdsc)
                        {
                            pictureBox.SetMarkStatus(true);
                        }

                        pictureBox.ApplyFunction = new PicturePlane.DelegateApply(ApplyTemplate);
                    }
                    pictureBox.MarkFunction   = new  PicturePlane.DelegateApply(store);
                    pictureBox.UnMarkFunction = new PicturePlane.DelegateApply(unMark);
                    if (resourceList.InvokeRequired)
                    {
                        if (Disposing || IsDisposed)
                        {
                            return;
                        }
                        AddControl @delegate = new AddControl(resourceList.Controls.Add);
                        Invoke(@delegate, pictureBox);
                    }
                    else
                    {
                        resourceList.Controls.Add(pictureBox);
                    }
                }
                index++;
            }
            resourceList.ResumeLayout();
        }
Ejemplo n.º 8
0
 public virtual IEnumerator <ITask> AddControlHandler(AddControl header)
 {
     AddScriptCommand(header.Body, header.ResponsePort);
     yield break;
 }