SHARE
TWEET

Untitled

a guest Mar 18th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [SmartPart]
  2. public partial class ProjectViewForm : Form
  3. {
  4.     InitializeComponent();.
  5. }
  6.  
  7. public partial class ProjectView : System.Windows.Forms.UserControl
  8. {
  9.     public ProjectView()
  10.     {
  11.        InitializeComponent();
  12.        ...
  13.     }
  14.     protected override void OnLoad(System.EventArgs eventArgs)
  15.     {
  16.             this._presenter.OnViewReady();
  17.             base.OnLoad(eventArgs);
  18.             ... populate with Project data ...
  19.         }
  20. }
  21.      
  22. string key = System.String.Concat("ProjectView", project.Id);
  23.  ProjectViewForm projectViewForm = WorkItem.Items.Get<ProjectViewForm>(key);
  24.  if (projectViewForm == null)
  25.  {
  26.      projectViewForm = WorkItem.Items.AddNew<ProjectViewForm>(key);
  27.  }
  28.  else
  29.  {
  30.      projectViewForm.Focus();
  31.  }
  32.  
  33.  projectViewForm.Enter += ProjectViewForm_Enter;
  34.  projectViewForm.Leave += ProjectViewForm_Leave;
  35.  
  36.  string formTitle = System.String.Concat (project.Name, " - Status: ", project.ProjectStatusType.Text);
  37.  var info = new Microsoft.Practices.CompositeUI.WinForms.WindowSmartPartInfo();
  38.  info.Location = System.Windows.Forms.Cursor.Position;
  39.  ... yadda yadda yadda ...
  40.  projectViewForm.Dock = System.Windows.Forms.DockStyle.Fill;
  41.  
  42. WorkItem.Workspaces[Infrastructure.Interface.Constants.WorkspaceNames.WindowsWorkspace].Show (projectViewForm, info);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top