Inheritance: IList, ICollection, IEnumerable
Beispiel #1
0
        public SearchForLinkForm(ListView.ListViewItemCollection items, int indexOfLineToDisable, TextBox textBoxToChange)
        {
            InitializeComponent();

            this.items = items;
            this.indexOfLineToDisable = indexOfLineToDisable;
            this.textBoxToChange = textBoxToChange;
        }
Beispiel #2
0
 public Builder(SIBuilderInfo sib, MailInfo mi, ListView.ListViewItemCollection scDetails)
 {
     sibInfo = sib;
     miInfo = mi;
     IsBuilding = false;
     IsPaused = false;
     IsBuildAborted = false;
     SourceControlDetails = scDetails;
 }
 public FormSumColumn(ListView.ListViewItemCollection _columns)
 {
     InitializeComponent();
     foreach (ListViewItem item in _columns)
     {
         checkedListBoxColumns.Items.Add(item.Text);
     }
     columns = _columns;
 }
		public frm_TodoList()
		{
			SourceParser.ParsingFinished += new Protean.Plugins.TodoList.SourceParser.ParsingFinishedEventHandler(SourceParser_ParsingFinished);
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
			//
			// TODO: Add any constructor code after InitializeComponent call
			//
			this.comboBoxItem1.ComboBox.SelectedIndexChanged += new EventHandler(ComboBox_SelectedIndexChanged);
			this.m_ListItems	= new ListView.ListViewItemCollection(new ListView());
		}
        public SnmpPoller(ListView resultlist, ListView cpuresultlist)
        {
            HostName = "localhost";
            SnmpPort = 161;
            SnmpCommunity = "public";
            SnmpVersion = VersionCode.V2;
            SnmpUser = string.Empty;
            SnmpPassword = string.Empty;

            SnmpTimeout = 1000;
            SnmpRetry = 0;
            results = new ListView.ListViewItemCollection(resultlist);
            CpuResults = new ListView.ListViewItemCollection(cpuresultlist);
        }
Beispiel #6
0
        public CodeBox GenerateText(ListView.ListViewItemCollection collection)
        {
            this._collection = collection;
            this.txtboxCode.Text = string.Format("{0}", "// Paste this");
            for(var i = 1; i < collection.Count; i++) {
                var x1 = int.Parse(collection[i - 1].SubItems[0].Text);
                var y1 = int.Parse(collection[i - 1].SubItems[1].Text);
                var t = bool.Parse(collection[i - 1].SubItems[2].Text);
                var x2 = int.Parse(collection[i].SubItems[0].Text);
                var y2 = int.Parse(collection[i].SubItems[1].Text);

                if(!t) this.txtboxCode.Text += string.Format("\r\nthis.{4}.DrawLine(this.{5}, {0}, {1}, {2}, {3});", x1, y1, x2, y2, txtboxGraphics.Text, txtboxPen.Text);
            }
            return this;
        }
        private void PopulateListView()
        {
            var itemCollection = new ListView.ListViewItemCollection(listView1);

            var articles = from c in GlobalValiables.Db.Table_Articles
                           where c.CategoryId == _categoryId
                           select c;

            foreach (Table_Article article in articles)
            {
                var item = new ListViewItem();
                item.SubItems.Add(article.ArticleId.ToString());
                item.SubItems.Add(article.Title);
                item.SubItems.Add(article.UpdateDate.ToShortDateString());
                item.SubItems.Add(article.CountViews.ToString());
                itemCollection.Add(item);
            }
            listView1.Refresh();
        }
 public ItemActions(ref ListView listviewp, int itemp, ref SystemsDataMultiple allSystemsDatap)
 {
     InitializeComponent();
     listViewInvFile = listviewp;
     item = itemp;
     allSystemsData = allSystemsDatap;
     rows = listViewInvFile.Items;   //gets all the listview rows to work with in methods
     labelInitialStatement.Text += (item + 1).ToString();    //ROW is always item+1
     //next get assettag and serial index, then get data and load this form with that data
     int serialNumIndex = listViewInvFile.Columns.IndexOfKey("compSerialNum");  //index of the serial number column
     serialNoMR = rows[item].SubItems[serialNumIndex].Text;   //gets the MR serial number from listview row
     assetTagIndex = listViewInvFile.Columns.IndexOfKey("compAssetTag");
     serialNumHRIndex = listViewInvFile.Columns.IndexOfKey("compSerialNumHR");
     if (rows[item].SubItems[assetTagIndex].Text != string.Empty)
         textboxAssetTag.Text = rows[item].SubItems[assetTagIndex].Text;
     if (rows[item].SubItems[serialNumHRIndex].Text != string.Empty)
         textBoxSerialNo.Text = rows[item].SubItems[serialNumHRIndex].Text;
     assetTag = textboxAssetTag.Text;
     serialNoHR = textBoxSerialNo.Text;
 }
Beispiel #9
0
        private void btnScan_Click(object sender, EventArgs e)
        {
            statusLabel.Text = "Scanning domain " + WindowsCred.GetDomain() + " for computers... Please Wait.";
            Application.DoEvents();

            // Enumerate computers in domain, add to listviewComputers control
            listviewComputers.Items.Clear();

            ListView.ListViewItemCollection listItems = new ListView.ListViewItemCollection(listviewComputers);
            if (DEBUG)
            {
                String[] debugComputers = new String[] { "DCMAIN", "ROBTEST-PC", "ROB-PC" };
                foreach (String computer in debugComputers)
                {
                    ListViewItem newItem = new ListViewItem(computer);
                    listItems.Add(newItem);
                }
            }
            else
            {
                foreach (SearchResult computer in WindowsCred.EnumerateComputers())
                {

                    ListViewItem newItem = new ListViewItem(computer.GetDirectoryEntry().Name.Substring(3).ToUpper());
                    listItems.Add(newItem);

                }

            }

            // Update label to display domain
            lblDomain.Text = "Computers in domain: " + WindowsCred.GetDomain();
            statusLabel.Text = "Scan Domain complete.";

            Application.DoEvents();

            PingListView.PingAll();

            label4.Text = "Computers: " + listviewComputers.Items.Count.ToString();
        }
Beispiel #10
0
        private ListViewGroup(SerializationInfo info, StreamingContext context)
        {
            header           = info.GetString("Header");
            name             = info.GetString("Name");
            header_alignment = (HorizontalAlignment)info.GetInt32("HeaderAlignment");
            tag = info.GetValue("Tag", typeof(object));

            int count = info.GetInt32("ListViewItemCount");

            if (count > 0)
            {
                if (items == null)
                {
                    items = new ListView.ListViewItemCollection(list_view_owner);
                }

                for (int i = 0; i < count; i++)
                {
                    items.Add((ListViewItem)info.GetValue(string.Format("ListViewItem_{0}", i), typeof(ListViewItem)));
                }
            }
        }
Beispiel #11
0
        public void ThreadProc()
        {
            if (m_threadExit)
            {
                return;
            }

            TreeView.CheckForIllegalCrossThreadCalls = false;
            DirectoryInfo di = new DirectoryInfo(((tree_tag)this.tv1.SelectedNode.Tag).strPath);
            ListView.ListViewItemCollection lvc = new ListView.ListViewItemCollection(this.lv1);

            foreach (FileInfo f in di.GetFiles())
            {
                if (m_threadExit)
                {
                    return;
                }

                Application.DoEvents();
                fl.pbar.Value++;
                fl.label1.Text = f.FullName;

                if (strFilter.IndexOf(";" + f.Extension.ToLower() + ";") == -1)
                {
                    continue;
                }

                if (imageList1.Images.ContainsKey(f.FullName))
                {
                    continue;
                }

                sprViewer.SPRItem.PIC_TYPE pt = sprViewer.SPRItem.PIC_TYPE.NULL;

                switch (f.Extension.ToLower())
                {
                    case ".mdl":
                        {
                            pt = sprViewer.SPRItem.PIC_TYPE.MDL;
                            break;
                        }                        
                    case ".mtl":
                        {
                            pt = sprViewer.SPRItem.PIC_TYPE.MTL;
                            break;
                        }                        
                    case ".mesh":
                        {
                            pt = sprViewer.SPRItem.PIC_TYPE.MESH;
                            break;
                        }                        
                    case ".ani":
                        {
                            pt = sprViewer.SPRItem.PIC_TYPE.ANI;
                            break;
                        }                        
                    case ".tani":
                        {
                            pt = sprViewer.SPRItem.PIC_TYPE.ANI;
                            break;
                        }                        
                    case ".spr":
                        {
                            pt = sprViewer.SPRItem.PIC_TYPE.NULL;
                            break;
                        }                        
                }

                sprViewer.SPRItem si;

                if (pt != sprViewer.SPRItem.PIC_TYPE.NULL)
                {
                    si = new sprViewer.SPRItem(f.FullName, pt, m_engine);
                }
                else
                {
                    si = new sprViewer.SPRItem(f.FullName);
                }
                
                //check cache
                if(File.Exists(si.tgaFileName + ".BMP") 
                    && f.LastWriteTime.ToString() == sprViewer.IniIO.IniReadValue("cache","time",si.tgaFileName + "_tb.ini"))
                {
                    Image img = new Bitmap(si.tgaFileName + ".BMP");
                    imageList1.Images.Add(f.FullName, img);
                }
                else
                {
                    int ind = si.TGAList.Count / 2 ;
                    ind = ind == 0 ? 1 : ind;
                    if (ind <= si.TGAList.Count)
                    {
                        string file = si.TGAList[ind.ToString()].ToString();
                        if (File.Exists(file))
                        {
                            try
                            {
                                Image img = Image.FromFile(file);
                                Image imgsmall = img.GetThumbnailImage(48, 48, null, IntPtr.Zero);
                                imgsmall.Save(si.tgaFileName + ".BMP");
                                imageList1.Images.Add(f.FullName, imgsmall);
                                sprViewer.IniIO.IniWriteValue("cache", "time", f.LastWriteTime.ToString(), si.tgaFileName + "_tb.ini");
                            }
                            catch (System.Exception )
                            {
                            }
                        }
                    }
                }
            }
        }
Beispiel #12
0
        private void LoadNodeDir(TreeNode node)
        {
            if (!Directory.Exists(((tree_tag)node.Tag).strPath))
            {
                return;
            }

            Control ctrl_parent = lv1.Parent;
            ctrl_parent.Controls.Remove(lv1);

            if (((tree_tag)node.Tag).listv != null)
            {
                lv1 = ((tree_tag)node.Tag).listv;
                ctrl_parent.Controls.Add(lv1);
                lv1.Enabled = true;
                lv1.Visible = true;
                lv1.Select();
                autoSelect(lv1);
                return;
            }

            fl.Show();
            fl.Enabled = false;

            tv1.Enabled = false;

            lv1 = new ListView();

            lv1.SelectedIndexChanged    += new System.EventHandler(lv1_SelectedIndexChanged);
            lv1.DoubleClick             += new EventHandler(lv1_DoubleClick);
            lv1.LargeImageList          = imageList1;
            lv1.Dock                    = DockStyle.Fill;
            lv1.MultiSelect             = false;

            ctrl_parent.Controls.Add(lv1);
            //lv1.Clear();

            DirectoryInfo di = new DirectoryInfo(((tree_tag)node.Tag).strPath);
            fl.pbar.Maximum = di.GetFiles().Length;
            fl.pbar.Value = 0;
            ListView.ListViewItemCollection lvc = new ListView.ListViewItemCollection(lv1);
            lv1.Visible = false;
            lv2.Visible = true;

            if(this.showFolder == true)
            {
                string stroutout = string.Empty;
                foreach (DirectoryInfo d in di.GetDirectories())
                {
                    if (d.Name == ".svn" || d.Name == "Texture") continue;

                    Application.DoEvents();
                    fl.label1.Text = d.FullName;
                    if (imageList1.Images.ContainsKey(d.FullName))
                    {
                        lvc.Add(d.Name, d.FullName).Tag = "folder";
                        continue;
                    }
                    Image imgFolder = imageList3.Images["folder.bmp"];
                    FileInfo[] files = d.GetFiles(this.strFolderPreviewFilter);
                    if(files.Length == 0)
                    {
                        DirectoryInfo[] d111 = d.GetDirectories("模型");
                        if (d111.Length > 0)
                            files = d111[0].GetFiles(this.strFolderPreviewFilter);
                    }
                    //    
                    if(files.Length == 0)   //普通目录
                    {
                        imageList1.Images.Add(d.FullName, imgFolder);
                        lvc.Add(d.Name, d.FullName).Tag = "folder";
                        continue;
                    }
                    Debug.WriteLine(files[0].FullName);
                    stroutout += files[0].FullName + "\r\n";
                    sprViewer.SPRItem si = new sprViewer.SPRItem(files[0].FullName, sprViewer.SPRItem.PIC_TYPE.MDL, m_engine);

                    //check cache
                    if (File.Exists(si.tgaFileName + "!.BMP")
                        && d.LastWriteTime.ToString() == sprViewer.IniIO.IniReadValue("cache", "time", si.tgaFileName + "_tb.ini"))
                    {
                        Image img = new Bitmap(si.tgaFileName + "!.BMP");
                        imageList1.Images.Add(d.FullName, img);
                    }
                    else
                    {
                        int ind = si.TGAList.Count / 2;
                        ind = ind == 0 ? 1 : ind;
                        string strFile = si.TGAList[ind.ToString()].ToString();
                        if (File.Exists(strFile))
                        {
                            Image img = Image.FromFile(strFile);
                            Image imgsmall = img.GetThumbnailImage(80, 80, null, IntPtr.Zero);
                            //imgsmall.Save(@"C:\Documents and Settings\kuangsihao\桌面\newtools\_cache\mdl\folder.bmp");
                            Image imgCombo = new Bitmap(imgFolder);
                            Graphics g = Graphics.FromImage(imgCombo);
                            //g.DrawImage(imgsmall, new Point(0, 0));
                            g.DrawImage(imgsmall, new Rectangle(6, 8, imgsmall.Width, imgsmall.Height));
                            //g.DrawImage(img, new Rectangle(0, 0, img.Width, img.Height));
                            imgCombo.Save(si.tgaFileName + "!.BMP");
                            imageList1.Images.Add(d.FullName, imgCombo);
                            sprViewer.IniIO.IniWriteValue("cache", "time", d.LastWriteTime.ToString(), si.tgaFileName + "_tb.ini");
                        }
                    }
                    ListViewItem lvi = lvc.Add(d.Name, d.FullName);
                    lvi.Tag = "folder";
                }
            }

            foreach (FileInfo f in di.GetFiles())
            {
                Application.DoEvents();
                fl.pbar.Value++;
                fl.label1.Text = f.FullName;

                if (strFilter.IndexOf(";" + f.Extension.ToLower() + ";") == -1)
                {
                    continue;
                }

                if (imageList1.Images.ContainsKey(f.FullName))
                {
                    lvc.Add(f.Name, f.FullName).Tag = "file";
                    continue;
                }

                if (!multi_load)
                {
                    sprViewer.SPRItem.PIC_TYPE pt = sprViewer.SPRItem.PIC_TYPE.NULL;

                    switch (f.Extension.ToLower())
                    {
                        case ".mdl":
                            {
                                pt = sprViewer.SPRItem.PIC_TYPE.MDL;
                                break;
                            }                            
                        case ".mtl":
                            {
                                pt = sprViewer.SPRItem.PIC_TYPE.MTL;
                                break;
                            }                            
                        case ".mesh":
                            {
                                pt = sprViewer.SPRItem.PIC_TYPE.MESH;
                                break;
                            }                            
                        case ".ani":
                            {
                                pt = sprViewer.SPRItem.PIC_TYPE.ANI;
                                break;
                            }                            
                        case ".tani":
                            {
                                pt = sprViewer.SPRItem.PIC_TYPE.ANI;
                                break;
                            }                            
                        case ".spr":
                            {
                                pt = sprViewer.SPRItem.PIC_TYPE.NULL;
                                break;
                            }                            
                    }

                    sprViewer.SPRItem si;

                    if (pt != sprViewer.SPRItem.PIC_TYPE.NULL)
                    {
                        si = new sprViewer.SPRItem(f.FullName, pt, m_engine, true);
                    }
                    else
                    {
                        si = new sprViewer.SPRItem(f.FullName);
                    }

                    //check cache
                    if (File.Exists(si.tgaFileName + ".BMP")
                     && f.LastWriteTime.ToString() == sprViewer.IniIO.IniReadValue("cache", "time", si.tgaFileName + "_tb.ini"))
                    {
                        Image img = new Bitmap(si.tgaFileName + ".BMP");
                        imageList1.Images.Add(f.FullName, img);
                    }
                    else
                    {
                        int ind = si.TGAList.Count / 2;
                        ind = ind == 0 ? 1 : ind;

                        if (ind <= si.TGAList.Count)
                        {
                            string file = si.TGAList[ind.ToString()].ToString();
                            if (File.Exists(file))
                            {
                                Image img = Image.FromFile(file);
                                Image imgsmall = img.GetThumbnailImage(48, 48, null, IntPtr.Zero);
                                imgsmall.Save(si.tgaFileName + ".BMP");
                                imageList1.Images.Add(f.FullName, imgsmall);
                                sprViewer.IniIO.IniWriteValue("cache", "time", f.LastWriteTime.ToString(), si.tgaFileName + "_tb.ini");
                            }
                        }
                    }
                }

                ListViewItem lvi = lvc.Add(f.Name, f.FullName);
                lvi.Tag = "file";
            }

            if (multi_load)
            {
                m_thread = new System.Threading.Thread(new System.Threading.ThreadStart(ThreadProc));
                m_thread.Start();
            }

            ((tree_tag)node.Tag).listv = lv1;

            //清多于nQueMax个ListView的缓存
            tag_que.Enqueue((tree_tag)node.Tag);
            while (tag_que.Count > nQueMax)
            {
                tree_tag tt = tag_que.Dequeue();
                tt.listv = null;
            }

            fl.Hide();
            tv1.Enabled = true;
            lv1.Visible = true;
            lv2.Visible = false;
            lv1.Select();
            autoSelect(lv1);

            OldLVC.Clear();
        }
Beispiel #13
0
 public ListViewGroup(string header, HorizontalAlignment headerAlignment)
 {
     this.header      = header;
     header_alignment = headerAlignment;
     items            = new ListView.ListViewItemCollection(list_view_owner, this);
 }
Beispiel #14
0
        private void selectImages() 
        {
            lvImages.Items.Clear();
            if (lvImages.LargeImageList != null)
                lvImages.LargeImageList.Dispose();

            int lowerIdx = (int)Math.Min(_selectionA, _selectionB);
            int upperIdx = (int)Math.Max(_selectionA, _selectionB);

            _imageList = new ImageList();
            _imageList.ColorDepth = ColorDepth.Depth24Bit;
            _imageList.ImageSize = new Size(128, 128);

            ListView.ListViewItemCollection items = new ListView.ListViewItemCollection(lvImages);
            lvImages.LargeImageList = _imageList;

            for (int i = lowerIdx; i <= upperIdx; ++i)
            {
                string path = _imagePaths[_OPTICSMapping[i]];
                _imageList.Images.Add(Image.FromFile(path));
            }

            for (int i = lowerIdx; i <= upperIdx; ++i)
            {
                ListViewItem item = new ListViewItem();
                item.Text = _imagePaths[_OPTICSMapping[i]];
                item.Tag = _rDistances[i];
                item.ImageIndex = i - lowerIdx;
                item.StateImageIndex = _rDistances[i] > _thresh || _rDistances[i] < 0 ? 1 : 0;
                items.Add(item);
            }
        }
Beispiel #15
0
 public Browser1(ListView.ListViewItemCollection lvic)
     : this()
 {
     this.lvic = lvic;
 }
 public FindTextForm(ListView.ListViewItemCollection items)
 {
     InitializeComponent();
     noticeListViewItems = items;
 }
Beispiel #17
0
		public ListViewGroup (string header, HorizontalAlignment headerAlignment)
		{
			this.header = header;
			header_alignment = headerAlignment;
			items = new ListView.ListViewItemCollection (list_view_owner, this);
		}
Beispiel #18
0
        private AShow GetShowsFromListView(string listview)
        {
            AShow shows = new AShow(1);
            ListView.ListViewItemCollection collection = null;
            if (listview == "Favorites")
                collection = new ListView.ListViewItemCollection(lstv_Favorites);
            else if (listview == "WishList")
                collection = new ListView.ListViewItemCollection(lstvw_WishList);

            this.Invoke((MethodInvoker)delegate {
                foreach (ListViewItem li in collection)
                {
                    if (li.Text != "Add" & li.Text.IndexOf("file is corrupt") == -1 & li.Text.IndexOf("file doesn't exist") == -1)
                    {
                        AShow t = new AShow(li.Text);
                        shows.Add(t);
                    }
                }
            });
            return shows;
        }
Beispiel #19
0
        // Used for getting the ListView items from within the BackgroundWorker thread.
        private ListView.ListViewItemCollection GetListViewItems(ListView listView)
        {
            ListView.ListViewItemCollection tmpListViewColl = new ListView.ListViewItemCollection(new ListView());

            if (!listView.InvokeRequired)
            {
                foreach (ListViewItem item in listView.Items)
                    tmpListViewColl.Add((ListViewItem)item.Clone());

                return tmpListViewColl;
            }
            else
                return (ListView.ListViewItemCollection)this.Invoke(new GetItems(GetListViewItems), new object[] { listView });
        }
Beispiel #20
0
 public CListViewItem()
     : base()
 {
     Spawn = new System.Windows.Forms.ListView();
     Children = new ListView.ListViewItemCollection(Spawn);
 }
Beispiel #21
0
        /// <summary>
        /// 通过listview 空间显示案件编号信息
        /// </summary>
        /// <param name="regNoList"></param>
        /// <param name="listView"></param>
        private void ShowListView(IList<EY_RegNo_DI> regNoList,ListViewEx listView)
        {
            listView.Items.Clear();
                ListView.ListViewItemCollection collection = new ListView.ListViewItemCollection(listView);
                foreach (EY_RegNo_DI t in regNoList)
                {
                    ListViewItem lv = new ListViewItem(t.toArray());

                    collection.Add(lv);
                }
        }
        // The progress updater for the backgroundWorker
        private void backgroundWorkerRead_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            string[] msgInput = (string[])e.UserState;
            if (!string.IsNullOrEmpty(IdentifiedPacketName) && IdentifiedId == msgInput[1] && IdentifiedMessage == (msgInput[7]).Replace(" ", "")) //spaces are removed
            {

                msgInput[0] = IdentifiedPacketName; //identify packet names
            }
            // added for having filter affect while the messages enter
            List<ListViewItem> filterResult = new List<ListViewItem>();
            if (filterFlag == true && msgInput != null)
            {
                ListView arrivedListview = new ListView();
                arrivedListview.Items.Add(new ListViewItem(msgInput));
                ListView.ListViewItemCollection lviCollection = new ListView.ListViewItemCollection(arrivedListview);
                filterResult = ProcessFilter(lviCollection);
                if (filterResult == null) // if there is nothing to filter add the arrived item to our main list (filterItems)
                {
                    filterItems.Add(arrivedListview.Items[0]);
                }
            }
            if (msgInput != null)
            {
                if (viewLimit.Checked)
                {
                    if (MonitorBox.Items.Count > Convert.ToInt32(numericLimit.Value) && filterResult.Count > 0)
                        MonitorBox.Items.RemoveAt(0);
                }
                if (filterFlag) //if the filter is selected
                {
                    foreach (ListViewItem item in filterResult)
                    {
                        MonitorBox.Items.Add(item.Clone() as ListViewItem); //cloned because it did not allow using the same object twice in differed places

                    }

                    if (highlightFlag)
                        ProcessHighlight(highlightFlag, MonitorBox.Items);
                }
                else
                {
                    MonitorBox.Items.Add(new ListViewItem(msgInput));
                    ProcessHighlight(highlightFlag, MonitorBox.Items);
                }
            }
            ReceiveCount.Text = e.ProgressPercentage.ToString();
        }
Beispiel #23
0
 public ListView.ListViewItemCollection getSessionList(ListView owner)
 {
     ListView.ListViewItemCollection colListVItem = new ListView.ListViewItemCollection(owner);
     int i = 1;
     ListViewItem t;
     foreach (Session s in Sessions)
     {
         t = new ListViewItem(i.ToString());
         t.SubItems.AddRange(s.getSubItems());
         t.Tag = s;
         colListVItem.Add(t);
         i++;
     }
     return colListVItem;
 }
        public SnmpPoller(ListView resultlist, ListView cpuresultlist, string hostname, int port, string community, int version, string user, string password)
        {
            HostName = hostname;
            SnmpPort = port;
            SnmpCommunity = community;

            switch (version)
            {
                case 1: SnmpVersion = VersionCode.V1; break;
                case 2: SnmpVersion = VersionCode.V2; break;
                case 3: SnmpVersion = VersionCode.V3; break;
                default: SnmpVersion = VersionCode.V2; break;
            }

            SnmpUser = user;
            SnmpPassword = password;

            SnmpTimeout = 1000;
            SnmpRetry = 0;
            results = new ListView.ListViewItemCollection(resultlist);
            CpuResults = new ListView.ListViewItemCollection(cpuresultlist);
        }
Beispiel #25
0
        public void RefreshSearchResults(int mode)
        {
            ulong x = 0;
            bool reloadDump = false;
            ListView.ListViewItemCollection items = new ListView.ListViewItemCollection(lvSch);
            //lvSch.Items.

            switch (mode)
            {
                case 0: /* Refresh by reloading everything from the dump */
                    lvSch.Items.Clear();

                    if (Form1.SchResCnt == 0)
                        reloadDump = true;

                    if (reloadDump)
                    {
                        lvSch.BeginUpdate();
                        while (true)
                        {
                            String Addr = "";

                            CodeRes[] retRes = fileio.ReadDumpArray(dFileName, (int)x, (MaxRes - 1) + (int)x, (int)GlobAlign);
                            if (retRes == null)
                                return;

                            GlobAlign = (ulong)retRes[0].align;
                            NextSAlign = (int)retRes[0].align;

                            for (int z = 0; z < retRes.Length; z++)
                            {

                                if (retRes[z].val == null)
                                    goto nextZ;

                                ListRes a = misc.GetlvVals((int)GlobAlign, retRes[z].val, 0);

                                Addr = (retRes[z].addr).ToString("X8");

                                string[] row = { Addr, a.HexVal, a.DecVal, a.AlignStr };
                                var listViewItem = new ListViewItem(row);
                                //lvSch.Items.Add(listViewItem);
                                items.Add(listViewItem);

                            nextZ:
                                if ((x % 1000) == 0)
                                {
                                    statusLabel1.Text = "Results: " + x.ToString();
                                    Application.DoEvents();
                                }
                                if (retRes[z].val == null && reloadDump)
                                {
                                    Form1.SchResCnt = x;
                                    statusLabel1.Text = "Results: " + x.ToString();
                                    lvSch.EndUpdate();
                                    NewSearch = false;
                                    schNSearch.Enabled = true;
                                    return;
                                }
                                x++;
                            }
                        }
                    }
                    else
                    {
                        lvSch.BeginUpdate();
                        //for (x = 0; x < Form1.SchResCnt; x++)
                        while (x < Form1.SchResCnt)
                        {
                            String Addr = "";

                            CodeRes[] retRes = fileio.ReadDumpArray(dFileName, (int)x, (MaxRes - 1) + (int)x, (int)GlobAlign);
                            if (retRes == null)
                                return;

                            if ((int)x < retRes.Length)
                            {
                                GlobAlign = (ulong)retRes[x].align;
                                NextSAlign = (int)retRes[x].align;
                            }

                            int z = 0;
                            for (z = 0; z < retRes.Length; z++)
                            {
                                if (retRes[z].val == null)
                                    goto nextZ;

                                ListRes a = misc.GetlvVals((int)GlobAlign, retRes[z].val, 0);

                                Addr = (retRes[z].addr).ToString("X8");

                                string[] row = { Addr, a.HexVal, a.DecVal, a.AlignStr };
                                var listViewItem = new ListViewItem(row);
                                items.Add(listViewItem);

                            nextZ:
                                if ((z % 1000) == 0)
                                    Application.DoEvents();
                            }
                            x += (ulong)z;
                        }
                        lvSch.EndUpdate();
                    }

                    break;
                case 1: /* Refresh everything by grabbing the values from the PS3 */
                    lvSch.BeginUpdate();
                    for (x = 0; x < Form1.SchResCnt; x++)
                    {
                        String Addr = "";
                        int align = (int)GlobAlign;

                        CodeRes[] retRes = fileio.ReadDumpArray(dFileName, (int)x, MaxRes + (int)x, (int)GlobAlign);
                        if (retRes == null)
                            return;

                        for (int z = 0; z < retRes.Length; z++)
                        {

                            if (x >= Form1.SchResCnt)
                                break;

                            if ((int)GlobAlign == -1 || (int)GlobAlign == -2)
                                align = retRes[z].val.Length;

                            byte[] ret = new byte[align];
                            apiGetMem(retRes[z].addr, ref ret);

                            ListRes a = new ListRes();
                            a = misc.GetlvVals((int)GlobAlign, ret, 0);

                            Addr = (retRes[z].addr).ToString("X8");

                            if ((int)x < lvSch.Items.Count)
                            {
                                items[(int)x].SubItems[0].Text = Addr;
                                items[(int)x].SubItems[1].Text = a.HexVal;
                                items[(int)x].SubItems[2].Text = a.DecVal;
                                items[(int)x].SubItems[3].Text = a.AlignStr;
                            }
                            else
                            {
                                string[] row = { Addr, a.HexVal, a.DecVal, a.AlignStr };
                                var listViewItem = new ListViewItem(row);
                                items.Add(listViewItem);
                            }

                            x++;
                            if ((x % 500) == 0)
                                Application.DoEvents();
                        }
                    }
                    lvSch.EndUpdate();
                    break;
            }
        }
Beispiel #26
0
 public Browser(ListView.ListViewItemCollection lvic, string source)
     : this()
 {
     this.lvic = lvic;
     this.source = source;
 }
Beispiel #27
0
		private ListViewGroup(SerializationInfo info, StreamingContext context)
		{
			header = info.GetString("Header");
			name = info.GetString("Name");
			header_alignment = (HorizontalAlignment)info.GetInt32("HeaderAlignment");
			tag = info.GetValue("Tag", typeof(object));

			int count = info.GetInt32("ListViewItemCount");
			if (count > 0) {
				if(items == null)
				items = new ListView.ListViewItemCollection(list_view_owner);

				for (int i = 0; i < count; i++)
				{
					items.Add((ListViewItem)info.GetValue(string.Format("ListViewItem_{0}", i), typeof(ListViewItem)));
				}
			}
		}
Beispiel #28
0
        public SIBuilderInfo()
        {
            this.ProjectName = "";
            this.Projects = null;
            this.OutputDir = "";
            this.LogDir = "";
            this.PackageScript = "";
            this.PackageOutputFile = "";
            this.DevenvLocation = "";
            this.majorVersion = 0;
            this.minorVersion = 0;
            this.buildNumber = 0;

            this.LogOutputStream = null;
        }
 private ListView.ListViewItemCollection getListViewItems(ListView lstview)
 {
     ListView.ListViewItemCollection temp = new ListView.ListViewItemCollection(new ListView());
     if (!lstview.InvokeRequired)
     {
         MessageBox.Show("yolo");
         foreach (ListViewItem item in lstview.Items)
             temp.Add((ListViewItem)item.Clone());
         return temp;
     }
     else
         return (ListView.ListViewItemCollection)this.Invoke(new GetItems(getListViewItems), new object[] { lstview });
 }
 public FindListForm(ListView.ListViewItemCollection items, string searchedWord)
 {
     InitializeComponent();
     noticeListItems = items;
     this.searchedWord = searchedWord;
 }
Beispiel #31
0
 public void CloseSession(string Name)
 {
     ListView.ListViewItemCollection items = new ListView.ListViewItemCollection(new ListView());
 }
        private void buttonLoadFromArchive_Click(object sender, EventArgs e)
        {
            var form1 = new Form()
                            {
                                RightToLeft = RightToLeft.Yes,
                                RightToLeftLayout = true,
                                Height = 500,
                                Width = 700,
                                Name = String.Format(comboBox1.SelectedText + "רשימת תמונות מקטגוריה")
            };
            var listView = new ListView
            {
                View = View.Details,
                GridLines = true,
                FullRowSelect = true,
                CheckBoxes = false,
                AllowColumnReorder = true,
                LabelEdit = false,
                RightToLeftLayout = true,
                MultiSelect = false,
                Dock = DockStyle.Fill,
                Visible = true
            };

            listView.DoubleClick += SelectPhotoDoubleClick;

            listView.Columns.Add("מספר", 50, HorizontalAlignment.Center);
            listView.Columns.Add("שם התמונה", 650, HorizontalAlignment.Center);
            //listView.Columns.Add("שם הווידאו", 600, HorizontalAlignment.Center);

            var itemCollection = new ListView.ListViewItemCollection(listView);

            var photos = from c in Lookup.Db.Table_OriginalPhotosArchives
                         select c;
            foreach (Table_OriginalPhotosArchive photo in photos)
            {
                var item = new ListViewItem();
                item.SubItems.Add(photo.PhotoId.ToString());
                item.SubItems.Add(photo.Caption);
                itemCollection.Add(item);
            }
            
            form1.Controls.Add(listView);
            listView.Refresh();

            form1.Show();

        }