示例#1
0
        /// <summary>
        /// UI Control
        /// </summary>
        /// <param name="text"></param>
        #region UI Control
        //For Log calls
        public void logCall(bool sent, string text)
        {
            invokeDelegate del = () =>
            {
                logData(sent, text);
            };

            Invoke(del);
        }
示例#2
0
        private void tcpServer1_OnConnect(tcpServer.TcpServerConnection connection)
        {
            invokeDelegate setText = () => lblConnected.Text = tcpServer1.Connections.Count.ToString();

            Invoke(setText);
            while (tcpServer1.Connections.Count != 0)
            {
                toolStripStatusLabel4.Text = "Connection: 1 !"; toolStripStatusLabel4.BackColor = Color.Lime;
            }
        }
示例#3
0
 private void ShowCompleted()
 {
     if (this.InvokeRequired)
     {
         invokeDelegate updateControl = delegate() { };
         updateControl = ShowCompleted;
         Invoke(updateControl);
     }
     this.SetPages();
     this.CheckEnable();
     this.printButton.Enabled = true;
     this.pdfButton.Enabled   = true;
     this.UpdateToolStrip();
     ShowSelectedPage();
 }
示例#4
0
        private void tcpServer1_OnDataAvailable(tcpServer.TcpServerConnection connection)
        {
            byte[] data = readStream(connection.Socket);

            if (data != null)
            {
                string dataStr = Encoding.ASCII.GetString(data);

                invokeDelegate del = () =>
                {
                    logData(false, dataStr);
                };
                Invoke(del);

                data = null;
            }
        }
示例#5
0
 private void UpdateToolStrip()
 {
     if (this.InvokeRequired)
     {
         invokeDelegate updateControl = delegate() { };
         updateControl = UpdateToolStrip;
         Invoke(updateControl);
     }
     if (this.toolStrip1 != null)
     {
         string str = String.Empty;
         if (this.Pages != null)
         {
             str = String.Format(CultureInfo.CurrentCulture, "of {0}", this.Pages.Count);
         }
         this.numericToolStripTextBox2.Text = (this.pageNumber + 1).ToString(CultureInfo.CurrentCulture);
         this.pageInfoLabel.Text            = str;
     }
 }
示例#6
0
        private void _tcpServer_OnDataAvailable(TcpServerConnection connection)
        {
            byte[] data = readStream(connection.Socket);

            if (data != null)
            {
                //string dataStr = Encoding.ASCII.GetString(data);
                try
                {
                    invokeDelegate del = () =>
                    {
                        ParseSvsData(data);
                    };
                    Invoke(del);
                    data = null;
                }
                catch { }
            }
        }
示例#7
0
        private void ShowSelectedPage()
        {
            if (this.InvokeRequired)
            {
                invokeDelegate updateControl = delegate(){};
                updateControl = ShowSelectedPage;
                Invoke(updateControl);
            }
            if (this.pageNumber < this.pages.Count)
            {
                ExporterPage sp = pages[this.pageNumber];

                if (this.bitmap != null)
                {
                    this.bitmap.Dispose();
                }
                this.bitmap = this.CreateBitmap(sp);
                this.Invalidate(true);
                this.Update();
            }
            this.UpdateToolStrip();
        }
示例#8
0
        private void tcpServer1_OnConnect(tcpServer.TcpServerConnection connection)
        {
            invokeDelegate setText = () => lbconnectstate.Text = GT_DataPusher.m_object.Connections.Count > 0? "Connect" : "Not Connect";

            Invoke(setText);
        }
示例#9
0
        private void tcpServer4_OnConnect(tcpServer.TcpServerConnection connection)
        {
            invokeDelegate setText = () => lblConnected4.Text = tcpServer4.Connections.Count.ToString();

            Invoke(setText);
        }