public ApplicationViewModel(IReceiverModule MulticastReceiver, IReceiverModule UnicastReceiver, int BufferLength, int RefreshDelay) { this.bufferLength = BufferLength; Clients = new ObservableCollection <ClientViewModel>(); this.multicastReceiver = MulticastReceiver; this.unicastReceiver = UnicastReceiver; timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(RefreshDelay); timer.Tick += Timer_Tick; timer.Start(); }
public MainWindow() { logger = new FileLogger(new DefaultLogFormatter(), "LogReceiver.log"); multicastReceiverModule = new MulicastReceiverModule(logger, IPAddress.Parse(global::LogReceiver.Properties.Settings.Default.MulticastIPaddress), global::LogReceiver.Properties.Settings.Default.MulticastPort); unicastReceiverModule = new UnicastReceiverModule(logger, global::LogReceiver.Properties.Settings.Default.UnicastPort); applicationViewModel = new ApplicationViewModel(multicastReceiverModule, unicastReceiverModule, global::LogReceiver.Properties.Settings.Default.BufferLength, global::LogReceiver.Properties.Settings.Default.RefreshDelay); InitializeComponent(); DataContext = applicationViewModel; //multicastReceiverModule.Start(); //unicastReceiverModule.Start(); }