示例#1
0
 private void _OnClick(object sender, EventArgs e)
 {
     if (sender == this.ButtonClick)
     {
         if (this._hTreeNode != null)
         {
             this._hTreeNode.Dialog((Dialog)null).Click();
         }
     }
     else if (sender == this.ButtonCopy)
     {
         if (this._hTreeNode != null)
         {
             IDialogNode idialogNode = this._hTreeNode;
             string      str         = (string)null;
             for (; idialogNode != null; idialogNode = (IDialogNode)idialogNode.Parent)
             {
                 string name = idialogNode.Dialog((Dialog)null).GetName();
                 str = (name == null || name.Length == 0 ? idialogNode.Dialog((Dialog)null).GetIndex().ToString() : name) + (str == null ? string.Empty : "/" + str);
             }
             Clipboard.SetText(this.ComboBox.SelectedIndex != 1 ? "Game.DialogList.GetDialog( \"" + str + "\" )" : "DialogList:GetDialog( \"" + str + "\" )");
             this.ButtonCopy.Enabled = false;
         }
     }
     else if (sender == this.ButtonEnable)
     {
         if (this._hTreeNode != null)
         {
             this._hTreeNode.Dialog((Dialog)null).SetEnabled(!this._hTreeNode.Dialog((Dialog)null).IsEnabled());
         }
         this.Update();
     }
     else if (sender == this.ButtonShow)
     {
         if (this._hTreeNode != null)
         {
             this._hTreeNode.Dialog((Dialog)null).SetVisible(!this._hTreeNode.Dialog((Dialog)null).IsVisible());
         }
         this.Update();
     }
     this.Label.Focus();
 }
示例#2
0
 protected void _OnAfterSelect(object sender, TreeViewEventArgs e)
 {
     if (this._hTreeNode != null && (e.Node.Parent == null || e.Node.Parent != this._hTreeNode))
     {
         if (e.Node == null || e.Node.Parent != this._hTreeNode.Parent)
         {
             this._hTreeNode.CollapseAll();
         }
         this._hTreeNode.Update(false, false);
         this._hTreeNode.Nodes.Clear();
     }
     if (e.Node == null)
     {
         return;
     }
     this._hTreeNode         = (IDialogNode)e.Node;
     this.ButtonCopy.Enabled = true;
     this.Update();
     this._hTreeNode.Expand();
 }