Пример #1
0
        /// <summary>
        /// Загрузка параметров формы
        /// </summary>
        private void LoadFormSettings()
        {
            _formSettings = GenericSerializer.Deserialize <ConfiguratorFormSettings>(
                DeviceManager.GetDeviceManagerDirectory() + "\\Configurator.xml");

            Location            = _formSettings.Location;
            Size                = _formSettings.Size;
            propertyGrid.Height = _formSettings.PropertiesHeight;
            pnlConfig.Width     = _formSettings.ConfigWidth;
            splitContainer1.SplitterDistance = _formSettings.DetailedViewHeight;

            _eventsViewLink = new ListedEventsViewLink(lvLog, _formSettings.Filter,
                                                       _formSettings.Columns, true);

            _eventsViewLink.AddCommandItem(miRefresh, EventsViewCommand.Update);
            _eventsViewLink.AddCommandItem(btnRefresh, EventsViewCommand.Update);
            _eventsViewLink.AddCommandItem(cmiRefresh, EventsViewCommand.Update);
            _eventsViewLink.AddCommandItem(miDetails, EventsViewCommand.Details);
            _eventsViewLink.AddCommandItem(miFilter, EventsViewCommand.Filter);
            _eventsViewLink.AddCommandItem(btnFilter, EventsViewCommand.Filter);
            _eventsViewLink.AddCommandItem(cmiFilter, EventsViewCommand.Filter);
            _eventsViewLink.AddDetailedViewControl(textBox1);
            _eventsViewLink.SourceConnector = new LogConnector(tsslEventsReloadProgress);
            _eventsViewLink.Update();

            _srvMonitor = new ServiceMonitor("POSDeviceManager", 500);
            _srvMonitor.AppendStatus(lbSvcStatus, "Text");
            _srvMonitor.AppendEnabledWhenStarted(btnSvcStop, false);
            _srvMonitor.AppendEnabledWhenStarted(miSvcStop, false);
            _srvMonitor.AppendEnabledWhenStarted(miSvcRestart, true);
            _srvMonitor.AppendEnabledWhenStopped(btnSvcStart);
            _srvMonitor.AppendEnabledWhenStopped(miSvcStart);
            _srvMonitor.StartMonitor();
        }
Пример #2
0
        public FormMain()
        {
            InitializeComponent();

            _svcMonitor = new ServiceMonitor("TsManager");
            _svcMonitor.AppendEnabledWhenStarted(tsmiStop, false);
            _svcMonitor.AppendEnabledWhenStarted(tsbStop, false);
            _svcMonitor.AppendEnabledWhenStarted(tsmiRestart, true);
            _svcMonitor.AppendEnabledWhenStopped(tsmiStart);
            _svcMonitor.AppendEnabledWhenStopped(tsbStart);
            _svcMonitor.AppendStatus(tsslServiceStatus);
            _svcMonitor.StartMonitor();

            _logicLoader = new AMCSLogicLoader(TsGlobalConst.GetACMSLogicDirectory());

            LoadGUISettings();
            LoadSettings();
            BuildTreeFromSettings();

            _eventsViewLink = new ListedEventsViewLink(lvLog, _appSettings.FilterSettings,
                                                       _appSettings.LogColumns, true);

            _eventsViewLink.AddCommandItem(tsmiReloadEvents, EventsViewCommand.Update);
            _eventsViewLink.AddCommandItem(toolStripButton1, EventsViewCommand.Update);
            _eventsViewLink.AddCommandItem(tsmiDetails, EventsViewCommand.Details);
            _eventsViewLink.AddCommandItem(tsmiViewFilter, EventsViewCommand.Filter);
            _eventsViewLink.SourceConnector = new LogConnector(tsslUpdateProgress);
            _eventsViewLink.Update();
        }