Inheritance: ListBox.ObjectCollection
        public WebSocketApp()
        {
            InitializeComponent();
            Application.ApplicationExit += AppExit;
            // Create the thread object. This does not start the thread.
            workerThread = new Thread(DoWork);
            // Start the worker thread.
            workerThread.Start();

            for (int x = 0; x < ConnectedSocketClient.Length; x++)
            {
                ConnectedSocketClient[x] = new Socket[100];
            }
                serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
                serverSocket.Bind(new IPEndPoint(IPAddress.Any, 8080));
                serverSocket.Listen(128);
                dataBuffer = new byte[BUFFER_SIZE];
                dataString = new StringBuilder();
                webSocketOrigin = "http://10.75.15.10";
                webSocketLocation = "ws://10.75.15.10:8080/chat";
                ListenForClients();
                ServerMessage.AppendText("Server Listing on 8080");
                Console.WriteLine("main thread: Starting worker thread...");
                item = Room_1.Items;
               
        }
Beispiel #2
0
        public Server()
        {
            InitializeComponent();
            Form Active = Form.ActiveForm;
            Active.FormClosed += AppExit;
            // Create the thread object. This does not start the thread.
            workerThread = new Thread(DoWork);
            // Start the worker thread.
            workerThread.Start();
            serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
            serverSocket.Bind(new IPEndPoint(IPAddress.Any, 8080));
            serverSocket.Listen(128);
            dataBuffer = new byte[BUFFER_SIZE];
            dataString = new StringBuilder();
            ListenForClients();
            ServerMessage.AppendText("Server Listing on 8080");
            Console.WriteLine("main thread: Starting worker thread...");
            item = Room_1.Items;


        }
        private void avgModeCheckboxChanged(object sender, EventArgs e)
        {
            if(AvgRadioButton.Checked)
            {
                AvgRadioButton.BackColor = Color.FromArgb(144, 195, 212);
                //avg urobit, ak neexistuje DataTable, vytvorit, inak iba prepnut.
                if (avgDataTable == null)
                {
                    DbCommunication db = new DbCommunication();
                    avgDataTable = db.meranieAvg(header_id).Tables[0];
                    avgItems = new CheckedListBox.ObjectCollection(checkedListBoxInclude);
                    foreach(DataColumn columnHeader in avgDataTable.Columns)
                    {
                        avgItems.Add(columnHeader.ToString());
                    }
                }
                dataMeranie.DataSource = avgDataTable;
                refreshIncludeColumns(avgItems);
                checkedListBoxCyklyInclude.Enabled = false;
                checkBoxCyklyAllInclude.Enabled = false;

            }
            else
            {
                AvgRadioButton.BackColor = default(Color);
            }
        }
        private void init()
        {
            DbCommunication db = new DbCommunication();

            normalDataTable = db.meranie(header_id).Tables[0];
            dataMeranie.DataSource = normalDataTable;
            header = db.header(header_id);

            normalItems = new CheckedListBox.ObjectCollection(checkedListBoxInclude);

            for (int c = 0; c < dataMeranie.Columns.Count; c++)
            {
                dataMeranie.Columns[c].SortMode = DataGridViewColumnSortMode.NotSortable;
                dataMeranie.Columns[c].Visible = false;
                normalItems.Add(dataMeranie.Columns[c].HeaderText);
            }

            refreshIncludeColumns(normalItems);

            checkedListBoxInclude.SetItemChecked(0, true);
            checkedListBoxInclude.SetItemChecked(2, true);
        }