Пример #1
0
 public WorkspaceWindowContent()
 {
     InitializeComponent();
     _wksUI      = new UCWorkspace();
     _wksUI.Dock = DockStyle.Fill;
     this.Controls.Add(_wksUI);
     _wksUI.SetDoubleClickHandler((obj) =>
     {
         if (obj != null)
         {
             ICommand cmd = _session.CommandEnvironment.Get(2000);
             if (cmd != null)
             {
                 cmd.Execute(obj.ToString());
             }
         }
     });
 }
Пример #2
0
 private void button20_Click_1(object sender, EventArgs e)
 {
     using (Form frm = new Form())
     {
         UCWorkspace wks = new UCWorkspace();
         wks.SetDoubleClickHandler((obj) =>
         {
             this.Text = obj != null ? Path.GetFileName(obj.ToString()) : string.Empty;
         });
         wks.Apply(GetWorkspaceDef());
         wks.Dock = DockStyle.Fill;
         frm.Controls.Add(wks);
         Button btn = new Button();
         btn.Text   = "Get Selected Item";
         btn.Width  = 200;
         btn.Height = 30;
         btn.Tag    = wks as IWorkspace;
         btn.Click += new EventHandler(btn_Click);
         frm.Controls.Add(btn);
         btn.BringToFront();
         frm.ShowDialog();
     }
 }