示例#1
0
        public static void OpenPreferences(object sender, EventArgs e)
        {
            var serverPreferencesForm = new ServerPreferencesForm()
            {
                TopLevel = true
            };

            TraceOps.Out("result " + serverPreferencesForm.ShowDialog().ToString());
            if (serverPreferencesForm.XPos.Text != null && serverPreferencesForm.YPos.Text != null && serverPreferencesForm.Width.Text != null && serverPreferencesForm.Height.Text != null)
            {
                var xvalue = serverPreferencesForm.XPos.Text;
                var yvalue = serverPreferencesForm.YPos.Text;
                var wvalue = serverPreferencesForm.Width.Text;
                var hvalue = serverPreferencesForm.Height.Text;

                try
                {
                    ServerModel.X = Convert.ToInt32(xvalue);
                    ServerModel.Y = Convert.ToInt32(yvalue);
                    ServerModel.W = Convert.ToInt32(wvalue);
                    ServerModel.H = Convert.ToInt32(hvalue);
                }
                catch (Exception ie)
                {
                    TraceOps.Out(ie.ToString());
                }

                var p = new string[, ] {
                    { "X", xvalue }, { "Y", yvalue }, { "W", wvalue }, { "H", hvalue }
                };

                foreach (var m in from ConnectionTable.ClientInformation clientInformation in _connectionTable.GetChecked() select new Message(p, true, "set_preferences", clientInformation.GetName()))
                {
                    _messageQueue.SetMessage(m);
                }
            }
        }
示例#2
0
        public static void OpenPreferences(object sender, EventArgs e)
        {
            var serverPreferencesForm = new ServerPreferencesForm() { TopLevel = true };

            TraceOps.Out("result " + serverPreferencesForm.ShowDialog().ToString());
            if (serverPreferencesForm.XPos.Text != null && serverPreferencesForm.YPos.Text != null && serverPreferencesForm.Width.Text != null && serverPreferencesForm.Height.Text != null)
            {
                var xvalue = serverPreferencesForm.XPos.Text;
                var yvalue = serverPreferencesForm.YPos.Text;
                var wvalue = serverPreferencesForm.Width.Text;
                var hvalue = serverPreferencesForm.Height.Text;

                try
                {
                    ServerModel.X = Convert.ToInt32(xvalue);
                    ServerModel.Y = Convert.ToInt32(yvalue);
                    ServerModel.W = Convert.ToInt32(wvalue);
                    ServerModel.H = Convert.ToInt32(hvalue);
                }
                catch (Exception ie)
                {
                    TraceOps.Out(ie.ToString());
                }

                var p = new string[,] { { "X", xvalue }, { "Y", yvalue }, { "W", wvalue }, { "H", hvalue } };

                foreach (var m in from ConnectionTable.ClientInformation clientInformation in _connectionTable.GetChecked() select new Message(p, true, "set_preferences", clientInformation.GetName()))
                {
                    _messageQueue.SetMessage(m);
                }
            }
        }