void DeleteUserTaskClicked(object obj, EventArgs e) { if (view.Selection.CountSelectedRows() > 0) { TreeIter iter; if (store.GetIter(out iter, view.Selection.GetSelectedRows()[0])) { Task task = (Task)store.GetValue(iter, (int)Columns.UserTask); updating = true; TaskService.UserTasks.Remove(task); updating = false; store.Remove(ref iter); TaskService.SaveUserTasks(task.WorkspaceObject); } } }
protected virtual void OnButton3Clicked(object sender, System.EventArgs e) { //Удаление выделенного элемента TreeIter iter; //TreePath p = new TreePath(); //p.AppendIndex(1); //liststore.GetIter(out iter,p); //Метод GetSelected получает объект TreeIter, представляющий //выбранный в TreeView элемент. Возвращает false, если //например ничего не выбрано. if (treeview1.Selection.GetSelected(out iter)) { liststore.Remove(ref iter); } }
protected virtual void OnButtonRemoveCategoryClicked(object sender, System.EventArgs e) { TreeIter iter; if (treeCategories.Selection.GetSelected(out iter)) { string cat = (string)storeCategs.GetValue(iter, 1); entry.Categories.Remove(cat); storeCategs.Remove(ref iter); if (!iter.Equals(TreeIter.Zero)) { treeCategories.Selection.SelectIter(iter); } NotifyChanged(); } }
void changeService_ComponentRemoved (object sender, ComponentEventArgs e) { //remove component from combobox list //need a variable external to foreach so we can pass by ref TreeIter iter; components.GetIterFirst (out iter); do { if ((IComponent) components.GetValue (iter, 1) == e.Component) { components.Remove (ref iter); break; } } while (components.IterNext (ref iter)); }
protected virtual void OnButtonRemovePlayersClicked(object sender, System.EventArgs e) { var selectedItems = iconViewPlayers.SelectedItems; foreach (var path in selectedItems) { TreeIter iter; playerStore.GetIter(out iter, path); lock (playerIds) { playerIds.Remove(Convert.ToString(playerStore.GetValue(iter, 0))); } playerStore.Remove(ref iter); } }
protected void OnButtonDeleteClicked(object sender, EventArgs e) { if (treeConnections.Selection.CountSelectedRows() != 1) { return; } TreeIter iter; treeConnections.Selection.GetSelected(out iter); sectionsToDelete.Add(((Connection)connectionsListStore.GetValue(iter, 1)).IniName); treeConnections.Selection.Changed -= HandleChanged; connectionsListStore.Remove(ref iter); treeConnections.Selection.Changed += HandleChanged; currentIter = TreeIter.Zero; connectionsListStore.GetIterFirst(out iter); treeConnections.Selection.SelectIter(iter); }
void DeleteUserTaskClicked(object obj, EventArgs e) { if (view.Selection.CountSelectedRows() > 0) { TreeIter iter; Gtk.TreePath path = sortModel.ConvertPathToChildPath(view.Selection.GetSelectedRows() [0]); if (store.GetIter(out iter, path)) { TaskListEntry task = (TaskListEntry)store.GetValue(iter, (int)Columns.UserTask); updating = true; TaskService.UserTasks.Remove(task); updating = false; store.Remove(ref iter); TaskService.SaveUserTasks(task.WorkspaceObject); } } }
private void OnRemovePendingSong(object o, EventArgs args) { TreeIter iter; TreeModel model; TreeSelection sel = songtv.Selection; if (sel.GetSelected(out model, out iter)) { int index = (int)model.GetValue(iter, 5); Hashtable song = (Hashtable)songs[index]; songls.Remove(ref iter); ThreadPool.QueueUserWorkItem( new WaitCallback(RemovePendingSongThread), song); } }
public void userUpdate(object sender, ChatUserEventArgs e) { if (e.UserEventType == ChatUserEvent.FriendLoggedIn) { String friendId = e.Data.ToString(); //adauga modificarea pe threadul care a creat aplicatia Application.Invoke(delegate { friendsStore.AppendValues(friendId); }); Console.WriteLine("[ChatWindow] friendLoggedIn " + friendId); } if (e.UserEventType == ChatUserEvent.FriendLoggedOut) { String friendId = e.Data.ToString(); Console.WriteLine("[ChatWindow] friendLoggedOut " + friendId); TreeIter it; bool result = friendsStore.GetIterFirst(out it); for (int i = 0; i < friendsStore.IterNChildren(); i++) { String value = (string)friendsStore.GetValue(it, 0); Console.WriteLine("In for, am obtinut {0}", value); if (value == friendId) { Console.WriteLine("Found friend {0}", value); break; } friendsStore.IterNext(ref it); } //adauga modificarea pe threadul care a creat aplicatia Application.Invoke(delegate { friendsStore.Remove(ref it); }); } if (e.UserEventType == ChatUserEvent.NewMessage) { String messString = e.Data.ToString(); //adauga modificarea pe threadul care a creat aplicatia Application.Invoke(delegate { messageStore.AppendValues(messString); }); Console.WriteLine("[ChatWindow] messString " + messString); } }
private void RemoveEqualizerSetting(EqualizerSetting eq) { TreeIter iter; if (GetIterForEqualizerSetting(eq, out iter)) { store.Remove(ref iter); } if (!ActivateFirstEqualizer()) { active_eq = null; if (Entry != null) { Entry.Text = String.Empty; } } }
public static void RemoveAt(ListStore model, int index) { if (!model.GetIterFirst(out TreeIter iter)) { return; } var i = 0; do { if (index == i) { model.Remove(ref iter); break; } i++; }while (model.IterNext(ref iter)); }
//TODO: what exactly commands will be useed with multyrow selection private void RemoveSelectedRows(TreeView treeView, ListStore listStore, TreeModelSort treeModelSort) { TreeModel model; TreeIter iter; TreePath[] treePath = treeView.Selection.GetSelectedRows(out model); for (int i = treePath.Length; i > 0; i--) { model.GetIter(out iter, treePath[(i - 1)]); string value = (string)model.GetValue(iter, 0); Console.WriteLine("Removing: " + value); TreeIter childIter = treeModelSort.ConvertIterToChildIter(iter); listStore.Remove(ref childIter); } }
private void WorkspaceDeleteRow(object o, KeyPressEventArgs args) { if (args.Event.Key != Gdk.Key.Delete) { return; } var rows = treeOperations.Selection.GetSelectedRows(); foreach (var row in rows.Reverse()) { TreeIter iter; if (listWorkspace.GetIter(out iter, row)) { listWorkspace.Remove(ref iter); } } }
protected virtual void removeFileAssocation(object sender, System.EventArgs e) { TreeIter iter; if (!defaultAssociationsView.Selection.GetSelected(out iter)) { throw new InvalidOperationException ("Should not be able to activate removeFileAssocation button while no row is selected."); } string ext = (string)defaultAssociationsStore.GetValue(iter, COL_EXT); if (ext != null && ext.Trim().Length > 0) { removedExtensions.Add(ext.Trim()); } defaultAssociationsStore.Remove(ref iter); }
//Class delete selected row in treeview private void del_lst_box_selected(ListStore listStore) { TreeIter iter; TreePath[] treepart = treeview1.Selection.GetSelectedRows(); if (treepart.Length != 0) { for (int i = treepart.Length; i > 0; i--) { listStore.GetIter(out iter, treepart[(i - 1)]); listStore.Remove(ref iter); } } else { msg(1, "Please select row to delete.", MessageType.Warning); } }
public void RemoveUser(Node node) { TreeIter iter; if (userListStore.GetIterFirst(out iter)) { do { Node currentNode = (Node)userListStore.GetValue(iter, 0); if (currentNode == node) { userListStore.Remove(ref iter); AddToChat(null, node + " has left " + thisRoom.Name + "."); return; } } while (userListStore.IterNext(ref iter)); } }
protected void OnBtnRemoveClicked(object sender, EventArgs e) { if (!treeOSes.Selection.GetSelected(out TreeIter osIter)) { return; } MessageDialog dlgMsg = new MessageDialog(this, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, "Are you sure you want to remove the selected OS?"); if (dlgMsg.Run() == (int)ResponseType.Yes) { Workers.RemoveOS((long)osView.GetValue(osIter, 14), (string)osView.GetValue(osIter, 15)); osView.Remove(ref osIter); } dlgMsg.Destroy(); }
void MoveItem(TreeView sourceList, ListStore sourceStore, TreeView targetList, ListStore targetStore) { TreeModel model; TreeIter iter; if (sourceList.Selection.GetSelected(out model, out iter)) { TreeIter newiter = targetStore.AppendValues(sourceStore.GetValue(iter, 0), sourceStore.GetValue(iter, 1), sourceStore.GetValue(iter, 2)); targetList.Selection.SelectIter(newiter); TreeIter oldIter = iter; if (sourceStore.IterNext(ref iter)) { sourceList.Selection.SelectIter(iter); } sourceStore.Remove(ref oldIter); } }
protected virtual void RemoveClicked(object sender, System.EventArgs e) { TreeIter iter; if (listTriggers.Selection.GetSelected(out iter)) { TriggerSchema trigger = store.GetValue(iter, colObjIndex) as TriggerSchema; if (Services.MessageService.AskQuestion( GettextCatalog.GetString("Are you sure you want to remove trigger '{0}'?", trigger.Name), GettextCatalog.GetString("Remove Trigger") )) { store.Remove(ref iter); triggers.Remove(trigger); EmitContentChanged(); } } }
public void OnAddClicked(object o, EventArgs args) { TreeModel model; TreeIter iter; TreePath[] tp = allUsersTreeview.Selection.GetSelectedRows(out model); for (int i = tp.Length; i > 0; i--) { allUserStore.GetIter(out iter, tp[(i - 1)]); string user = (string)allUserStore.GetValue(iter, 0); currentMembers.Add(user); currentMemberStore.AppendValues(user); allUserStore.Remove(ref iter); } }
protected virtual void RemoveClicked(object sender, EventArgs e) { TreeIter iter; if (listCheck.Selection.GetSelected(out iter)) { CheckConstraintSchema check = store.GetValue(iter, colObjIndex) as CheckConstraintSchema; if (MessageService.Confirm( AddinCatalog.GetString("Are you sure you want to remove constraint '{0}'?", check.Name), AlertButton.Remove )) { store.Remove(ref iter); constraints.Remove(check); EmitContentChanged(); } } }
protected virtual void RemoveClicked(object sender, System.EventArgs e) { TreeIter iter; if (listPK.Selection.GetSelected(out iter)) { PrimaryKeyConstraintSchema pk = store.GetValue(iter, colObjIndex) as PrimaryKeyConstraintSchema; if (Services.MessageService.AskQuestion( GettextCatalog.GetString("Are you sure you want to remove constraint '{0}'?", pk.Name), GettextCatalog.GetString("Remove Constraint") )) { store.Remove(ref iter); constraints.Remove(pk); EmitContentChanged(); } } }
private void OnTransportRemoved(object sender, TransportEventArgs args) { Gui.MainWindow.RefreshCounts(); Gtk.TreeIter iter; connectionListStore.GetIterFirst(out iter); if (connectionListStore.IterIsValid(iter)) { do { ITransport transport = (ITransport)connectionListStore.GetValue(iter, 0); if (transport == args.Transport) { connectionListStore.Remove(ref iter); return; } } while (connectionListStore.IterNext(ref iter)); } }
void MarketSummaries_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { var coll = sender as ICollection <PriceTicker>; switch (e.Action) { case NotifyCollectionChangedAction.Replace: Debug.Assert(e.NewItems.Count == 1); Debug.Assert(e.NewStartingIndex == e.OldStartingIndex); //Debug.Print($"MarketSummaries: Replaced {e.NewItems.Count} item(s)."); Gtk.Application.Invoke(delegate { TreeIter iter; store.GetIterFromString(out iter, e.OldStartingIndex.ToString()); store.SetValue(iter, 0, e.NewItems[0]); }); break; case NotifyCollectionChangedAction.Remove: Debug.Assert(e.OldItems.Count == 1); //Debug.Print($"MarketSummaries: Removed {e.OldItems.Count} item(s)."); Gtk.Application.Invoke(delegate { TreeIter iter; store.GetIterFromString(out iter, e.OldStartingIndex.ToString()); store.Remove(ref iter); }); break; case NotifyCollectionChangedAction.Reset: Debug.Print($"MarketSummaries: Reset. {coll.Count} item(s)."); Gtk.Application.Invoke(delegate { store.Clear(); foreach (var item in coll) { store.AppendValues(item); } BuildMarkets(); }); break; } }
void OnButtonRemoveClicked(object sender, System.EventArgs e) { TreeIter it; if (dirList.Selection.GetSelected(out it)) { string dir = (string)store.GetValue(it, 0); directories.Remove(dir); store.Remove(ref it); if (store.IterIsValid(it)) { FocusRow(it); } else { UpdateStatus(); } } }
protected virtual void RemoveClicked(object sender, EventArgs e) { TreeIter iter; if (listUnique.Selection.GetSelected(out iter)) { UniqueConstraintSchema uni = store.GetValue(iter, colObjIndex) as UniqueConstraintSchema; if (Services.MessageService.AskQuestion( GettextCatalog.GetString("Are you sure you want to remove constraint '{0}'?", uni.Name), GettextCatalog.GetString("Remove Constraint") )) { store.Remove(ref iter); constraints.Remove(uni); EmitContentChanged(); } } }
private void RemoveItems(ref Contacts cnts, ref ListStore lstore, TreePath[] tPath) { for (int p = (tPath.Length - 1); p >= 0; p--) { // remove contact from list cnts.SimContacts.RemoveAt(tPath[p].Indices[0]); } for (int p = (tPath.Length - 1); p >= 0; p--) { // remove contact from list TreeIter ti; bool isIter = lstore.GetIter(out ti, tPath[p]); if (isIter) { lstore.Remove(ref ti); } } }
public void RemoveSearch(FileSearch search) { TreeIter iter; if (searchItemsModel.GetIterFirst(out iter)) { do { ISidebarItem item = (ISidebarItem)searchItemsModel.GetValue(iter, 0); if (item is FileSearchItem && ((FileSearchItem)item).Search == search) { searchItemsModel.Remove(ref iter); item.Destroy(); return; } } while (searchItemsModel.IterNext(ref iter)); } throw new InvalidOperationException("Unknown search."); }
/// <summary> /// Remove Item /// </summary> public void RemoveItem() { TreeSelection tSelect = this.AccTreeView.Selection; TreeModel tModel; TreeIter iter; tSelect.GetSelected(out tModel, out iter); string id = (string)tModel.GetValue(iter, 0); curDomains.Remove(id); AccTreeStore.Remove(ref iter); /* * if(curDomains.Count == 0) * { * this.Hide(); * this.Destroy(); * } */ }
/// <summary> /// Removes the selected rule from the rule-list, if the user /// gives its confirmation. /// </summary> /// <param name="sender"> /// A <see cref="System.Object"/> /// </param> /// <param name="args"> /// A <see cref="EventArgs"/> /// </param> private void OnRemoveBtnClicked(object sender, EventArgs args) { TreeIter selected; rulesTV.Selection.GetSelected(out selected); // We retrieve the selected row's rule name. string ruleName = (string)(rulesStore.GetValue(selected, 0)); ResponseType res; res = ConfirmDialog.Show(lexicalRulesManagerDialog, "¿Realmente quieres eliminar la regla «{0}»?", ruleName); if (res == ResponseType.Yes) { rulesStore.Remove(ref selected); } }