Пример #1
0
        public UndefineDlg(DebugServerFrame frame)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            _frame = frame;
        }
Пример #2
0
        private void DeviceVisibleChanged(object sender, EventArgs e)
        {
            DebugServerFrame device = (DebugServerFrame)sender;

            DataRow row = _applianceTable.Rows.Find(device);

            row.BeginEdit();
            row["Visible"] = device.Visible;
            row.EndEdit();

            _applianceTable.AcceptChanges();
        }
Пример #3
0
        protected void addAppliance(string filename)
        {
            DebugServerFrame frame =
                new DebugServerFrame(filename, _portCounter++);

            frame.Show();

            frame.VisibleChanged += new EventHandler(DeviceVisibleChanged);

            DataRow row = _applianceTable.NewRow();

            row["DeviceObject"] = frame;
            row["Device"]       = frame.ApplianceName;
            row["Status"]       = frame.Status;
            row["Port"]         = frame.Port;
            row["Active"]       = false;
            row["Visible"]      = frame.Visible;

            _applianceTable.Rows.Add(row);
            _applianceTable.AcceptChanges();

            _server.AddDevice(frame);

            string serverString = Path.GetFullPath(filename);

            DataStore store = Globals.GetDataStore();

            int count = store.GetIntData(Globals.RECENT_COUNT_ATTR);
            int max   = store.GetIntData(Globals.RECENT_SERVER_ATTR);

            store.BeginSet();

            string[] servers = new string[count];
            for (int i = 0; i < count; i++)
            {
                servers[i] = store.GetStringData(Globals.RECENT_SERVER_PRFX + i);
            }

            int idx = 0;

            for ( ; idx < count; idx++)
            {
                if (serverString == servers[idx])
                {
                    break;
                }
            }

            for (int i = idx; i > 0; i--)
            {
                string lastServer = store.GetStringData(Globals.RECENT_SERVER_PRFX + (i - 1));
                store.Set(Globals.RECENT_SERVER_PRFX + i, lastServer);
            }

            store.Set(Globals.RECENT_SERVER_PRFX + 0, serverString);

            if (count < max && idx == count)
            {
                store.Set(Globals.RECENT_COUNT_ATTR, count + 1);
            }

            store.CommitSet();
        }
Пример #4
0
        /*
         * Constructor
         */

        public DebugConnection(DebugServerFrame frame)
        {
            _frame = frame;
        }