public static UserControl CreateView(string value) { switch (value.ToString()) { case "Triggered by Battery Percent Changes": if (_batteryPercentView == null) { _batteryPercentView = new BatteryPercentView(); } return(_batteryPercentView); case "Triggered by Day Changes": if (_dayView == null) { _dayView = new DayView(); } return(_dayView); case "Triggered by Directory Changes": if (_dirView == null) { _dirView = new DirectoryView(); } return(_dirView); case "Triggered by File Changes": if (_fileView == null) { _fileView = new FileView(); } return(_fileView); case "Triggered by Internet Connectivity": if (_netView == null) { _netView = new NetConnectivityView(); } return(_netView); case "Triggered by Process": if (_procView == null) { _procView = new ProcessView(); } return(_procView); case "Triggered by Timezone Changes": if (_tzView == null) { _tzView = new TimeZoneView(); } return(_tzView); } return(null); }
public void SerializeTimeZoneView() { TimeZoneView input = TimeZoneView.Local; _serializer.Save(Call, input); TimeZoneView output = _serializer.Load <TimeZoneView>(Call); Assert.AreEqual(input.Abbreviation, output.Abbreviation); Assert.AreEqual(input.Name, output.Name); Assert.AreEqual(input.TimeZoneInfo, output.TimeZoneInfo); }
private void ProcessOpenView(OpenWindowMessage msg) { var view = new TimeZoneView() { DataContext = msg.DataContext }; view.BorderThickness = new Thickness(1); view.GlowBrush = null; view.SetResourceReference(MetroWindow.BorderBrushProperty, "AccentColorBrush"); view.ShowDialog(); }