Ejemplo n.º 1
0
        static void DoBenchmark()
        {
            using (IrbisConnection connection = new IrbisConnection())
            {
                connection.ParseConnectionString(ConnectionString);
                connection.Connect();
                Console.WriteLine("Connected");

                Stopwatch stopwatch = new Stopwatch();
                stopwatch.Start();

                for (int i = 0; i < RetryCount; i++)
                {
                    connection.NoOp();
                }

                stopwatch.Stop();
                connection.Dispose();
                Console.WriteLine("Disconnected");

                long ms = stopwatch.ElapsedMilliseconds;
                Console.WriteLine("Elapsed: {0} ms", ms);
                long one = ms / RetryCount;
                Console.WriteLine("One: {0} ms", one);
            }
        }
Ejemplo n.º 2
0
 private void MainForm_FormClosed
 (
     object sender,
     FormClosedEventArgs e
 )
 {
     _client.Dispose();
 }
Ejemplo n.º 3
0
 private void MainForm_FormClosed
 (
     object sender,
     FormClosedEventArgs e
 )
 {
     _pinger.Active = false;
     _pinger.Dispose();
     _connection.Dispose();
 }
Ejemplo n.º 4
0
        private void MainForm_FormClosed
        (
            object sender,
            FormClosedEventArgs e
        )
        {
            if (_client != null)
            {
                _client.Dispose();
                _client = null;
            }

            //if (_rfid != null)
            //{
            //    _rfid.Close();
            //    _rfid = null;
            //}
        }
Ejemplo n.º 5
0
        public Form5()
        {
            InitializeComponent();

            string connectionString = CM.AppSettings["connectionString"];

            Connection = new IrbisConnection();
            Connection.ParseConnectionString(connectionString);
            Connection.Connect();

            Grid = new SiberianFoundGrid
            {
                Dock = DockStyle.Fill
            };
            Controls.Add(Grid);

            List <FoundLine> lines = new List <FoundLine>();

            for (int i = 1; i < 100; i++)
            {
                try
                {
                    string    description = Connection.FormatRecord("@brief", i);
                    FoundLine line        = new FoundLine
                    {
                        Mfn          = i,
                        Materialized = true,
                        Description  = description
                    };
                    lines.Add(line);
                }
                catch
                {
                    // Nothing to do
                }
            }

            Connection.Dispose();

            Grid.Load(lines.ToArray());

            //FormClosed += _FormClosed;
        }