/// <summary> /// Called when this process needs to be destroyed. /// </summary> public override void Dispose() { if (_eventListener != null) { EventManager.DetachListener(_eventListener); } if (_process != null) { _process.Dispose(); } _eventListener = null; _process = null; _entity = null; }
public void Create(string title, int width, int height) { Form = new Form(); Form.Disposed += new EventHandler(delegate { _scriptProcess.Dispose(); }); var resources = new ComponentResourceManager(typeof(MainForm)); Form.FormBorderStyle = FormBorderStyle.FixedToolWindow; Form.Width = width; Form.Text = title; Form.Height = height; Form.Icon = ((Icon)(resources.GetObject("$this.Icon"))); }