protected void OnDropUser() { UserNode node = (UserNode)CurrentNode.DataItem; if (Services.MessageService.AskQuestion( GettextCatalog.GetString("Are you sure you want to drop user '{0}'", node.User.Name), GettextCatalog.GetString("Drop User") )) { ThreadPool.QueueUserWorkItem(new WaitCallback(OnDropUserThreaded), CurrentNode.DataItem); } }
protected void OnDropUser() { UserNode node = (UserNode)CurrentNode.DataItem; AlertButton dropButton = new AlertButton(AddinCatalog.GetString("Drop"), Gtk.Stock.Delete); if (MessageService.Confirm( AddinCatalog.GetString("Are you sure you want to drop user '{0}'", node.User.Name), dropButton )) { ThreadPool.QueueUserWorkItem(new WaitCallback(OnDropUserThreaded), CurrentNode.DataItem); } }
private void RenameItemThreaded(object state) { object[] objs = state as object[]; UserNode node = objs[0] as UserNode; string newName = objs[1] as string; ISchemaProvider provider = node.User.SchemaProvider; if (provider.IsValidName(newName)) { provider.RenameUser(node.User, newName); node.Refresh(); } else { DispatchService.GuiDispatch(delegate() { Services.MessageService.ShowError(String.Format( "Unable to rename user '{0}' to '{1}'!", node.User.Name, newName )); }); } node.Refresh(); }
public override string GetNodeName(ITreeNavigator thisNode, object dataObject) { UserNode node = dataObject as UserNode; return(node.User.Name); }