/// <summary> /// This method runs once in the Module life. /// In this method, you can do registrations of the not UI related components. /// (eg: datasource, plugin) /// </summary> public void Integrate() { // Register ShaleCommandHandler PetrelSystem.CommandManager.CreateCommand(ShaleCommandHandler.ID, new Shale.ShaleCommandHandler()); // Register ShaleWorkstep ShaleWorkstep shaleworkstepInstance = new ShaleWorkstep(); PetrelSystem.WorkflowEditor.AddUIFactory<ShaleWorkstep.Arguments>(new ShaleWorkstep.UIFactory()); PetrelSystem.WorkflowEditor.Add(shaleworkstepInstance); m_shaleworkstepInstance = new Slb.Ocean.Petrel.Workflow.WorkstepProcessWrapper(shaleworkstepInstance); PetrelSystem.ProcessDiagram.Add(m_shaleworkstepInstance, "Plug-ins"); }
/// <summary> /// Initializes a new instance of the <see cref="ShaleWorkstepUI"/> class. /// </summary> /// <param name="workstep">the workstep instance</param> /// <param name="args">the arguments</param> /// <param name="context">the underlying context in which this UI is being used</param> public ShaleWorkstepUI(ShaleWorkstep workstep, ShaleWorkstep.Arguments args, WorkflowContext context) { InitializeComponent(); btn_Apply.Image = Shale.Properties.Resources.IDB_BUTTON_APPLY; btn_DelBoreHole.Image = PetrelImages.RowDelete; this.workstep = workstep; this.args = args; this.context = context; workstep.CopyArgumentPackage(args, tmpargs); }
public override void Execute(Slb.Ocean.Petrel.Contexts.Context context) { PetrelLogger.InfoOutputWindow(string.Format("{0} clicked", @"ShaleCommand" )); //Create workstep ShaleWorkstep tmp_wstep = new ShaleWorkstep(); ShaleWorkstep.Arguments tmp_warg = new ShaleWorkstep.Arguments(); ShaleWorkstepUI tmp_wstepui = new ShaleWorkstepUI(tmp_wstep, tmp_warg, ctnxt); //Create form and add workstep to form Form form_cont = new Form(); form_cont.Icon = Icon.FromHandle(PetrelImages.Modules.GetHicon()); form_cont.Text = "ShaleWorkstep"; tmp_wstepui.Parent = form_cont; form_cont.Width = tmp_wstepui.Width; form_cont.Height = tmp_wstepui.Height; //form_cont.TopMost = true; //form_cont.Show(); }