public PVPublisherService() { InitializeComponent(); ApplicationSettings = new ApplicationSettings(); SystemServices = new MackayFisher.Utilities.SystemServices(ApplicationSettings.BuildFileName("PVPublisher.log")); ApplicationSettings.SetSystemServices(SystemServices); LoadLogSettings(); SystemServices.LogMessage("PVPublisher", "Service starting", LogEntryType.Information); }
public MainWindow() { InitializeComponent(); Subscriber = null; BrushSelected = comboBoxLocalMachines.Background; BrushAvailable = comboBoxLocalMachines2.Background; visibleDispatcherTimer = new DispatcherTimer(); visibleDispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); visibleDispatcherTimer.Interval = new TimeSpan(0, 0, 5); try { ApplicationSettings = new ApplicationSettings(); LocateOrCreateDirectory(ApplicationSettings.DefaultDirectory); SystemServices = new MackayFisher.Utilities.SystemServices(ApplicationSettings.BuildFileName("PVMonitor.log")); ApplicationSettings.SetSystemServices(SystemServices); LoadLogSettings(); Subscriber = new Subscriber.MyTransientSubscriber(SystemServices, this); expanderSettings.DataContext = Subscriber; stackPanelMain.DataContext = Subscriber; stackPanelGauges.DataContext = Subscriber; //listViewActiveEvents.ItemsSource = Subscriber.ActiveEvents; GenThreadManager = new GenThreadManager(SystemServices); ManageSubscription manageSubscription = new ManageSubscription(GenThreadManager, SystemServices, Subscriber, this); int threadId = GenThreadManager.AddThread(manageSubscription); GenThreadManager.StartThread(threadId); Rect bounds = Properties.Settings.Default.WindowPosition; this.Top = bounds.Top; this.Left = bounds.Left; } catch (Exception) { } }