void server_ReceivedRequest(Server.Request r) { if (this.listBox1.InvokeRequired) { AddItemDelegate d = new AddItemDelegate(add); this.Invoke(d, new object[] { r.Code }); } }
/// <summary> /// Główna funkcja inicjująca listView. /// </summary> /// <param name="columnList">Tablica określająca kolumny listView.</param> /// <param name="className">Nazwa listy.</param> public static void AddItem(ListView listView, string[] item) { if (listView.InvokeRequired) { AddItemDelegate del = new AddItemDelegate(AddItem); listView.Invoke(del, listView, item); return; } listView.Items.Add(ConvertToItem(item)); }
public IPList(Console console) { InitializeComponent(); _clear = new ClearListDelegate(OnClearListView); _add = new AddItemDelegate(OnAddListViewItem); _console = console; _udpClientEP = new IPEndPoint(IPAddress.Any, 12042); _udpClient = new UdpClient(_udpClientEP); _udpClient.BeginReceive(new AsyncCallback(onLDBHostReply), _udpClient); }
public void AddItem(ListViewItem lvi) { if (listView1.InvokeRequired) { AddItemDelegate d = AddItem; listView1.Invoke(d, lvi); } else { listView1.Items.Add(lvi); } }
public frmMain() { InitializeComponent(); lbResultAddItem = new AddItemDelegate(lbResults.Items.Add); hk = new HotKey(); hk.OwnerForm = this; hk.HotKeyPressed += new HotKey.HotKeyPressedEventHandler(hk_HotKeyPressed); hk.AddHotKey(Keys.Space, HotKey.MODKEY.MOD_CONTROL, "FoxEEEControl_ShowForm"); bool firstRun = !SQLiteHandler.DBExists(); SQLiteHandler.Open(); masterHandler = new MasterHandler(); masterHandler.Initialize(firstRun); }
private void AddItem(ListBox listbox, string text) { if (listbox.InvokeRequired) { AddItemDelegate d = AddItem; listbox.Invoke(d, new object[] { listbox, text }); } else { listbox.Items.Add(text); listbox.SelectedIndex = listbox.Items.Count - 1; listbox.ClearSelected(); } }
public frmBookMngt(User user) : base(user) { InitializeComponent(); _db = new BookStoreDB(); _user = user; // init services var authorService = new AuthorService(_db); var categoryService = new CategoryService(_db); _bookService = new BookService(_db); _addUpdateItemCallback = new AddItemDelegate(AddUpdateItemCallbackFn); // create empty value var emptyAuthor = new Author(); emptyAuthor.Id = 0; emptyAuthor.Title = "-- All Authors--"; // get list from service var authorDataSource = authorService.List().ToList(); authorDataSource.Add(emptyAuthor); authorDataSource = authorDataSource.OrderBy(t => t.Title).ToList(); // bind to datasource cbxAuthor.DataSource = authorDataSource; cbxAuthor.DisplayMember = "Title"; cbxAuthor.ValueMember = "Id"; cbxAuthor.SelectedValue = 0; // create empty value var emptyCategory = new Category(); emptyCategory.Id = 0; emptyCategory.Title = "--All Categories--"; // get list from service var categoryDataSource = categoryService.List().ToList(); categoryDataSource.Add(emptyCategory); categoryDataSource = categoryDataSource.OrderBy(t => t.Title).ToList(); // bind to datasource cbxCategory.DataSource = categoryDataSource; cbxCategory.DisplayMember = "Title"; cbxCategory.ValueMember = "Id"; cbxCategory.SelectedValue = 0; SearchBook(); }
/// <summary> /// Public constructor for direct use of this class. /// </summary> /// <param name="compareItemsCallback">Delegate for comparing identity of items in the source and destination collections.</param> /// <param name="addItemCallback">Delegate for adding items to the destination collection.</param> /// <param name="updateItemCallback">Delegate for updating items in the destination collection, or null if items should not be updated.</param> /// <param name="removeCallback">Delegate for removing items from the destination collection, or null if items should not be removed.</param> public CollectionSynchronizeHelper( CompareItemsDelegate compareItemsCallback, AddItemDelegate addItemCallback, UpdateItemDelegate updateItemCallback, RemoveItemDelegate removeCallback) { _compareItemsCallback = compareItemsCallback; _addItemCallback = addItemCallback; _updateItemCallback = updateItemCallback; _removeItemCallback = removeCallback; _allowUpdate = _updateItemCallback != null; _allowRemove = _removeItemCallback != null; }
private void AddItem(AddItemDelegate fn, string itemHtml) { if (ItemStack.Count == NumberOfItemsToDisplay) { return; } else if (!(bool)fn.DynamicInvoke()) { return; } else { ItemStack.Push(itemHtml); } }
public void Display(object sender, List <FileInfo> files) { foreach (var file in files) { string[] columns = { file.Name, file.FullName, (file.Length / 1024).ToString() + "байт", file.CreationTime.ToString() }; //var item = new System.Windows.Forms.ListViewItem(columns); var item = new ListViewItem(columns, index++); AddItemDelegate additem = new AddItemDelegate(_searchview.SearchResult.Items.Add); _searchview.SearchResult.Invoke(additem, item); AddIconDelegate addicon = new AddIconDelegate(_searchview.IconsAssociated.Images.Add); _searchview.SearchResult.Invoke(addicon, Icon.ExtractAssociatedIcon(file.FullName)); //_searchview.GetMethod() //_searchview.addSearchResult.Invoke(add, item); } }
public void Display(object sender, List<FileInfo> files) { foreach (var file in files) { string[] columns = { file.Name, file.FullName, (file.Length / 1024).ToString() + "байт", file.CreationTime.ToString() }; //var item = new System.Windows.Forms.ListViewItem(columns); var item = new ListViewItem(columns, index++); AddItemDelegate additem = new AddItemDelegate(_searchview.SearchResult.Items.Add); _searchview.SearchResult.Invoke(additem, item); AddIconDelegate addicon = new AddIconDelegate(_searchview.IconsAssociated.Images.Add); _searchview.SearchResult.Invoke(addicon, Icon.ExtractAssociatedIcon(file.FullName)); //_searchview.GetMethod() //_searchview.addSearchResult.Invoke(add, item); } }
public void AddItem(IClient client) { if (InvokeRequired) { AddItemDelegate d = new AddItemDelegate(AddItem); BeginInvoke(d, client); } else { if (!dataSource.Contains(client)) dataSource.Add(client); DataGridViewRow r = new DataGridViewRow(); Rows.Add(client.Connected ? Properties.Resources.on : Properties.Resources.off , client.Name, Program.Client.Notification[client.ID] != null ? Properties.Resources.notification : null); } }
public void AddItem(IClient client) { if (InvokeRequired) { AddItemDelegate d = new AddItemDelegate(AddItem); BeginInvoke(d, client); } else { if (!dataSource.Contains(client)) { dataSource.Add(client); } DataGridViewRow r = new DataGridViewRow(); Rows.Add(client.Connected ? Properties.Resources.on : Properties.Resources.off , client.Name, Program.Client.Notification[client.ID] != null ? Properties.Resources.notification : null); } }
private void _model_Found(System.Collections.Generic.List<FileInfo> foundfiles) { foreach (var file in foundfiles) { string[] columns = { file.Name, file.FullName, (file.Length / 1024).ToString(), file.CreationTime.ToString() }; var item = new ListViewItem(columns, index++); if (_view.SearchResults.InvokeRequired) { AddItemDelegate additem = new AddItemDelegate(_view.SearchResults.Items.Add); _view.SearchResults.Invoke(additem, item); AddIconDelegate addicon = new AddIconDelegate(_view.IconsSmall.Images.Add); _view.SearchResults.Invoke(addicon, Icon.ExtractAssociatedIcon(file.FullName)); addicon = new AddIconDelegate(_view.IconsLarge.Images.Add); _view.SearchResults.Invoke(addicon, Icon.ExtractAssociatedIcon(file.FullName)); } else { _view.SearchResults.Items.Add(item); _view.IconsSmall.Images.Add(Icon.ExtractAssociatedIcon(file.FullName)); _view.IconsLarge.Images.Add(Icon.ExtractAssociatedIcon(file.FullName)); } } }
public BookItem(Book book, User user, AddItemDelegate adddUpdateItemCallback) { InitializeComponent(); _user = user; _book = book; AddUpdateItemCallback = adddUpdateItemCallback; lblTitle.Text = book.Title; lblPublisher.Text = book.Publisher; lblYear.Text = book.Year.ToString(); lblAuthor.Text = book.Author.Title; lblDescription.Text = book.Description; toolTip1.SetToolTip(lblTitle, book.Title); toolTip1.SetToolTip(lblPublisher, book.Publisher); toolTip1.SetToolTip(lblYear, book.Year.ToString()); toolTip1.SetToolTip(lblDescription, book.Description); picCover.SizeMode = PictureBoxSizeMode.StretchImage; if (!string.IsNullOrEmpty(book.Cover)) { picCover.Image = Image.FromFile(Path.GetDirectoryName(Path.GetDirectoryName(Directory.GetCurrentDirectory())) + book.Cover); } }
public void AddItem(string File, string Name) { AddItemDelegate addItemDelegate = new AddItemDelegate(AddItemFct); _treeTask.Invoke(addItemDelegate,new object[] {File,Name}); }
public Service(ListBox listBox) { this.listBox = listBox; addItemDelegate = new AddItemDelegate(AddItem); }
public void AddItemScheduledQueue(string File, string Name) { AddItemDelegate addItemDelegate = new AddItemDelegate(AddItemScheduledQueueFct); tvScheduledQueue.Invoke(addItemDelegate, new object[] { File, Name }); }
public void AddItem(string File, string Name) { AddItemDelegate addItemDelegate = new AddItemDelegate(AddItemFct); _treeTask.Invoke(addItemDelegate, new object[] { File, Name }); }
public DebugForm() { InitializeComponent(); InvokeDelegate = new AddItemDelegate(AddItem); listView1.View = View.Details; }
public void AddItemScheduledQueue(string File, string Name) { AddItemDelegate addItemDelegate = new AddItemDelegate(AddItemScheduledQueueFct); tvScheduledQueue.Invoke(addItemDelegate,new object[] {File,Name}); }
public Service(ListBox listbox) { this.listbox = listbox; addItemDelegate = new AddItemDelegate(AddItem); }
public MemberCollection(AddItemDelegate addItem) { _addItem = addItem; }