Ejemplo n.º 1
0
        private static void AsyncAddBug(object state)
        {
            try
            {

                BugWS.NetronWS logger = new BugWS.NetronWS();
                logger.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
                Bug b = (Bug) bugQueue.Dequeue();

                logger.AddBug(b.Title, b.Comment);

            }
            catch(Exception exc)
            {

                System.Diagnostics.Trace.WriteLine(exc.Message);
            }
            // Signal that thread is done.
            ((AutoResetEvent)state).Set();
        }
Ejemplo n.º 2
0
        private static void AsyncGetBugs(object state)
        {
            try
            {
                BugWS.NetronWS logger = new BugWS.NetronWS();
                string[] bugs = logger.ListBugs(amount.ToString());
                DataTable dt;

                if(bugs.Length>0)
                {
                    ds = new DataSet();
                    dt = ds.Tables.Add("Bugs");
                    dt.Columns.Add("Id");
                    dt.Columns.Add("Created");
                    dt.Columns.Add("Title");
                    dt.Columns.Add("Text");

                    for(int k =0; k<bugs.Length; k++)
                    {
                        try
                        {
                            dt.Rows.Add(bugs[k].Split('|'));
                        }
                        catch
                        {continue;}
                    }

                }
            }
            catch
            {}
            // Signal that thread is done.
            ((AutoResetEvent)state).Set();
        }