/// <summary> /// Runs the specified gulu. /// </summary> /// <param name="_gulu">The gulu that is going to run.</param> public static void Run(GuluBase _gulu) { if (_gulu != null) { Session.CurrentSession.SetGulu(_gulu); System.Threading.Thread.Sleep(1); Api.SendMessage(Session.CurrentSession.MDIParent.Handle.ToInt32(), Convert.ToInt32(MessageHelper.Messages.RunGulu), 0, 0); } }
/* Sunny Chen Added 2008/07/01 <-- */ public GuluWorkerParameter(GuluBase _gulu, IList<ListViewItem> _items /* Sunny Chen Added 2008/07/01 --> */ , ConfigReader _configReader /* Sunny Chen Added 2008/07/01 <-- */ ) { gulu__ = _gulu; items__ = _items; /* Sunny Chen Added 2008/07/01 --> */ configReader__ = _configReader; /* Sunny Chen Added 2008/07/01 <-- */ }
private void RunGulu(GuluBase _gulu) { if (guluWorkerRunning__) { MessageBox.Show("Running..."); return; } frmFileList fileListForm = null; foreach (frmDummy child in this.MdiChildren) { if (child is frmFileList) { fileListForm = (child as frmFileList); break; } } if (fileListForm != null) { IList<ListViewItem> selectedItems = fileListForm.SelectedItems; if (selectedItems != null && _gulu != null) { Output.Clear(); Output.Add(string.Format(SunnyChen.Gulu.Win.Properties.Resources.TEXT_INIT_GULU, _gulu.ToString())); if (_gulu.Init()) { if (dockManager.ControlPanes["mainTab"].Closed) { dockManager.ControlPanes["mainTab"].Closed = false; dockManager.ControlPanes["mainTab"].Activate(); } GuluWorkerParameter parameter = new GuluWorkerParameter(_gulu, selectedItems /* Sunny Chen Added 2008/07/01 --> */ , globalConfigReader__ /* Sunny Chen Added 2008/07/01 <-- */ ); ParameterizedThreadStart threadStart = new ParameterizedThreadStart(worker__.WorkingThread); workerThread__ = new Thread(threadStart); workerThread__.Priority = ThreadPriority.BelowNormal; guluWorkerThreads__.Add(workerThread__); guluWorkerRunning__ = true; workerThread__.Start(parameter); GetTool("mnuStop").SharedProps.Enabled = true; taskManager.Enabled = false; fileTreeView.Enabled = false; } else Output.Add(SunnyChen.Gulu.Win.Properties.Resources.TEXT_GULU_INIT_FAILED); } else MessageBox.Show(SunnyChen.Gulu.Win.Properties.Resources.TEXT_INFO_NOITEM, SunnyChen.Gulu.Win.Properties.Resources.TEXT_INFORMATION, MessageBoxButtons.OK, MessageBoxIcon.Information); } else MessageBox.Show(SunnyChen.Gulu.Win.Properties.Resources.TEXT_INFO_FILELIST_NOT_OPEN, SunnyChen.Gulu.Win.Properties.Resources.TEXT_INFORMATION, MessageBoxButtons.OK, MessageBoxIcon.Information); }
public GuluWorkerFinishedEventArgs(GuluBase _gulu, bool _interrupted) : base() { gulu__ = _gulu; interrupted__ = _interrupted; }
/// <summary> /// Sets the Gulu that is going to run. /// </summary> /// <param name="_gulu">The gulu for running.</param> /// <remarks> /// Calls this method just before a gulu is going to be run. DO NOT call it within your own program context. /// </remarks> public void SetGulu(GuluBase _gulu) { gulu__ = _gulu; }