C# (CSharp) System.Windows.Forms ListViewItem примеры использования

C# (CSharp) System.Windows.Forms ListViewItem - 30 примеров найдено. Это лучшие примеры C# (CSharp) кода для System.Windows.Forms.ListViewItem, полученные из open source проектов. Вы можете ставить оценку каждому примеру, чтобы помочь нам улучшить качество примеров.
Пример #1
0
        public override void Prepare()
        {
            this.titleLabel.Text = Resources.CreateVotingTitle;
              this.descriptionLabel.Text = Resources.CreateVotingDescription;
              this.urlLabel.Text = Resources.CreateVotingUrl;
              this.clearButton.Text = Resources.CreateVotingClearButton;
              this.questionLabel.Text = Resources.CreateVotingQuestions;
              this.textColumnHeader.Text = Resources.CreateVotingQuestionText;
              this.descriptionColumnHeader.Text = Resources.CreateVotingQuestionDescription;
              this.nextButton.Text = GuiResources.ButtonNext;
              this.cancelButton.Text = GuiResources.ButtonCancel;

              Status.Data = VotingData.TryLoad(Status.Controller.Status.DataPath);

              if (Status.Data != null)
              {
            this.titleBox.Text = Status.Data.Title;
            this.descriptionBox.Text = Status.Data.Descrption;
            this.urlTextBox.Text = Status.Data.Url;

            foreach (var question in Status.Data.Questions)
            {
              ListViewItem item = new ListViewItem(question.Text.AllLanguages);
              item.SubItems.Add(question.Description.AllLanguages);
              item.Tag = question;
              this.questionListView.Items.Add(item);
            }
              }

              CheckEnable();
        }
Пример #2
0
        private void RebuildGroupings()
        {
            lvwGroupings.BeginUpdate();
            try
            {
                lvwGroupings.Items.Clear();
                int totalCount = _dupeSet.Count();
                int currentFile = 1;
                foreach (IGrouping<string, ChecksumFile> group in _dupeSet)
                {
                    int groupCount = group.Where(p => p.IsDeleted == false).Count();
                    if (groupCount > 1)
                    {
                        ListViewItem item = new ListViewItem();
                        item.Text = string.Format("{0:#,0} / {1:#,0}", currentFile, totalCount);
                        item.SubItems.Add(groupCount.ToString());
                        item.Tag = group;
                        lvwGroupings.Items.Add(item);
                    }

                    currentFile++;
                }

                if (lvwGroupings.Items.Count > 0)
                    lvwGroupings.SelectedIndices.Add(0);
            }
            finally
            {
                lvwGroupings.EndUpdate();
            }
        }
Пример #3
0
 void bindPiclist()
 {
     this.picList.Clear();
     this.imageList1.Images.Clear();
     string[] fileArr = imgSearch.getPicFiles(videoList.FocusedItem.Text, this.comboBox1.Text, true);//得到图片路径
     if (fileArr.Length == 0)
     {
         MessageBox.Show("没有符合的图片", "警告");
         return;
     }
     for (int i = 0; i < fileArr.Length; ++i)
     {
         this.imageList1.Images.Add(Image.FromFile(fileArr[i]));
         string text = System.IO.Path.GetFileName(fileArr[i]);
         ListViewItem item = new ListViewItem()
         {
             Tag = fileArr[i].ToString(),
             Text = text,
             ImageIndex = i
         };
         this.picList.Items.Add(item);
     }
     this.picList.Scrollable = true;
     this.picList.MultiSelect = false;
     this.picList.View = View.LargeIcon;
     this.picList.LargeImageList = imageList1;
 }
Пример #4
0
        public void doNeighborListUpdate(Node.NodeList neighborList)
        {
            Debug.WriteLine("doNeighborListUpdate");

                        lock (neighborListLock)
                        {
                                neighborListView.Items.Clear();

                                neighborListView.BeginUpdate();

                                Debug.WriteLine("Looping through neighbors");
                                foreach (Haggle.Node neighbor in neighborList.AsArray())
                                {
                                        string ifaceStr = "";
                                        Debug.WriteLine("Adding neighbor " + neighbor.GetName());
                                        ListViewItem neighItem = new ListViewItem(neighbor.GetName());
                                        foreach (Node.Interface iface in neighbor.InterfacesArray())
                                        {
                                                ifaceStr += iface.GetIdentifierStr() + ",";
                                        }

                                        char[] tc = { ',' };
                                        neighItem.SubItems.Add(ifaceStr.TrimEnd(tc));
                                        neighborListView.Items.Add(neighItem);

                                }
                                neighborListView.EndUpdate();
                                Debug.WriteLine("Neighborlist update end");
                        }
        }
Пример #5
0
        public void LoadCategoryRecords(TreeNode CategoryNode)
        {
            if (CategoryNode.Tag == null) return;

            DataRow category_row = (DataRow)CategoryNode.Tag;
            DataRow[] child_rows = category_row.GetChildRows(_ds.Relations[1]);

            foreach (DataRow row in child_rows)
            {
                //only one telegram per record
                DataRow data = row.GetChildRows(_ds.Relations[0])[0];

                ListViewItem item = new ListViewItem();
                item.Tag = row;

                item.ImageIndex = 2;
                //phrase
                item.Text = row["Phrase"].ToString();;

                //item.SubItems.Add("0x" + ((byte)data["MessageControl"]).ToString("X"));
                //item.SubItems.Add(data["SourceAddress"].ToString());
                item.SubItems.Add(data["DestinationAddress"].ToString());
                item.SubItems.Add("0x" + ((byte)data["TCPI"]).ToString("X"));
                item.SubItems.Add("0x" + ((byte)data["APCI"]).ToString("X"));

                this.lvRecords.Items.Add(item);
            }
        }
Пример #6
0
	void Populate ()
	{			
		var availableEncodings = new Dictionary<string,TextEncoding> ();
		foreach (var encoding in TextEncoding.SupportedEncodings)
			availableEncodings [encoding.Id] = encoding;
		
		var shownEncodings = TextEncoding.ConversionEncodings;
		
		shownListView.BeginUpdate ();
		foreach (var encoding in shownEncodings) {
			var item = new ListViewItem (new string [] { encoding.Id, encoding.Name }) {
				Tag = encoding
			};
			shownListView.Items.Add (item);
			
			// Don't show on the available list the encodings
			// that are already being shown
			availableEncodings.Remove (encoding.Id);
		}
		shownListView.AutoResizeColumns (ColumnHeaderAutoResizeStyle.HeaderSize);
		shownListView.EndUpdate ();
		
		availableListView.BeginUpdate ();
		foreach (var encoding in availableEncodings) {
			var item = new ListViewItem (new string [] { encoding.Value.Id, encoding.Value.Name }) {
				Tag = encoding.Value
			};
			availableListView.Items.Add (item);
		}
		availableListView.AutoResizeColumns (ColumnHeaderAutoResizeStyle.HeaderSize);
		availableListView.EndUpdate ();
	}
Пример #7
0
		private void LoadItemsFromRegistry()
		{
			ArrayList items = new ArrayList();
			using(RegistryKey key = Registry.CurrentUser.CreateSubKey(registryLocation))
			{
				string[] favourites = key.GetSubKeyNames();
				foreach(string favourite in favourites)
				{
					using(RegistryKey subkey = key.OpenSubKey(favourite))
					{
                        Proxy.NavigatorRef.Item navItem = new Workshare.Connect.SharePoint.Proxy.NavigatorRef.Item();
                        navItem.Title = ( string )subkey.GetValue( "name" );
                        navItem.Url = ( string )subkey.GetValue( "url" );
                        navItem.Kind = GetKind( ( string )subkey.GetValue( "kind" ) );

                        ListViewItem item = new ListViewItem( navItem.Title );
                        item.SubItems.Add( navItem.Url );
                        item.SubItems.Add( navItem.Kind.ToString() );
						item.ImageIndex = (int)subkey.GetValue("image");
                        item.Tag = navItem;

						items.Add(item);
					}
				}
			}
			InnerList.Clear();
			InnerList.AddRange(items);
		}
Пример #8
0
		private void InstalledModules_Load(object sender, EventArgs e)
		{
			Cursor = Cursors.WaitCursor;
			try {
				string[] moduleTypes = ApplicationServices.GetTypesOfModules().OrderBy(x => x).ToArray();
				foreach (string moduleType in moduleTypes) {
					ListViewGroup group = listViewModules.Groups.Add(moduleType, moduleType);
					IModuleDescriptor[] descriptors = ApplicationServices.GetModuleDescriptors(moduleType);
					foreach (IModuleDescriptor descriptor in descriptors) {
						ListViewItem item =
							new ListViewItem(new[]
							                 	{
							                 		descriptor.TypeName, _GetModuleDescription(descriptor), _GetModuleAuthor(descriptor),
							                 		_GetModuleVersion(descriptor), descriptor.FileName
							                 	});
						item.Tag = descriptor;
						item.Group = group;
						listViewModules.Items.Add(item);
					}
				}

				listViewModules.ColumnAutoSize();
			}
			catch (Exception ex) {
				MessageBox.Show(ex.Message);
			}
			finally {
				Cursor = Cursors.Default;
			}
		}
Пример #9
0
    private void LoadLanguages()
    {
      _loaded = true;
      mpListView2.BeginUpdate();
      try
      {
        mpListView2.Items.Clear();
        List<KeyValuePair<String, String>> languages = TvLibrary.Epg.Languages.Instance.GetLanguagePairs();

        TvBusinessLayer layer = new TvBusinessLayer();
        Setting setting = layer.GetSetting(languagesSettingsKey);
        foreach (KeyValuePair<String, String> language in languages)
        {
          ListViewItem item = new ListViewItem(new string[] { language.Value, language.Key });
          mpListView2.Items.Add(item);
          item.Tag = language.Key;
          item.Checked = setting.Value.IndexOf((string)item.Tag) >= 0;
        }
        mpListView2.Sort();

      }
      finally
      {
        mpListView2.EndUpdate();
      }
    }
Пример #10
0
        // --- Popunjavanje listView podacima iz baze ---
        private void FBrisanje_Radnika_Shown(object sender, EventArgs e)
        {
            try
            {
                IList<Radnik> listaRadnika = new List<Radnik>();

               listaRadnika = client.Cypher
               .Match("(radnik:Radnik)")
               .Return(radnik => radnik.As<Radnik>())
               .Results.ToList();

               foreach (Radnik r in listaRadnika)
               {
                   ListViewItem lv1 = new ListViewItem(r.id);
                   lv1.SubItems.Add(r.Ime);
                   lv1.SubItems.Add(r.Prezime);
                   lv1.SubItems.Add(r.Adresa);
                   lv1.SubItems.Add(r.Datum_Rodjenja);
                   lv1.SubItems.Add(r.Obrazovanje);
                   lv1.SubItems.Add(r.Iskustvo);                  

                   LvSpisakRadnika.Items.Add(lv1);
               }

               LvSpisakRadnika.Enabled = true;
                
            }
            catch (Exception ec)
            {
                MessageBox.Show(ec.ToString());
            }
        }
Пример #11
0
        //-----------------------------------------------------------------------------------------------------------------------------
        private void DeepSearchSongs(DirectoryInfo root)
        {
            foreach(var musicFile in root.GetFiles())
            {
                if (supportedFormats.Contains("*" + Path.GetExtension(musicFile.Name)))
                {
                    var newItem = new ListViewItem();
                    var tagFile = TagLib.File.Create(musicFile.FullName);

                    if(tagFile.Tag.Performers.Count() > 0)
                        newItem.SubItems.Add(tagFile.Tag.Performers[0]);
                    newItem.SubItems.Add(tagFile.Tag.Track.ToString());
                    newItem.SubItems.Add(musicFile.Name);
                    newItem.SubItems.Add(tagFile.Tag.Album);
                    newItem.SubItems.Add(tagFile.Tag.Year.ToString());
                    newItem.SubItems.Add(tagFile.Properties.Duration.ToString(@"mm\:ss"));

                    newItem.Tag = musicFile.FullName;
                    songListView.Items.Add(newItem);
                    //songListView.Items.Add(newItem);
                }
            }

            foreach(DirectoryInfo directory in root.GetDirectories())
            {
                DeepSearchSongs(directory);
            }
        }
        public void LoadBook(string name,string searchType)
        {
            resultListView.Items.Clear();
            List<Book> books;
            try
            {
                books = bookManager.GetAllBook(name, searchType);
                if (books.Count > 0)
                {
                    foreach (Book book in books)
                    {
                        ListViewItem aItem = new ListViewItem(book.Id.ToString());
                        aItem.Tag = (Book)book;
                        aItem.SubItems.Add(book.Title);
                        aItem.SubItems.Add(book.AuthorName);
                        aItem.SubItems.Add(book.InitialCopy.ToString());
                        aItem.SubItems.Add(book.OutsideCopy.ToString());
                        aItem.SubItems.Add(book.Price.ToString());
                        resultListView.Items.Add(aItem);
                    }

                }
            }
            catch (Exception exception)
            {

                MessageBox.Show(exception.Message, @"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #13
0
        public void LoadOnListView(ListView lv)
        {
            Leave s = new Leave();
            DataTable dt = new DataTable();

            dt = s.SELECT_ALL();
            if (dt != null)
            {
                int ctr = 1;
                foreach (DataRow r in dt.Rows)
                {
                    ListViewItem li = new ListViewItem();
                    li.Text = ctr.ToString();
                    li.SubItems.Add(r["fullname"].ToString());
                    li.SubItems.Add(r["leavetype"].ToString());
                    li.SubItems.Add(r["leavedate"].ToString());
                    li.SubItems.Add(r["noofdays"].ToString());
                    li.SubItems.Add(r["datefiled"].ToString());

                    lv.Items.Add(li);

                    ctr++;
                }
            }
        }
Пример #14
0
        public Form1(Dictionary<string, byte[]> dicomMap)
        {
            InitializeComponent();
            //Set dictionary for tags
            myDict = myDicomDic.getDic();

            //Set 'map' for the data of the dicom file
            myMap = dicomMap;

            //Set necessary informations
            rows = BitConverter.ToInt16(myMap["00280010"], 0);
            columns = BitConverter.ToInt16(myMap["00280011"], 0);
            pixelData = myMap["7FE00010"];

            //Get all keys and theyr associated values
            foreach (string id in dicomMap.Keys)
            {
                ListViewItem item;
                byte[] value = myMap[id];

                //Check if the given id is key of the given dictonary then use the found string, otherwise use the raw id
                if (myDict.ContainsKey(id))
                {
                    item = new ListViewItem(myDict[id]);
                } else
                {
                    item = new ListViewItem(id);
                }

                item.SubItems.Add(Encoding.Default.GetString(value));
                listView1.Items.Add(item);
            }

            pictureBox1.Image = myService.createPicture(rows, columns, pixelData, trackBarC.Value, trackBarW.Value);
        }
Пример #15
0
        private void displayAlertList()
        {
            //Clear List
            alertListView.Items.Clear();

            List<Alert> alerts = new List<Alert>();
            EventEntity eve = new EventEntity();
            ActiveUser au = new ActiveUser(currentUser);
            alerts = au.getListOfAlerts();
            int currentEventID;

            if (alerts.Count != 0)
            {
                for (int i = 0; i < alerts.Count; i++)
                {
                    ListViewItem newAlert = new ListViewItem((i + 1).ToString());
                    newAlert.SubItems.Add(alerts[i].getAlertedEventName()); // Name of Event
                    newAlert.SubItems.Add(alerts[i].getAlert()); // Alert String
                    alertListView.Items.Add(newAlert);

                    // Clear Alert Flag
                    currentEventID = eve.getEventIDFromEventName(alerts[i].getAlertedEventName());
                    eve.clearEventUpdatedFlag(currentEventID);
                    eve.clearEventFullFlag(currentEventID);
                    eve.clearEventStartFlag(currentEventID);
                }
            }

            alerts.Clear(); // Erase off OLD alerts
            alertListView.Show();
        }
Пример #16
0
 private void listView1_DragDrop(object sender, DragEventArgs e)
 {
     ListViewItem lvi = new ListViewItem();
     lvi.Text = (String)e.Data.GetData(DataFormats.Text);
     lvi.SubItems.Add("pepe");
     listView1.Items.Add(lvi);
 }
	private void UpdateListView()
	{
		if (InvokeRequired)
		{
			Invoke((MethodInvoker) UpdateListView);
		}
		else
		{
			slvPlugins.Items.Clear();
			foreach (KeyValuePair<string, InstalledPlugin> pair in InstalledPluginManager.Plugins)
			{
				// TODO: correct text
				string[] text =
				{
					pair.Value.Name, pair.Value.Description, StringUtil.ListToCsv(pair.Value.Authors),
					pair.Value.Version, "",
					pair.Value.FileCreationDate.ToShortDateString()
				};
				try
				{
					if (!string.IsNullOrEmpty(pair.Value.Mainspace))
						text[4] = pair.Value.BukgetEquivalentPlugin.LastVersionNumber;
				}
				catch (Exception e)
				{
					Logger.Log(LogLevel.Warning, "InstalledPlugins", "Couldn't get latest version for plugin " + pair.Value.Mainspace,
						e.Message);
				}
				ListViewItem lvi = new ListViewItem(text) {Tag = pair.Value};
				slvPlugins.Items.Add(lvi);
			}
		}
	}
Пример #18
0
 private void btnLuu_Click(object sender, EventArgs e)
 {
     if (kiemtraThongBao_GUI() == true)
     {
         ThongBao thongbao = layThongBao_Tu_GUI();
         thongbao_BUS.taoThongBao_BUS(thongbao);
         tbxTenThongBao.Text = "";
         tbxNoiDungThongBao.Text = "";
         lvThongBao.Items.Clear();
         ThongBao[] dsThongBao = thongbao_BUS.layTatCaThongBao_BUS();
         for (int i = 0; i < dsThongBao.Length; i++)
         {
             ListViewItem ma = new ListViewItem(dsThongBao[i].MaThongBao.ToString());
             ListViewItem.ListViewSubItem ten = new ListViewItem.ListViewSubItem(ma, dsThongBao[i].TenThongBao);
             ListViewItem.ListViewSubItem noidung = new ListViewItem.ListViewSubItem(ma, dsThongBao[i].NoiDungThongBao);
             ListViewItem.ListViewSubItem ngay = new ListViewItem.ListViewSubItem(ma, dsThongBao[i].NgayThongBao.ToShortDateString());
             ma.SubItems.Add(ten);
             ma.SubItems.Add(noidung);
             ma.SubItems.Add(ngay);
             lvThongBao.Items.Add(ma);
         }
     }
     else
     {
         MessageBox.Show("Nhập thiếu thông tin! Vui lòng nhập lại ");
     }
 }
Пример #19
0
        public void AddChanel(string[] array)
        {
            if (this.listView1.InvokeRequired)
            {
                this.listView1.Invoke(new MyDelegate(AddChanel), new object[] { array });
            }
            else
            {
                ListViewItem lvi = new ListViewItem(array[0]);
                lvi.SubItems.Add(array[1]);
                lvi.SubItems.Add(array[2]);
                lvi.SubItems.Add(array[3]);
                lvi.SubItems.Add(array[4]);
                lvi.SubItems.Add(array[5]);
                lvi.SubItems.Add(array[6]);
                lvi.SubItems.Add(array[7]);
                lvi.SubItems.Add(array[8]);
                this.listView1.Items.Add(lvi);
            }

            if (localsaveloc == string.Empty)
            {
                saveChannels_Click(null, null);
            }
            else
            {
                SaveList(listView1, localsaveloc);
            }
        }
Пример #20
0
        public void UpdateChangesDialog(List<KeyValuePair<GUIMod, GUIModChangeType>> changeset, BackgroundWorker installWorker)
        {
            m_Changeset = changeset;
            m_InstallWorker = installWorker;
            ChangesListView.Items.Clear();

            if (changeset == null)
            {
                return;
            }

            foreach (var change in changeset)
            {
                if (change.Value == GUIModChangeType.None)
                {
                    continue;
                }

                var item = new ListViewItem {Text = String.Format("{0} {1}", change.Key.Name, change.Key.Version)};

                var sub_change_type = new ListViewItem.ListViewSubItem {Text = change.Value.ToString()};

                item.SubItems.Add(sub_change_type);
                ChangesListView.Items.Add(item);
            }
        }
Пример #21
0
        // ---- popunjavanje listview imenima drzava, i za svaku se upisuje broj pobeda -----
        private void BtnAddCntry_Click(object sender, EventArgs e)
        {
            // provera da li postoji vec drzava sa imenom u LV.
            if(!String.IsNullOrWhiteSpace(TbCntryName.Text))
            {
                
                bool postoji = false;

                string imeDrzave = TbCntryName.Text;

                foreach(ListViewItem Item in LvStatistics.Items)
                {
                    //ako postoji samo se oznacava da vec postoji
                    if(Item.Text == imeDrzave)
                    {
                        postoji = true;
                    }
                }
                // --- popunjavanje lv-a!
                if(!postoji)
                {
                    ListViewItem lv1 = new ListViewItem(imeDrzave);
                    LvStatistics.Items.Add(lv1);
                }
                else
                {
                    MessageBox.Show("Za izabranu drzavu"+ imeDrzave +" vec postoji statistika!!");
                }
            }
            else
            {
                MessageBox.Show("Unesite ime drzave i koliko puta je pobedila!!");
            }
        }
        private void UpdatePrivileges()
        {
            listViewPrivs.Items.Clear();
            foreach (TokenPrivilege priv in _token.Privileges)
            {
                ListViewItem item = new ListViewItem(priv.Name);
                bool enabled = false;
                string flags = "Disabled";

                if ((priv.Attributes & PrivilegeAttributes.Enabled) == PrivilegeAttributes.Enabled)
                {
                    enabled = true;
                    flags = "Enabled";
                }

                if ((priv.Attributes & PrivilegeAttributes.EnabledByDefault) == PrivilegeAttributes.EnabledByDefault)
                {
                    flags = "Default " + flags;
                }

                item.SubItems.Add(flags);
                item.SubItems.Add(priv.DisplayName);

                item.BackColor = enabled ? Color.LightGreen : Color.LightPink;
                item.Tag = priv;

                listViewPrivs.Items.Add(item);
            }
        }
Пример #23
0
 public NewModelForm(string fileName)
     : this()
 {
     try
     {
         var instance = AddinAppData.Instance;
         var typeList = ReflectionHelper.GetCreatableObjectImplementsInterface(typeof(IGenerator), instance.ExtensionDirectory);
         if (typeList.Length < 1)
             throw new Exception("There are not asseblies that have a creatable type that implements IGenerator");
         else if (typeList.Length == 1)
         {
             SetFileContent(typeList[0]);
         }
         else
         {
             foreach (var type in typeList)
             {
                 var att = (GeneratorAttribute)ReflectionHelper.GetSingleAttribute(typeof(GeneratorAttribute), type);
                 var currentItem = new ListViewItem(att.ModelName);
                 currentItem.Tag = type;
                 lvModelTypes.Items.Add(currentItem);
             }
         }
         SetVisualState();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
Пример #24
0
    public void OnNewDocument()
    {
      this.process = this.mainForm.Process;

      PdfObject[] objects = this.process.Document.Internals.GetAllObjects();
      this.lvObjects.Items.Clear();
      for (int idx = 0; idx < objects.Length; idx++)
      {
        PdfObject obj = objects[idx];
        ListViewItem item = new ListViewItem(new string[2]{PdfInternals.GetObjectID(obj).ToString(), ExplorerProcess.GetTypeName(obj)});
        item.Tag = obj;
        this.lvObjects.Items.Add(item);
      }

      PdfPages pages = this.process.Document.Pages;
      this.lvPages.Items.Clear();
      for (int idx = 0; idx < pages.Count; idx++)
      {
        PdfPage page = pages[idx];
        ListViewItem item = new ListViewItem(new string[2]{(idx + 1).ToString(), 
          ExplorerHelper.PageSize(page, this.mainForm.Process.IsMetric)});
          //String.Format("{0:0} x {1:0} mm", XUnit.FromPoint(page.Width).Millimeter,XUnit.FromPoint(page.Height).Millimeter)});
        item.Tag = page;
        this.lvPages.Items.Add(item);
      }

      this.process.Navigator.SetNext(this.process.Document.Info);
      ActivatePage("Info");
    }
        public void LoadAllZoneVisitorNumberListBox()
        {
            List<Zone> zoneList = zoneNumberManager.GetAllZoneVisitorNumberListBox();
            zoneVisitorNumberListView.Items.Clear();
            int totalVisitor = 0;
            foreach (var zones in zoneList)
            {
                zoneVisitorNumberId = zones.ZoneId;
                List<Visitor> visitorList = zoneDetailManager.GetAllZoneVisitorNumber(zoneVisitorNumberId);
                int zoneVisitor = 0;
                foreach (var visitor in visitorList)
                {
                    zoneVisitor++;
                }

                int totalZoneVisitor = zoneVisitor;

                ListViewItem listViewItem = new ListViewItem(zones.ZoneName);
                listViewItem.SubItems.Add(totalZoneVisitor.ToString());

                listViewItem.Tag = zones;

                zoneVisitorNumberListView.Items.Add(listViewItem);
                totalVisitor += totalZoneVisitor;
            }

            totalVisitorTextBox.Text = totalVisitor.ToString();
        }
Пример #26
0
        private void FillListView()
        {
            try
            {
                // clear all existing items
                listViewCardboardFormats.Items.Clear();

                Pic.DAL.SQLite.PPDataContext db = new Pic.DAL.SQLite.PPDataContext();
                Pic.DAL.SQLite.CardboardFormat[] cardboardFormats = Pic.DAL.SQLite.CardboardFormat.GetAll(db);
                foreach (Pic.DAL.SQLite.CardboardFormat format in cardboardFormats)
                {
                    ListViewItem item = new ListViewItem();
                    item.Text = format.Name;
                    item.SubItems.Add(format.Description);
                    item.SubItems.Add(string.Format("{0}", format.Length));
                    item.SubItems.Add(string.Format("{0}", format.Width));
                    listViewCardboardFormats.Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.Fail(ex.ToString());
                _log.Debug(ex.ToString());
            }
        }
Пример #27
0
 private void AddClipboardFormat(ClipboardFormat cf)
 {
     ListViewItem lvi = new ListViewItem(cf.Description ?? "");
     lvi.Tag = cf;
     lvi.SubItems.Add(cf.Format ?? "");
     lvClipboardFormats.Items.Add(lvi);
 }
Пример #28
0
        private void button5_Click(object sender, EventArgs e)
        {
            if (textBox6.Text == null)
            {
                MessageBox.Show("Имя сервера не может быть пустым");
                return;
            }

            ftp.Host = textBox6.Text;
            ftp.UserName = textBox4.Text;
            ftp.Password = textBox5.Text;
            FileStruct[] FileList = DirectoryList("");
            try
            {
                this.Text = "Подключение к ftp-серверу....";

                foreach (FileStruct s in FileList)
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text = s.Name;
                    lvi.SubItems.Add(s.CreateTime);
                    listView2.Items.Add(lvi);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            this.Text = "FTP-client";
        }
Пример #29
0
        public void LoadKeys(Locale loadFrom, string collectionKey)
        {
            _locale = _localeManager.Locales[_localeManager.CurrentLocale];

            if(_locale.StringCollections.ContainsKey(collectionKey) == false)
            {
                _locale.StringCollections.Add(collectionKey, new StringCollection(collectionKey));
            }
            _collection = _locale.StringCollections[collectionKey];
            txtNew.RightToLeft = _locale.RightToLeft ? RightToLeft.Yes : RightToLeft.No;

            var enumerable = loadFrom.StringCollections[collectionKey].StringsTable.Values;
            foreach (var key in enumerable)
            {
                if (key.AliasedKey)
                    continue;

                var item = new ListViewItem(key.Key);

                item.ImageKey = GetStatusIcon(collectionKey, key.Key);

                lstKeys.Items.Add(item);
            }

            colKey.AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);

            chkMinorUpdate.Visible = _parentLocale == null;
            chkDerived.Enabled = _parentLocale != null;
            chkUpToDate.Visible = _parentLocale != null;
            btnSetModified.Visible = _parentLocale == null;
        }
        /// <summary>
        /// Evenement qui se déclenche lors de l'appuie sur le bouton Search
        /// Va rechercher les tâches en fonction des informations entrées par l'utilisateur.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Search_Click(object sender, EventArgs e)
        {
            string search = SearchText.Text;
            DayActivities.Items.Clear();
            TaskFind.Clear();
            foreach (Day day in calendar.Calendar)
            {
                foreach (Task task in day.Tasks)
                {
                    if(Filter.SelectedIndex == 0)
                    {
                        if(task.Name == search)
                        {
                            ListViewItem itm = new ListViewItem(day.TaskInfo(task));
                            ListViewItem item = DayActivities.Items.Add(itm);
                            TaskFind.Add(task);
                        }
                    }
                    if (Filter.SelectedIndex == 1)
                    {
                        if(task.Description.Contains(search))
                        {
                            ListViewItem itm = new ListViewItem(day.TaskInfo(task));
                            ListViewItem item = DayActivities.Items.Add(itm);
                            TaskFind.Add(task);

                        }
                    }
                }

            }
        }