Exemplo n.º 1
0
        private void GoPage(int index)
        {
            Container.Clear();

            int startLocationY = 0;

            int start = (index - 1) * UctPage.PrePageCount;
            int end   = Math.Min(dt.Rows.Count, index * UctPage.PrePageCount);

            UctWordEn card = null;

            for (int i = start; i < end; i++)
            {
                card            = new UctWordEn(dt.Rows[i]);
                card.Location   = new Point(0, startLocationY);
                card.Anchor     = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
                startLocationY += card.Height;
                Container.Add(card);
            }
            //PALWords.Select();
            if (Para.AUTO_PLAY && UctPage.PrePageCount == 1 && card != null)
            {
                card.PlayAutio();
            }
        }
Exemplo n.º 2
0
 public void ShowText(string text)
 {
     if (_controls[0] != _defaultControl)
     {
         _controls.Clear();
         _controls.Add(_defaultControl);
     }
     _defaultControl.Text = text;
 }
Exemplo n.º 3
0
 private void samplesTree_AfterSelect(object sender, TreeViewEventArgs e)
 {
     hsButton.Visible = false;
     Control.ControlCollection controls = hostPanel.Controls;
     if (controls.Count == 1)
     {
         BaseGaugePage oldPage = (BaseGaugePage)controls[0];
         controls.Clear();
         oldPage.Dispose();
     }
     if (e.Node.Tag != null)
     {
         string          className = (string)e.Node.Tag;
         Assembly        asm       = Assembly.GetExecutingAssembly();
         Type            classType = asm.GetType("GaugeDemo." + className);
         ConstructorInfo ci        = classType.GetConstructor(new Type[0]);
         BaseGaugePage   page      = (BaseGaugePage)ci.Invoke(null);
         if (!(page is BasePageNoGrid))
         {
             hsButton.Visible = true;
             if (_gridHidden)
             {
                 page.gridPanel.Visible = false;
                 page.splitter1.Visible = false;
             }
         }
         page.captionLabel.Text = e.Node.Text;
         page.Dock = DockStyle.Fill;
         controls.Add(page);
     }
 }
        public object PerformSet(object?toTarget, object?newValue, object[]?arguments)
        {
            if (toTarget == null)
            {
                throw new ArgumentNullException(nameof(toTarget));
            }

            IEnumerable <Control>?newValueEnumerable = newValue as IEnumerable <Control>;

            if (newValueEnumerable == null)
            {
                throw new ArgumentException($"newValue must be {nameof(newValue)}", nameof(newValue));
            }

            Control.ControlCollection targetCollection = (Control.ControlCollection)toTarget;

            targetCollection.Owner.SuspendLayout();

            targetCollection.Clear();
            targetCollection.AddRange(newValueEnumerable.ToArray());

            targetCollection.Owner.ResumeLayout();

            return(targetCollection);
        }
Exemplo n.º 5
0
        void IDisposable.Dispose()
        {
            Control.ControlCollection listaPoze = this.flpPreview.Controls;
            this.flpPreview.Controls.Clear();

            foreach (PictureBoxPreview poza in listaPoze)
            {
                poza.Afiseaza -= picPreview_Afiseaza;
                if (poza.Image != null)
                {
                    poza.Image.Dispose();
                    poza.Image = null;
                }

                poza.Dispose();
            }

            listaPoze.Clear();
            listaPoze = null;

            if (this.lPozaModificata != null)
            {
                this.lPozaModificata.Dispose();
                this.lPozaModificata = null;
            }
        }
 public void CopyBackToControls(List <Control> i_List, Control.ControlCollection i_Structure)
 {
     i_Structure.Clear();
     foreach (Control control in i_List)
     {
         i_Structure.Add(control);
     }
 }
        public DifferenceTable(Control.ControlCollection control, int points, string id, bool ExtendTable = true, bool EditEnable = true, bool addToControls = true, int X = 0, int Y = 0, int ElementWidth = 70, int ElementHeight = 20)
        {
            if (addToControls)
            {
                control.Clear();
            }

            if (points < 2)
            {
                points = 2;
            }

            rows = points + 1;
            cols = points + 2;
            if (!ExtendTable)
            {
                cols = 3;
            }
            TableArray = new EditLabel[cols][];
            for (int j = 0; j < cols; j++)
            {
                if (j < 3)
                {
                    TableArray[j] = new EditLabel[rows];
                }
                else
                {
                    TableArray[j] = new EditLabel[rows - j + 2];
                }


                for (int i = 0; i < TableArray[j].Length; i++)
                {
                    TableArray[j][i]            = new EditLabel(control, id + i.ToString() + j.ToString(), addToControls, X, Y, ElementWidth, ElementHeight);
                    TableArray[j][i].label.Font = new System.Drawing.Font("Times New Roman Special G1", (ElementHeight / 2 - ElementHeight / ElementWidth), System.Drawing.FontStyle.Italic);
                    if (i == 0 || j == 0 || j > 2 || (j == 1 && EditEnable == false))
                    {
                        TableArray[j][i].EditEnable = false;
                    }
                    else
                    {
                        TableArray[j][i].label.Font   = new System.Drawing.Font("Times New Roman Special G1", (ElementHeight / 2 - ElementHeight / ElementWidth), ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))));
                        TableArray[j][i].label.Cursor = Cursors.Hand;
                    }
                }
            }

            if (addToControls)
            {
                setLocations();
                setNames();
                setNames_ForwardBackWardDifference();
                setLines();
                setLengths();
            }

            n = TableArray[0].Length - 2;
        }
Exemplo n.º 8
0
        public static void RemoveAll(this Control.ControlCollection collection, bool dispose = true)
        {
            if (dispose)
            {
                collection.OfType <Control>().ForEach(c => c.Dispose());
            }

            collection.Clear();
        }
Exemplo n.º 9
0
 public static void DisposeChildren(this Control.ControlCollection collection)
 {
     if (collection.IsReadOnly)
     {
         return;
     }
     for (var i = collection.Count - 1; i >= 0; i--)
     {
         collection[i].Dispose();
     }
     collection.Clear();
 }
Exemplo n.º 10
0
        internal static void AddControl(this Control.ControlCollection self, Control control)
        {
            control.Size = self.Owner.Size;
            control.Dock = DockStyle.Fill;

            self.Clear();
            self.Add(control);

            self.Owner.Text = control.Text;

            control.BringToFront();
            control.Show();
        }
Exemplo n.º 11
0
        private void loadSample(SampleInfo sample)
        {
            if (sample != null)
            {
                if (sample.FormName.StartsWith(@"ComponentOne\Demos\"))
                {
                    // run standalone demo or demo installer
                    RunDemo(sample.FormName);
                    return;
                }
                try
                {
                    this.Cursor = Cursors.AppStarting;
                    LockWindowUpdate(Handle);
                    if (breadCrumb.Items.Count == 2)
                    {
                        BreadCrumbItem item = breadCrumb.AddItem(sample.Name);
                        item.Tag = ExplorerMode.Samples;
                    }
                    else
                    {
                        breadCrumb.RemoveTop();
                        BreadCrumbItem item = breadCrumb.AddItem(sample.Name);
                        item.Tag = ExplorerMode.Samples;
                    }
                    string description = sample.LongDescription;
                    if (description == null || description == "")
                    {
                        description = sample.ShortDescription;
                    }
                    lblLeftDescriptionSamples.Text = description;

                    // load sample form
                    _activeForm = _viewer.Run(sample.FormName, sample.Name, sample.LongDescription);
                    // attach viewer if it is not attached yet
                    Control.ControlCollection collection = pnlMainSamples.Controls;
                    if (!collection.Contains(_viewer))
                    {
                        collection.Clear();
                        collection.Add(_viewer);
                        _viewer.Visible = true;
                    }
                    TheExplorer.CurrentExplorerMode = ExplorerMode.Samples;
                }
                finally
                {
                    LockWindowUpdate(IntPtr.Zero);
                    this.Cursor = Cursors.Default;
                }
            }
        }
        public static void ClearAndDispose(this Control.ControlCollection controls)
        {
            if (controls == null)
            {
                throw new ArgumentNullException(nameof(controls));
            }

            foreach (Control control in controls)
            {
                control.Dispose();
            }

            controls.Clear();
        }
Exemplo n.º 13
0
        /// <inheritdoc />
        public object PerformSet(object toTarget, object newValue, object[] arguments)
        {
            IEnumerable <Control> newValueEnumerable = (IEnumerable <Control>)newValue;

            Control.ControlCollection targetCollection = (Control.ControlCollection)toTarget;

            targetCollection.Owner.SuspendLayout();

            targetCollection.Clear();
            targetCollection.AddRange(newValueEnumerable.ToArray());

            targetCollection.Owner.ResumeLayout();

            return(targetCollection);
        }
Exemplo n.º 14
0
        private void refreshItems(Control suspend, Control.ControlCollection controls, List <TibiaObject> tibiaObjects, string sortedHeader, bool desc, EventHandler eventHandler, int maxItems = 20)
        {
            int maxWidth = 0;

            this.SuspendLayout();
            NotificationForm.SuspendDrawing(suspend);
            foreach (Control c in controls)
            {
                c.Dispose();
            }
            controls.Clear();
            UIManager.DisplayCreatureAttributeList(controls, tibiaObjects, 0, 10, out maxWidth, null, null, 0, maxItems, null, null, null, eventHandler, sortedHeader, desc);
            NotificationForm.ResumeDrawing(suspend);
            this.ResumeLayout(false);
        }
Exemplo n.º 15
0
        /// <summary>
        /// Make sure all Controls and Child Controls get disposed
        /// </summary>
        /// <param name="ctrls"></param>
        void DisposeSubControls(Control.ControlCollection ctrls)
        {
            if (ctrls == null)
            {
                return;
            }

            foreach (Control c in ctrls)
            {
                //DisposeSubControls(c.Controls);
                //c.Parent = null;
                c.Dispose();
            }

            ctrls.Clear();
        }
Exemplo n.º 16
0
    static public void InsertRangeBefore(this Control.ControlCollection coll, Control startpoint, IEnumerable <Control> clist)
    {
        List <Control> cur = new List <Control>();

        foreach (Control c in coll)
        {
            if (c == startpoint)
            {
                cur.AddRange(clist);
            }

            cur.Add(c);
        }
        coll.Clear();
        coll.AddRange(cur.ToArray());
    }
Exemplo n.º 17
0
 private void UpdateView(byte[] raw)
 {
     tagPageControl.Clear();
     xmlView.Clear();
     textView.txtRaw.Clear();
     wbxmlDoc.RemoveAll();
     rawBody = raw;
     if (validHeader)
     {
         tagPageControl.Add(xmlView);
         tagPageControl[0].Dock = DockStyle.Fill;
         wbxmlDoc.LoadBytes(rawBody);
         xmlView.SetXML(wbxmlDoc);
     }
     else
     {
         tagPageControl.Add(textView);
         tagPageControl[0].Dock = DockStyle.Fill;
         textView.txtRaw.AppendText("invalid vnd.ms-sync.wbxml package");
     }
 }
Exemplo n.º 18
0
 /// <summary>
 /// Removes all controls from the collection
 /// </summary>
 public void Clear()
 {
     _col.Clear();
 }
Exemplo n.º 19
0
        /// <summary>
        /// Render the views in prebuilt DockPanel layout
        /// </summary>

        internal void RenderViews()
        {
            ResultsViewProps view = null;
            XtraPanel        viewPanel;      // panel that contains current view control and is contained in a docking panel or directly in the views panel if single view on page
            DockPanel        activePanel = null;

            ResultsPage page = ResultsPage;

            if (page == null)
            {
                return;
            }

            List <ResultsViewProps> views = page.Views;

            if (views.Count == 0)             // just have a single blank panel if no views
            {
                RenderEmptyPage();
                return;
            }

            // See if single view without DockPanels

            else if (ResultsPage.Views.Count == 1 && Controls.Count == 1 && Controls[0] is XtraPanel)
            {
                view      = ResultsPage.Views[0];
                viewPanel = Controls[0] as XtraPanel;
                ConfigureViewInPanel(view, viewPanel);
                return;
            }

            // Scan the set of DockPanels and render the view associated with each panel

            else
            {
                DockManager dm = DockManager;
                foreach (DockPanel dp0 in dm.Panels)
                {
                    view = dp0.Tag as ResultsViewProps;
                    if (view == null)
                    {
                        continue;
                    }

                    Control.ControlCollection cc = dp0.ControlContainer.Controls;
                    cc.Clear();
                    viewPanel           = new XtraPanel();           // the panel that will contain the view control
                    viewPanel.Dock      = DockStyle.Fill;
                    viewPanel.BackColor = Color.White;
                    cc.Add(viewPanel);
                    ConfigureViewInPanel(view, viewPanel);

                    SetupDockPanel(dp0, view, viewPanel);

                    if (view == page.ActiveView)
                    {
                        activePanel = dp0;                         // save ref to active panel
                    }
                }

                if (activePanel != null)
                {
                    DockManager.ActivePanel = activePanel;
                }

                return;
            }
        }
Exemplo n.º 20
0
 /// <summary>
 /// Removes all the XPanderPanels from the collection.
 /// </summary>
 public void Clear()
 {
     m_controlCollection.Clear();
 }
Exemplo n.º 21
0
 public void ClearTreeview()
 {
     OurOrder.ClearCupboardList();
     ViewList.Clear();
     MainTreeview.Nodes.Clear();
 }
 public void showDrawing(string id)
 {
     control.Clear();
     new MyDrawArea(control, id, PointsList, PensList, OnlyPointsList, OnlyPensList, IntegrationPointsList,
                    IntegrationPensList, xmin, xmax, ymin, ymax);
 }
Exemplo n.º 23
0
 public void show(Control.ControlCollection maskBox)
 {
     maskBox.Clear();
     this.buildForm(maskBox, true);
 }