コード例 #1
0
ファイル: PFWService.cs プロジェクト: aardvarkss/Printer
        /// <summary>
        /// Set things in motion so your service can do its work.
        /// </summary>
        protected override void OnStart(string[] args)
        {
            try
            {
                if (m_pfwEngine == null)
                {
                    m_pfwEngine = new PFWEngine();
                }

                m_pfwEngine.Start();

                base.OnStart(args);
            }
            catch (Exception e)
            {
                string strMessage = string.Format("Unexpected error.\n    {0}\n", e.Message);
                if (m_utils != null)
                {
                    m_utils.WriteEventLogEntry(strMessage, EventLogEntryType.Error, Utils.EVENT_LOG_SOURCE);
                }
            }
        }
コード例 #2
0
 private void buttonStart_Click(object sender, System.EventArgs e)
 {
     pfwEngine = new PFWEngine();
     pfwEngine.Start();
 }