/// <summary> /// Создать <see cref="TargetPlatformWindow"/>. /// </summary> public TargetPlatformWindow() { InitializeComponent(); Title = TypeHelper.ApplicationNameWithVersion; var app = (BaseApplication)Application.Current; var features = new[] { new TargetPlatformFeature("Quik", Languages.Russian), new TargetPlatformFeature("SmartCOM", Languages.Russian), new TargetPlatformFeature("Plaza2", Languages.Russian), new TargetPlatformFeature("Transaq", Languages.Russian), new TargetPlatformFeature("Micex", Languages.Russian), new TargetPlatformFeature("Alfa Direct", Languages.Russian, Platforms.x86), new TargetPlatformFeature("OpenECry"), new TargetPlatformFeature("Interactive Brokers"), new TargetPlatformFeature("E*Trade"), new TargetPlatformFeature("Blackwood/Fusion"), new TargetPlatformFeature("LMAX"), new TargetPlatformFeature("IQFeed"), new TargetPlatformFeature("OANDA"), new TargetPlatformFeature("Rithmic"), new TargetPlatformFeature("FIX/FAST"), new TargetPlatformFeature("BTCE"), new TargetPlatformFeature("BitStamp"), new TargetPlatformFeature("RSS") }; _features.AddRange(features); _features.AddRange(app.ExtendedFeatures); _featuresView = (ListCollectionView)CollectionViewSource.GetDefaultView(_features); _featuresView.CustomSort = new LanguageSorter(SelectedLanguage); AppIcon = app.AppIcon; if (!Environment.Is64BitOperatingSystem) { PlatformCheckBox.IsEnabled = false; PlatformCheckBox.IsChecked = false; } else { SelectedPlatform = Platforms.x64; UpdatePlatformCheckBox(); } SelectedLanguage = LocalizedStrings.ActiveLanguage; UpdateLangButtons(); var configFile = BaseApplication.PlatformConfigurationFile; if (configFile.IsEmptyOrWhiteSpace() || !File.Exists(configFile)) return; AppStartSettings settings; if (File.ReadAllText(configFile).ContainsIgnoreCase("RefPair")) { var pair = new XmlSerializer<RefPair<Platforms, bool>>().Deserialize(configFile); settings = new AppStartSettings { Platform = pair.First, AutoStart = pair.Second, Language = Languages.Russian }; } else { settings = new XmlSerializer<AppStartSettings>().Deserialize(configFile); } SelectedPlatform = PlatformCheckBox.IsEnabled ? settings.Platform : Platforms.x86; AutoStart = settings.AutoStart; SelectedLanguage = settings.Language; UpdateLangButtons(); UpdatePlatformCheckBox(); }
/// <summary> /// Создать <see cref="TargetPlatformWindow"/>. /// </summary> public TargetPlatformWindow() { InitializeComponent(); Title = TypeHelper.ApplicationNameWithVersion; var app = (BaseApplication)Application.Current; var features = new[] { new TargetPlatformFeature("Quik", Languages.Russian), new TargetPlatformFeature("SmartCOM", Languages.Russian), new TargetPlatformFeature("Plaza2", Languages.Russian), new TargetPlatformFeature("Transaq", Languages.Russian), new TargetPlatformFeature("Micex", Languages.Russian), new TargetPlatformFeature("Alfa Direct", Languages.Russian, Platforms.x86), new TargetPlatformFeature("OpenECry"), new TargetPlatformFeature("Interactive Brokers"), new TargetPlatformFeature("E*Trade"), new TargetPlatformFeature("Blackwood/Fusion"), new TargetPlatformFeature("LMAX"), new TargetPlatformFeature("IQFeed"), new TargetPlatformFeature("OANDA"), new TargetPlatformFeature("Rithmic"), new TargetPlatformFeature("FIX/FAST"), new TargetPlatformFeature("BTCE"), new TargetPlatformFeature("BitStamp"), new TargetPlatformFeature("RSS") }; _features.AddRange(features); _features.AddRange(app.ExtendedFeatures); _featuresView = (ListCollectionView)CollectionViewSource.GetDefaultView(_features); _featuresView.CustomSort = new LanguageSorter(SelectedLanguage); AppIcon = app.AppIcon; if (!Environment.Is64BitOperatingSystem) { PlatformCheckBox.IsEnabled = false; PlatformCheckBox.IsChecked = false; } else { SelectedPlatform = Platforms.x64; UpdatePlatformCheckBox(); } SelectedLanguage = LocalizedStrings.ActiveLanguage; UpdateLangButtons(); var configFile = BaseApplication.PlatformConfigurationFile; if (configFile.IsEmptyOrWhiteSpace() || !File.Exists(configFile)) { return; } AppStartSettings settings; if (File.ReadAllText(configFile).ContainsIgnoreCase("RefPair")) { var pair = new XmlSerializer <RefPair <Platforms, bool> >().Deserialize(configFile); settings = new AppStartSettings { Platform = pair.First, AutoStart = pair.Second, Language = Languages.Russian }; } else { settings = new XmlSerializer <AppStartSettings>().Deserialize(configFile); } SelectedPlatform = PlatformCheckBox.IsEnabled ? settings.Platform : Platforms.x86; AutoStart = settings.AutoStart; SelectedLanguage = settings.Language; UpdateLangButtons(); UpdatePlatformCheckBox(); }