当前位置: 首页>>代码示例>>C#>>正文


C# DoWorkEventArgs类代码示例

本文整理汇总了C#中DoWorkEventArgs的典型用法代码示例。如果您正苦于以下问题:C# DoWorkEventArgs类的具体用法?C# DoWorkEventArgs怎么用?C# DoWorkEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DoWorkEventArgs类属于命名空间,在下文中一共展示了DoWorkEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: bg_DoWork

        void bg_DoWork(object sender, DoWorkEventArgs e)
        {

            ObservableCollection<WirelessDevice> devices = new ObservableCollection<WirelessDevice>();
            WlanClient client = new WlanClient();
            foreach (WlanClient.WlanInterface wlanIface in client.Interfaces)
            {
                // Lists all networks in the vicinity

                Wlan.WlanAvailableNetwork[] networks = wlanIface.GetAvailableNetworkList(0);
                foreach (Wlan.WlanAvailableNetwork network in networks)
                {

                    string ssid = GetStringForSSID(network.dot11Ssid);
                    string msg = "Found network with SSID " + ssid;
                    log.dispatchLogMessage(msg);
                    msg = "Signal: " + network.wlanSignalQuality;
                    log.dispatchLogMessage(msg);
                    msg = "BSS Type : " + network.dot11BssType;
                    log.dispatchLogMessage(msg);
                    msg = "Profile Name : " + network.profileName;
                    log.dispatchLogMessage(msg);
                    log.dispatchLogMessage("");

                    WirelessDevice d = new WirelessDevice(ssid, network.wlanSignalQuality);
                    devices.Add(d);
                }
            }
            _unsecuredDevices = devices;
            e.Result = _unsecuredDevices;
        }
开发者ID:sumeetjauhar,项目名称:YQ,代码行数:31,代码来源:wireless_devices.xaml.cs

示例2: RTBackground_DoWork

    private void RTBackground_DoWork(object sender, DoWorkEventArgs e)
    {
        try
        {
            ProcessStartInfo RTStartInfo = new ProcessStartInfo();
            if (Environment.OSVersion.Platform == PlatformID.Win32NT) { RTStartInfo = new ProcessStartInfo("\"" + MySettings.ProgramPath + "\"", e.Argument.ToString()); }
            else if (Environment.OSVersion.Platform == PlatformID.Unix) { RTStartInfo = new ProcessStartInfo("rawtherapee", e.Argument.ToString()); }
            else if (Environment.OSVersion.Platform == PlatformID.MacOSX) { RTStartInfo = new ProcessStartInfo("rawtherapee", e.Argument.ToString()); }
            else { e.Result = InfoType.InvalidOS; return; }

            RTStartInfo.UseShellExecute = false;
            RTStartInfo.CreateNoWindow = true;

            RT.StartInfo = RTStartInfo;
            RT.Start();
            lastTime = DateTime.Now.Ticks;
            RT.WaitForExit();

            e.Result = InfoType.OK;
        }
        catch (Exception ex)
        {
            ThreadException = ex;
            e.Result = InfoType.Error;
        }
    }
开发者ID:TimeScience,项目名称:desert-deflicker,代码行数:26,代码来源:MainBGW.cs

示例3: checkPeriodically

        public void checkPeriodically(object sender, DoWorkEventArgs e)
        {
            Thread.Sleep(1000);//Wait 10s for Steambot to fully initialize
            while (true)
            {
                double newConversionRate = getConversionRate();
                if (newConversionRate != -1)
                    conversionRate = newConversionRate;

                DataSet verified_adds = returnQuery("SELECT * FROM add_verification a,users u WHERE verified=1 AND a.userID=u.userID");
                if (verified_adds != null)
                {
                    for (int r = 0; r < verified_adds.Tables[0].Rows.Count; r++)
                    {
                        BotManager.mainLog.Success("Add verified: " + verified_adds.Tables[0].Rows[r][2].ToString() + " DOGE to user " + verified_adds.Tables[0].Rows[r][1].ToString());
                        returnQuery("UPDATE users SET balance = balance + " + verified_adds.Tables[0].Rows[r][2].ToString() + " WHERE userID = " + verified_adds.Tables[0].Rows[r][1].ToString());
                        returnQuery("DELETE FROM add_verification WHERE addID = " + verified_adds.Tables[0].Rows[r][0].ToString());

                        SteamID userID = new SteamID();
                        userID.SetFromUInt64(ulong.Parse(verified_adds.Tables[0].Rows[r][6].ToString()));
                        Bot.SteamFriends.SendChatMessage(userID, EChatEntryType.ChatMsg, verified_adds.Tables[0].Rows[r][2].ToString() + " DOGE was successfully added to your tipping balance.");
                        BotManager.mainLog.Success("Registered user successfully added " + verified_adds.Tables[0].Rows[r][2].ToString() + " DOGE to their balance.");
                    }
                }
                Thread.Sleep(30000);
            }
        }
开发者ID:natoshi,项目名称:steamdogebot,代码行数:27,代码来源:DogeTipBotHandler.cs

示例4: bkgndWkr_DoWork

	void bkgndWkr_DoWork (Object sender, DoWorkEventArgs e)
	{
		e.Result = 5566;
		e.Cancel = true;
		m_doWorkException = new RankException ("Rank exception manually created and thrown in _DoWork.");
		throw m_doWorkException;
	}
开发者ID:mono,项目名称:gert,代码行数:7,代码来源:test.cs

示例5: CtorTest

 public static void CtorTest(object expectedArgument)
 {
     var target = new DoWorkEventArgs(expectedArgument);
     Assert.Equal(expectedArgument, target.Argument);
     Assert.False(target.Cancel);
     Assert.Null(target.Result);
 }
开发者ID:noahfalk,项目名称:corefx,代码行数:7,代码来源:DoWorkEventArgsTests.cs

示例6: bgwInit_DoWork

        private void bgwInit_DoWork(object sender, DoWorkEventArgs e)
        {
            UserAccessLevel accessLvl = UserAccessLevel.None;
            DataRow dtrRow = (DataRow)e.Argument;

            switch ((string)dtrRow["role"])
            {
                case "Admin":
                    accessLvl = UserAccessLevel.Admin;
                    break;
                case "Instructor":
                    accessLvl = UserAccessLevel.Instructor;
                    break;
                case "Counter Staff":
                    accessLvl = UserAccessLevel.CounterStaff;
                    break;
                case "Owner":
                    accessLvl = UserAccessLevel.Owner;
                    break;
                default:
                    MessageBox.Show(this, "Database error.\n Unexpected value in Staff.Role. Notify an administrator.",
                                        "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    Application.Exit();
                    break;
            }
            contentForm = new frmMain(programDatabase, new User((string)dtrRow["name"], (string)dtrRow["username"], (string)dtrRow["password"], accessLvl));
        }
开发者ID:InvertedLlama,项目名称:PPSD,代码行数:27,代码来源:frmLogin.cs

示例7: HandleWorkerDoWork

    /// <summary>
    /// This runs in a different thread and outputs to the javascript log.
    /// </summary>
    /// <param name='sender'>
    /// Sender.
    /// </param>
    /// <param name='e'>
    /// E.
    /// </param>
    void HandleWorkerDoWork(object sender, DoWorkEventArgs e)
    {
        JavascriptLogger jsLogger = new JavascriptLogger("Threaded Logger");

        while(true)
        {
            jsLogger.LogInfo("Ping " + DateTime.Now);
            Thread.Sleep(3000);
        }
    }
开发者ID:derFunk,项目名称:unity3d-webplayer-jslogger,代码行数:19,代码来源:JsLoggerThreadExample.cs

示例8: bw_DoWork

 void bw_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         Start();
     }
     catch (Exception ex)
     {
         WriteError(ex.Message);
     }
 }
开发者ID:njmube,项目名称:Mysqlbackup.net,代码行数:11,代码来源:FormDatabaseInfo.cs

示例9: bwExport_DoWork

 void bwExport_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         mb.ExportToFile(Program.TargetFile);
     }
     catch (Exception ex)
     {
         CloseConnection();
         MessageBox.Show(ex.ToString());
     }
 }
开发者ID:njmube,项目名称:Mysqlbackup.net,代码行数:12,代码来源:FormTestExportProgresBar.cs

示例10: worker_DoWork

    static void worker_DoWork(object sender, DoWorkEventArgs e)
    {
        Console.WriteLine("Starting to do some work now...");
        int i;
        for (i = 1; i < 10; i++)
        {
            Thread.Sleep(1000);
            worker.ReportProgress(Convert.ToInt32((100.0 * i) / 10));
        }

        e.Result = i;
    }
开发者ID:walrus7521,项目名称:code,代码行数:12,代码来源:BkgdWorker.cs

示例11: bgwAuditLogs_DoWork

        private void bgwAuditLogs_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                string[] arg = e.Argument.ToString().Split('|');

                AccessTypes AccessType = (AccessTypes)Enum.Parse(typeof(AccessTypes), arg[0]);
                string Remarks = arg[1];
                
                Methods.InsertAuditLog(mclsTerminalDetails, mCashierName, AccessType, Remarks);
            }
            catch{ }
        }
开发者ID:marioricci,项目名称:erp-luma,代码行数:13,代码来源:MainWndExtension.cs

示例12: backgroundWorker1_DoWork

    private void backgroundWorker1_DoWork(
        object sender,
        DoWorkEventArgs e)
    {
        document = new XmlDocument();

        // Uncomment the following line to
        // simulate a noticeable latency.
        //Thread.Sleep(5000);

        // Replace this file name with a valid file name.
        document.Load(@"http://www.tailspintoys.com/sample.xml");
    }
开发者ID:suplits,项目名称:BackgroundWorkerExample,代码行数:13,代码来源:Form1.cs

示例13: DoWork

            private void DoWork(object sender, DoWorkEventArgs e)
            {
                ExternalApp app = new ExternalApp();
                Options opts = sender as Options;

                app.Options = sender as Options;

                if (!app.Run())
                {
                   //MessageBox.Show("HDFExporter tool has failed.", "ATTENTION", MessageBoxButtons.OK, MessageBoxIcon.Error);
                   return;
                }
            }
开发者ID:JauchOnGitHub,项目名称:csharptoolbox,代码行数:13,代码来源:BackgroundApp.cs

示例14: bgwTurret_DoWork

        private void bgwTurret_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                string[] arg = e.Argument.ToString().Split('|');

                string szString = arg[0].ToString();
                string strTransactionNo = arg[1].ToString();

                RawPrinterHelper.SendStringToPrinter(mclsTerminalDetails.TurretName, "\f" + szString, "RetailPlus Turret Disp: " + strTransactionNo);
            }
            catch { }
        }
开发者ID:marioricci,项目名称:erp-luma,代码行数:13,代码来源:MainWndExtension.cs

示例15: bgwPrintInvoice_DoWork

 void bgwPrintInvoice_DoWork(object sender, DoWorkEventArgs e)
 {
     //Print Invoice for Currently selected record
     try
     {
         PrintDocument pd = (PrintDocument)e.Argument;
         pd.PrintPage += new PrintPageEventHandler(PrintPage);
         pd.Print();
         ((BackgroundWorker)sender).ReportProgress(100, "Print Completed");
     }
     catch (Exception ae)
     {
         ((BackgroundWorker)sender).ReportProgress(0, "Error");
         MessageBox.Show(ae.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error);
     }
 }
开发者ID:madhurjain,项目名称:AutoServeJobsManager,代码行数:16,代码来源:mainForm.cs


注:本文中的DoWorkEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。