コード例 #1
0
        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);
            }
        }
コード例 #2
0
        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);
            }
        }
コード例 #3
0
        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();
        }
コード例 #4
0
        public override string GetNodeName(ITreeNavigator thisNode, object dataObject)
        {
            UserNode node = dataObject as UserNode;

            return(node.User.Name);
        }