public MainForm() : base() { InitializeComponent(); this.Icon = Properties.Resources.asset_icon; ShowAll(); liveBox = new LiveBox(this); munisToolBar = new CustomControls.MunisToolBar(this); windowList = new CustomControls.WindowList(this); DateTimeLabel.Text = DateTime.Now.ToString(); ToolStrip1.BackColor = Colors.AssetToolBarColor; ResultGrid.DoubleBuffered(true); CheckForAdmin(); GetGridStyles(); WatchdogInstance.Watchdog.StatusChanged += WatchdogStatusChanged; WatchdogInstance.Watchdog.RebuildCache += WatchdogRebuildCache; WatchdogInstance.Watchdog.WatcherTick += WatchdogTick; WatchdogInstance.Watchdog.StartWatcher(GlobalSwitches.CachedMode); munisToolBar.InsertMunisDropDown(ToolStrip1, 2); windowList.InsertWindowList(ToolStrip1); InitLiveBox(); InitDBControls(); Clear_All(); ShowTestDBWarning(); InitDBCombo(); }
public ViewDeviceForm(ExtendedForm parentForm, MappedObject device, bool startHidden = false) : base(parentForm, device, startHidden) { currentViewDevice = (Device)device; InitializeComponent(); InitDBControls(); controlParser = new DBControlParser(this); controlParser.EnableFieldValidation(); defaultFormTitle = this.Text; liveBox = new LiveBox(this); liveBox.AttachToControl(CurrentUserTextBox, DevicesCols.CurrentUser, LiveBoxSelectAction.UserSelect, DevicesCols.MunisEmpNum); liveBox.AttachToControl(DescriptionTextBox, DevicesCols.Description, LiveBoxSelectAction.SelectValue); munisToolBar = new MunisToolBar(this); munisToolBar.InsertMunisDropDown(ToolStrip1, 6); windowList = new WindowList(this); windowList.InsertWindowList(ToolStrip1); statusSlider = new SliderLabel(); statusSlider.FlashStripOnNewMessage = true; StatusStrip.Items.Add(statusSlider.ToToolStripControl(StatusStrip)); RefreshCombos(); DataGridHistory.DoubleBuffered(true); TrackingGrid.DoubleBuffered(true); SetEditMode(false); LoadCurrentDevice(); WatchdogInstance.Watchdog.StatusChanged += Watchdog_StatusChanged; if (!startHidden) { this.Show(); } else { // Let the base class know that the hidden form is ready. // Since no load event occurs, we need someway to notify // when all the components are instantiated and populated. base.HiddenFormReady(); } }