Example #1
0
        // ----------------------------------
        //		Methods-subscribers below
        // ----------------------------------


        private void View_FigureList_IndexChanged(object sender, int index)
        {
            if (index >= 0)
            {
                var points = (_figuresBuffer[index] as FigureDrawer).Adapter.GetRawPoints();

                object[] pts = new object[points.Length];

                points.CopyTo(pts, 0);

                _pointsBuffer.Clear();
                _pointsBuffer.AddRange(pts);
            }
        }
Example #2
0
        PopulateWithOtherWorkbookNames
        (
            Microsoft.Office.Interop.Excel.Workbook workbook
        )
        {
            Debug.Assert(workbook != null);
            AssertValid();

            ListBox.ObjectCollection oItems = this.Items;

            oItems.Clear();

            foreach (Microsoft.Office.Interop.Excel.Workbook oOtherWorkbook in
                     workbook.Application.Workbooks)
            {
                String sOtherWorkbookName = oOtherWorkbook.Name;

                // Filter out this workbook and the personal macro workbook.  The
                // Workbook.Name of the personal macro workbook is "Personal1" on
                // my machine -- can it be "PERSONAL2" or "PERSONAL3" as well?

                if (sOtherWorkbookName == workbook.Name ||
                    sOtherWorkbookName.ToLower().StartsWith("personal"))
                {
                    continue;
                }

                oItems.Add(sOtherWorkbookName);
            }
        }
Example #3
0
        private void BtnDivisorsClick(object sender, EventArgs e)
        {
            int n;

            try
            {
                n = int.Parse(tbxNum.Text);
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message, "Hiba lépett fel");
                return;
            }



            collection.Clear();

            for (int i = 1; i <= n; i++)
            {
                if (n % i == 0)
                {
                    collection.Add(i);
                }
            }
        }
        private void LoadTableInfo(ITable itable_1, ListBox.ObjectCollection listBoxItemCollection_0)
        {
            listBoxItemCollection_0.Clear();
            string str  = "";
            string str1 = "";

            try
            {
                if ((itable_1 as IDataset).Workspace.Type == esriWorkspaceType.esriLocalDatabaseWorkspace)
                {
                    IWorkspace workspace = (itable_1 as IDataset).Workspace;
                    if (workspace.PathName != null && Path.GetExtension(workspace.PathName).ToLower() == ".mdb")
                    {
                        str  = "[";
                        str1 = "]";
                    }
                }
                IFields fields = itable_1.Fields;
                for (int i = 0; i < fields.FieldCount; i++)
                {
                    IField field = fields.Field[i];
                    if ((field.Type == esriFieldType.esriFieldTypeGeometry
                        ? false
                        : field.Type != esriFieldType.esriFieldTypeBlob))
                    {
                        listBoxItemCollection_0.Add(string.Concat(str, field.Name, str1));
                    }
                }
            }
            catch
            {
            }
        }
Example #5
0
        public void printText <T>(IEnumerable <T> listlike, string title, int index)
        {
            ListBox label;

            switch (index)
            {
            case 1:
                label = this.label1;
                break;

            case 2:
                label = this.label2;
                break;

            default:
                label = null;
                break;
            }

            ListBox.ObjectCollection oc = label.Items;
            oc.Clear();

            if (label != null)
            {
                oc.Add(String.Format("{0}: \n", title));
                foreach (T item in listlike)
                {
                    oc.Add(String.Format("> {0} \n", item.ToString()));
                }
            }

            return;
        }
Example #6
0
 private static void CopyListOfIntsToObjectCollectionInListBox(List <YData> src, ListBox.ObjectCollection dest)
 {
     dest.Clear();
     foreach (var i in src)
     {
         dest.Add(i.Count);
     }
 }
Example #7
0
 public static void ToListBox(string repository, DataTable table,
                              ListBox.ObjectCollection collection)
 {
     collection.Clear();
     foreach (string filter in ToList(repository, table))
     {
         collection.Add(Templater.ToCaptions(table.Columns, RemoveTable(filter)));
     }
 }
Example #8
0
        private void updateListbox(ListBox.ObjectCollection dst, List <Vector2f> src)
        {
            dst.Clear();
            string str;

            foreach (var p in src)
            {
                str = p.X.ToString() + ", " + p.Y.ToString();
                dst.Add(str);
            }
        }
Example #9
0
 private void UpdateHostListControl()
 {
     ListBox.ObjectCollection list = HostSelectionList.Items;
     list.Clear();
     list.Add("Favorites:");
     foreach (var item in HostList.FavoriteHosts.ToArray())
         list.Add(item);
     list.Add("Recent:");
     foreach (var item in HostList.RecentHosts.ToArray())
         list.Add(item);
 }
        private static void AddFeature(String feature
                                       , ListBox.ObjectCollection items)
        {
            List <String> features = new List <String>(items.Cast <String>());

            features.Add(feature);
            features.Sort();

            items.Clear();
            items.AddRange(features.ToArray());
        }
        public void ListBox_ObjectCollection_ClearingAll()
        {
            _collection = new ListBox.ObjectCollection(new ListBox());
            Team   team   = new Team("Brazil");
            Player player = new Player("Ronaldo");

            _collection.Add(team);
            _collection.Add(player);

            Assert.IsNotEmpty(_collection);
            _collection.Clear();
            Assert.IsEmpty(_collection);
        }
Example #12
0
        public void FillLabelBox(List <Item> items, ListBox.ObjectCollection collection)
        {
            if ((collection == null) || (items == null))
            {
                throw new ArgumentNullException();
            }

            collection.Clear();

            foreach (Item i in items)
            {
                collection.Add(i);
            }
        }
Example #13
0
 private void UpdateReplaysList()
 {
     replays = Directory.GetFiles(@"" + (string)Settings.Default["PlaybackDir"], "*.rec");
     ListBox.ObjectCollection listReps = listReplays.Items;
     listReps.Clear();
     foreach (string rep in replays)
     {
         ReplayStream replay = new ReplayStream(rep);
         if (replay.readUInt32() != 0)
         {
             listReps.Add(Path.GetFileNameWithoutExtension(rep));
         }
         replay.close();
     }
 }
        // Refresh the Threads window.
        public override void RefreshWhenStopped()
        {
            ListBox.ObjectCollection items = Items;
            items.Clear();


            string[]     values  = null;
            MDbgThread[] threads = null;

            MainForm.ExecuteOnWorkerThreadIfStoppedAndBlock(delegate(MDbgProcess proc)
            {
                Debug.Assert(proc != null);
                Debug.Assert(!proc.IsRunning);

                MDbgThread tActive = proc.Threads.HaveActive
                                                                                             ? (proc.Threads.Active)
                                                                                             : null;

                values  = new string[proc.Threads.Count];
                threads = new MDbgThread[values.Length];
                int idx = 0;

                foreach (MDbgThread t in proc.Threads)
                {
                    string stFrame = "<unknown>";

                    if (t.BottomFrame != null)
                    {
                        stFrame = t.BottomFrame.Function.FullName;
                    }
                    string stActive = (t == tActive) ? "*" : " ";

                    string stFrozen = IsFrozen(t) ? "(FROZEN) " : "";

                    string s = stActive + "(" + t.Number + ") TID=" +
                               t.Id + ", " + stFrozen + stFrame;
                    //this.AddItem(s, t);
                    values[idx]  = s;
                    threads[idx] = t;
                    idx++;
                }
            });

            for (int i = 0; i < values.Length; i++)
            {
                AddItem(values[i], threads[i]);
            }
        }
        /// <summary>
        /// This method restricts the items that are displayed on
        /// the visual clipboard by comparing them to a keyword.
        /// </summary>
        /// <param name="keyword">current string in this.searchTextBox</param>
        private void RestrictKeys(string keyword)
        {
            // first, clear the visual part of the local clipboard
            ListBox.ObjectCollection myItems = this.listBox.Items;
            myItems.Clear();

            // traverse the keys in the local clipboard
            foreach (string key in LocalClipboard.Keys)
            {
                // if the item's key contains the keyword
                if (key.Contains(keyword))
                {
                    // add item back to the visual clipboard
                    myItems.Add(key);
                }
            }
        }
Example #16
0
        // Refresh the callstack window.
        // runs on UI thread.
        protected override void RefreshToolWindowInternal()
        {
            // Information we need filled out.
            FramePair[] list   = null;
            int         number = 0;
            int         id     = 0;


            // Make cross thread call to access ICorDebug and fill out data
            MainForm.ExecuteOnWorkerThreadIfStoppedAndBlock(delegate(MDbgProcess proc)
            {
                Debug.Assert(proc != null);
                Debug.Assert(!proc.IsRunning);

                MDbgThread thread = proc.Threads.Active;
                try
                {
                    number = thread.Number;
                    id     = thread.Id;
                    list   = GetFrameList(thread);
                }
                catch (Exception)
                {
                    list = null;
                }
            });

            if (list == null || list.Length == 0)
            {
                MarkCallstackAsRunning();
            }
            else
            {
                ListBox.ObjectCollection l = this.listBoxCallstack.Items;
                l.Clear();

                // Set Title.
                this.Text = "Callstack on Thread #" + number + " (tid=" + id + ")";

                // Add items
                foreach (FramePair f in list)
                {
                    l.Add(f);
                }
            }
        }
        /// <summary>
        /// This method allows all items to be displayed on the visual
        /// clipboard.
        /// </summary>
        private void AllowKeys()
        {
            // nothing to do if all items are already being displayed
            if (this.listBox.Items.Count == LocalClipboard.Keys.Count)
            {
                return;
            }

            // first, clear the visual part of the local clipboard
            ListBox.ObjectCollection myItems = this.listBox.Items;
            myItems.Clear();

            // traverse the keys in the local clipboard
            foreach (string key in LocalClipboard.Keys)
            {
                // add each item back to the visual clipboard
                myItems.Add(key);
            }
        }
        PopulateTopNByMetricUserSettingsListBox()
        {
            AssertValid();

            ListBox.ObjectCollection oItems =
                this.lbxTopNByMetricUserSettings.Items;

            oItems.Clear();

            foreach (TopNByMetricUserSettings oTopNByMetricUserSettings in
                     m_oTopNByMetricUserSettingsClone)
            {
                // Note that the TopNByMetricUserSettings.ToString() method
                // provides a description of the object that the
                // lbxTopNByMetricUserSettings ListBox will automatically display.

                oItems.Add(oTopNByMetricUserSettings);
            }
        }
        private void BtnLoad_Click(object sender, EventArgs e)
        {
            UseWaitCursor       = true;
            lblFileMessage.Text = "<<<<<<<<<<< Loading KEYS from the data file. Please Wait ..........  >>>>";
            textBox1.Text       = "";
            ListBox1.Items.Clear();
            lblCacheConfig.Text = "?";
            try
            {
                // Load file data asynchnously
                var t  = LoadCacheAsync();
                var aw = t.GetAwaiter();
                aw.OnCompleted(() =>
                               { if (m_IDs != null) //update UI
                                 {
                                     ListBox.ObjectCollection itms = ListBox1.Items;
                                     itms.Clear();
                                     ListBox1.DataSource = m_IDs;
                                     lblTotalRows.Text   = m_IDs.Length.ToString("N0");
                                     lblCacheConfig.Text = $"Sets #: {m_NumberOfSets}, Items Per Set: {m_NumberOfRecordsPerSet},  Algorithm:  {m_chacheAlgorithm}";

                                     /*
                                      * foreach (int key in m_IDs)
                                      * {
                                      *  itms.Add(key);
                                      *  if (key % 500 == 0) Application.DoEvents();
                                      * }
                                      */
                                     m_IDs               = null;
                                     UseWaitCursor       = false;
                                     lblFileMessage.Text = C_DefaultFileMSG;
                                 }
                               }
                               );
            }
            catch (Exception ex) {
                MessageBox.Show(ex.Message);
            }
        }
        /// <summary>
        /// This method restricts the type of items that are displayed on
        /// the visual clipboard.
        /// </summary>
        private void RestrictTypes()
        {
            // first, clear the visual part of the local clipboard
            ListBox.ObjectCollection myItems = this.listBox.Items;
            myItems.Clear();

            // add each item back to the listbox if its type is allowed
            bool allowType;

            foreach (string key in LocalClipboard.Keys)
            {
                allowType = (this.showTextItem.Checked && LocalClipboard.Dict[key].Type == ClipboardItem.TypeEnum.Text) ||
                            (this.showFilesItem.Checked && LocalClipboard.Dict[key].Type == ClipboardItem.TypeEnum.FileDropList) ||
                            (this.showImagesItem.Checked && LocalClipboard.Dict[key].Type == ClipboardItem.TypeEnum.Image) ||
                            (this.showAudioItem.Checked && LocalClipboard.Dict[key].Type == ClipboardItem.TypeEnum.Audio) ||
                            (this.showCustomItem.Checked && LocalClipboard.Dict[key].Type == ClipboardItem.TypeEnum.Custom);

                // if type is allowed, add to the listbox
                if (allowType)
                {
                    myItems.Add(key);
                }
            }
        }
Example #21
0
 // Token: 0x06000186 RID: 390 RVA: 0x00002B1C File Offset: 0x00000D1C
 static void smethod_3(ListBox.ObjectCollection objectCollection_0)
 {
     objectCollection_0.Clear();
 }
 public static void ClearThenAddRange(this ListBox.ObjectCollection @this, string[] data)
 {
     @this.Clear();
     @this.AddRange(data);
 }
        /// <summary>
        /// Loads an ESRI(c) SHP file into a Map series.
        /// </summary>
        /// <param name="Series"></param>
        /// <param name="FileName"></param>
        /// <param name="Table"></param>
        /// <param name="FieldName"></param>
        /// <param name="FieldValue"></param>
        /// <param name="Debug"></param>
        public void LoadMap(Map Series, string FileName, DataTable Table,
                            string FieldName, string FieldValue, ListBox.ObjectCollection Debug,
                            string filter)
        {
            debug = Debug;
            SHPHeader       shpHeader       = new SHPHeader();
            SHPRecordHeader shpRecordHeader = new SHPRecordHeader();

            // Verify map file name
            string tmpName = FileName; // replaceFilePath(FileName, ".shp");

            FileStream f = File.OpenRead(tmpName);

            try
            {
                if (debug != null)
                {
                    debug.Clear();
                }

                AddDebug("Real File size: " + f.Length.ToString());

                f.Position = 0;
                ReadSHPHeader(f, ref shpHeader);

                VerifySignature(shpHeader.FileCode, tmpName);

                ShowHeader(shpHeader);

                tmpName = replaceFilePath(FileName, ".shx");

                FileStream fx = File.OpenRead(tmpName);
                try
                {
                    fx.Position = 0;
                    ReadSHPHeader(fx, ref shpHeader);

                    VerifySignature(shpHeader.FileCode, tmpName);

                    if (debug != null)
                    {
                        AddDebug(" ");
                        AddDebug("Real File size: " + fx.Length.ToString());
                    }

                    int NumRecords = ShowHeader(shpHeader);

                    Series.Clear();
                    Series.BeginUpdate();
                    Series.Chart.AutoRepaint = false;

                    for (int i = 1; i <= NumRecords; ++i)
                    {
                        ReadRecordHeader(fx, ref shpRecordHeader);

                        if (debug != null)
                        {
                            AddDebug(" ");
                            AddDebug("Record Num: " + Convert.ToString(i) + " Offset: " + Convert.ToString(2 * shpRecordHeader.RecordNumber) +
                                     " Length: " + Convert.ToString(shpRecordHeader.RecordLength));
                        }

                        f.Position = 2 * shpRecordHeader.RecordNumber;
                        ReadRecordHeader(f, ref shpRecordHeader);

                        if (debug != null)
                        {
                            AddDebug("Record Num: " + Convert.ToString(shpRecordHeader.RecordNumber));
                        }

                        BinaryReader bin = new BinaryReader(f);

                        ShapeType = bin.ReadInt32();
                        LoadShape(bin, Table, Series, FieldName, FieldValue, i - 1);
                    }

                    Series.EndUpdate();
                    Series.Chart.AutoRepaint = true;
                    //Series.Chart.Invalidate();
                }
                finally
                {
                    fx.Close();
                }
            }
            finally
            {
                f.Close();
            }
        }
Example #24
0
 public new void Clear()
 {
     Items.Clear();
     base.Clear();
 }
Example #25
0
 // Clear callstack for running
 public void MarkCallstackAsRunning()
 {
     ListBox.ObjectCollection list = this.listBoxCallstack.Items;
     list.Clear();
     AddItem("Callstack unavailable because process is either running or not available.", null);
 }
Example #26
0
 private void BtnDeleteAllClick(object sender, EventArgs e)
 {
     collection.Clear();
 }