private async void windowLoaded(object sender, RoutedEventArgs e) { Tx.LoadFromEmbeddedResource("osu_rank.Translation.osu_rank.txd"); if (Settings.Default.apikey == "" && Settings.Default.RippleOnly == false) { osuExpander.IsEnabled = true; hasApiKey = false; apiDialog.IsOpen = true; } else if (Settings.Default.RippleOnly == true) { osuExpander.IsEnabled = false; hasApiKey = false; drawerUnbold(); goRippleOnePlayer.FontWeight = FontWeights.SemiBold; actionBar_Text.Content = "Ripple!rank - " + Tx.T("osu rank.One player"); WindowContent.Navigate(new RipplePages.OneUser()); } else if (Settings.Default.apikey != "" && Settings.Default.RippleOnly == false) { osuExpander.IsEnabled = true; hasApiKey = true; } await checkForDictUpdate(); if (Convert.ToInt32(File.ReadAllText(osuRankAppdata + @"\txdVersion.txt")) > App.minTxdVersionRequired) { Tx.LoadFromXmlFile(osuRankAppdata + @"\osu_rank.txd"); } if (App.HasCheckedForUpdates == false) { App.HasCheckedForUpdates = true; try { string webVersion = await new HttpClient().GetStringAsync("https://raw.githubusercontent.com/Jeremiidesu/osu-rank/master/osu-rank/osu-rank/version.txt"); if (Convert.ToInt32(webVersion) > App.version) { // New release available var updateYesNo = MessageBox.Show(Tx.T("update.text"), Tx.T("update.Title"), MessageBoxButton.YesNo, MessageBoxImage.Information); if (updateYesNo == MessageBoxResult.Yes) { Process.Start("https://github.com/Jeremiidesu/osu-rank/releases"); } } } catch (Exception) { } } Ping myPing = new Ping(); string host = "osu.ppy.sh"; byte[] buffer = new byte[32]; int timeout = 5000; PingOptions pingOptions = new PingOptions(); PingReply reply = myPing.Send(host, timeout, buffer, pingOptions); if (reply.Status != IPStatus.Success) { MessageBox.Show(Tx.T("osu rank.Servers unavailable"), Tx.T("errors.Error"), MessageBoxButton.OK, MessageBoxImage.Error); Environment.Exit(0); } }
private void OK_Click(object sender, RoutedEventArgs e) { saveSettings(); #region language if (Settings.Default.LanguageCode != "") { System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo(Settings.Default.LanguageCode); } else if (Settings.Default.LanguageCode == "") { System.Threading.Thread.CurrentThread.CurrentCulture = App.systemCulture; } if (Convert.ToInt32(File.ReadAllText(osuRankAppdata + @"\txdVersion.txt")) > App.minTxdVersionRequired) { Tx.LoadFromXmlFile(osuRankAppdata + @"\osu_rank.txd"); } else { Tx.LoadFromEmbeddedResource("osu_rank.Translation.osu_rank.txd"); } #endregion if (Settings.Default.RefreshEnable == false) { AutorefreshStatus.Content = Tx.T("options.state.Disabled"); } else { AutorefreshStatus.Content = Tx.T("options.autorefresh.Delay", Convert.ToInt32(delay.Value)); } Storyboard animation = TryFindResource("settingsSaved") as Storyboard; animation.Begin(); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("ClipboardManager.Administration.Resources.ClipboardManager.Translation.txd"); containerRegistry.RegisterSingleton <ClipboardWatcher>(); containerRegistry.Register <ClipboardSynchronizer>(); }
//18> C:\Program Files (x86)\WiX Toolset v3.11\bin\Heat.exe dir ..\CodeElements.Suite\bin\Release\net47 -cg ReleaseComponents -dr INSTALLFOLDER -scom -sreg -srd -var var.BasePath -gg -sfrag -out Components.Generated.wxs //18> C:\Program Files (x86)\WiX Toolset v3.11\bin\candle.exe -dBasePath=..\CodeElements.Suite\bin\Release\net47 -d"DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\\" -dSolutionDir=F:\Projects\CodeElements\ -dSolutionExt=.sln -dSolutionFileName=CodeElements.sln -dSolutionName=CodeElements -dSolutionPath=F:\Projects\CodeElements\CodeElements.sln -dConfiguration=Debug -dOutDir=bin\Debug\ -dPlatform=x86 -dProjectDir=F:\Projects\CodeElements\src\CodeElements.Suite.Installer\ -dProjectExt=.wixproj -dProjectFileName=CodeElements.Suite.Installer.wixproj -dProjectName=CodeElements.Suite.Installer -dProjectPath=F:\Projects\CodeElements\src\CodeElements.Suite.Installer\CodeElements.Suite.Installer.wixproj -dTargetDir=F:\Projects\CodeElements\src\CodeElements.Suite.Installer\bin\Debug\ -dTargetExt=.msi -dTargetFileName=CodeElements.Suite.msi -dTargetName=CodeElements.Suite -dTargetPath=F:\Projects\CodeElements\src\CodeElements.Suite.Installer\bin\Debug\CodeElements.Suite.msi -dCodeElements.Suite.Configuration=Debug -d"CodeElements.Suite.FullConfiguration=Debug|AnyCPU" -dCodeElements.Suite.Platform=AnyCPU -dCodeElements.Suite.ProjectDir=F:\Projects\CodeElements\src\CodeElements.Suite\ -dCodeElements.Suite.ProjectExt=.csproj -dCodeElements.Suite.ProjectFileName=CodeElements.Suite.csproj -dCodeElements.Suite.ProjectName=CodeElements.Suite -dCodeElements.Suite.ProjectPath=F:\Projects\CodeElements\src\CodeElements.Suite\CodeElements.Suite.csproj -dCodeElements.Suite.TargetDir=F:\Projects\CodeElements\src\CodeElements.Suite\bin\Debug\net47\ -dCodeElements.Suite.TargetExt=.exe -dCodeElements.Suite.TargetFileName=CodeElements.Suite.exe -dCodeElements.Suite.TargetName=CodeElements.Suite -dCodeElements.Suite.TargetPath=F:\Projects\CodeElements\src\CodeElements.Suite\bin\Debug\net47\CodeElements.Suite.exe -out obj\Debug\ -arch x86 -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\\WixUIExtension.dll" Components.Generated.wxs Components.wxs Directories.wxs Product.wxs //18> C:\Program Files (x86)\WiX Toolset v3.11\bin\Light.exe -out F:\Projects\CodeElements\src\CodeElements.Suite.Installer\bin\Debug\en-us\CodeElements.Suite.msi -pdbout F:\Projects\CodeElements\src\CodeElements.Suite.Installer\bin\Debug\en-us\CodeElements.Suite.wixpdb -cultures:en-us -ext "C:\Program Files (x86)\WiX Toolset v3.11\bin\\WixUIExtension.dll" -loc Common.wxl -contentsfile obj\Debug\CodeElements.Suite.Installer.wixproj.BindContentsFileListen-us.txt -outputsfile obj\Debug\CodeElements.Suite.Installer.wixproj.BindOutputsFileListen-us.txt -builtoutputsfile obj\Debug\CodeElements.Suite.Installer.wixproj.BindBuiltOutputsFileListen-us.txt -wixprojectfile F:\Projects\CodeElements\src\CodeElements.Suite.Installer\CodeElements.Suite.Installer.wixproj obj\Debug\Components.Generated.wixobj obj\Debug\Components.wixobj obj\Debug\Directories.wixobj obj\Debug\Product.wixobj public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("Maze.Client.Administration.Resources.Maze.Client.Translation.txd"); containerRegistry.Register <IClientDeployer, DefaultClientDeployer>(nameof(DefaultClientDeployer)); containerRegistry.RegisterInstance <IWixToolRunner>(new WixToolRunner("C:\\Program Files (x86)\\WiX Toolset v3.11\\bin")); containerRegistry.Register <IMazeWixBuilder, MazeWixBuilder>(); }
public static void Main(string[] args) { // Enable translation Tx.LoadFromEmbeddedResource("fVis.Dictionary.txd"); #if DEBUG Tx.UseFileSystemWatcher = true; #endif string path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); Tx.LoadDirectory(path, "fVis"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Windows.MainWindow()); }
private static void InitializeLocalisation() { // Setup translation data try { // Set the XML file's build action to "Embedded Resource" and "Never copy" for this to work. Tx.LoadFromEmbeddedResource("Unclassified.TxEditor.Dictionary.txd"); } catch (ArgumentException) { // The file was not embedded, try reading the file. This enables file change notifications. Tx.UseFileSystemWatcher = true; Tx.LoadFromXmlFile("Dictionary.txd"); } string appCulture = App.Settings.AppCulture; if (!string.IsNullOrWhiteSpace(appCulture)) { try { Tx.SetCulture(appCulture); } catch (Exception ex) { App.ErrorMessage("The configured application UI culture cannot be set.", ex, "Setting application culture from configuration"); } } // FieldLog application error dialog localisation FL.AppErrorDialogTitle = Tx.T("fieldlog.AppErrorDialogTitle"); FL.AppErrorDialogContinuable = Tx.T("fieldlog.AppErrorDialogContinuable"); FL.AppErrorDialogTerminating = Tx.T("fieldlog.AppErrorDialogTerminating"); FL.AppErrorDialogContext = Tx.T("fieldlog.AppErrorDialogContext"); FL.AppErrorDialogLogPath = Tx.T("fieldlog.AppErrorDialogLogPath"); FL.AppErrorDialogNoLog = Tx.T("fieldlog.AppErrorDialogNoLog"); FL.AppErrorDialogConsoleAction = Tx.T("fieldlog.AppErrorDialogConsoleAction"); FL.AppErrorDialogTimerNote = Tx.T("fieldlog.AppErrorDialogTimerNote"); FL.AppErrorDialogDetails = Tx.T("fieldlog.AppErrorDialogDetails"); FL.AppErrorDialogSendLogs = Tx.T("fieldlog.AppErrorDialogSendLogs"); FL.AppErrorDialogNext = Tx.T("fieldlog.AppErrorDialogNext"); FL.AppErrorDialogTerminate = Tx.T("fieldlog.AppErrorDialogTerminate"); FL.AppErrorDialogContinue = Tx.T("fieldlog.AppErrorDialogContinue"); // Common error message box localisation App.UnexpectedError = Tx.T("msg.error.unexpected error"); App.DetailsLogged = Tx.T("msg.error.details logged"); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("Maze.Administration.ViewModels.Resources.translation.txd"); containerRegistry.RegisterSingleton <IClientManager, ClientManager>(); containerRegistry.RegisterSingleton <IXmlSerializerCache, XmlSerializerCache>(); containerRegistry.GetContainer().AsImplementedInterfaces <MazeRestClientWrapper, ContainerControlledLifetimeManager>(); var options = new ModulesOptions { LocalPath = "packages", TempPath = "temp" }; containerRegistry.RegisterInstance(options); containerRegistry.RegisterInstance <VersionFolderPathResolver>( new VersionFolderPathResolverFlat(Environment.ExpandEnvironmentVariables(options.LocalPath))); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("FileExplorer.Administration.Resources.FileExplorer.Translation.txd"); containerRegistry.RegisterSingleton <FileExplorerContextMenu>(); //containerRegistry.RegisterSingleton<ContextMenuManager, FileExplorerContextMenuManager>(); containerRegistry.GetContainer().RegisterSingleton <ContextMenuManager, FileExplorerContextMenuManager>(nameof(FileExplorerContextMenuManager)); containerRegistry.RegisterSingleton <FileExplorerListDirectoryContextMenu>(); containerRegistry.GetContainer().RegisterSingleton <ContextMenuManager, ListDirectoryContextMenuManager>(nameof(ListDirectoryContextMenuManager)); //containerRegistry.RegisterSingleton<ContextMenuManager, ListDirectoryContextMenuManager>(); containerRegistry.RegisterSingleton <FileExplorerListFileContextMenu>(); containerRegistry.RegisterSingleton <ContextMenuManager, ListFileContextMenuManager>(); containerRegistry.RegisterSingleton <VisualStudioIcons>(); containerRegistry.RegisterSingleton <IImageProvider, ImageProvider>(); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("Tasks.Infrastructure.Administration.Resources.Tasks.Infrastructure.Translation.txd"); var unityContainer = containerRegistry.GetContainer(); var currentAssembly = Assembly.GetExecutingAssembly(); unityContainer.RegisterAssemblyTypes <IPropertyEditorFactory>(currentAssembly, WithLifetime.Transient); unityContainer.RegisterType <IPropertyEditorFinder, DefaultPropertyEditorFinder>(); unityContainer.AsImplementedInterfaces <DefaultViewProvider, TransientLifetimeManager>(nameof(DefaultViewProvider)); unityContainer.AsImplementedInterfaces <PropertyGridViewProvider, TransientLifetimeManager>(nameof(PropertyGridViewProvider)); unityContainer.RegisterSingleton <ITaskComponentResolver, TaskComponentResolver>(); unityContainer.RegisterAssemblyTypes <ICommandResultViewProvider>(currentAssembly, WithLifetime.ContainerControlled); unityContainer.RegisterType <ICommandResultViewFactory, CommandResultViewFactory>(); unityContainer.RegisterSingleton <CommandExecutionManager>(); unityContainer.RegisterType <TaskActivityWatcher>(); unityContainer.RegisterSingleton <VisualStudioIcons>(); unityContainer.RegisterType <ContextMenuInitalizer>(); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("TrollCommands.Administration.Resources.TrollCommands.Translation.txd"); var unityContainer = containerRegistry.GetContainer(); var currentAssembly = Assembly.GetExecutingAssembly(); unityContainer.RegisterAssemblyTypesAsImplementedInterfaces <ITaskServiceDescription>(currentAssembly, WithLifetime.Transient); unityContainer.RegisterTypes( currentAssembly.ExportedTypes.Where(type => IsTypeImplementingInterface(type, typeof(ITaskServiceViewModel <>))), type => type.GetInterfaces().Where(x => IsTypeImplementingInterface(x, typeof(ITaskServiceViewModel <>))), null, WithLifetime.Transient); //RegisterTaskDtos unityContainer.RegisterAssemblyTypes <CommandInfo>(currentAssembly, WithLifetime.Transient); unityContainer.RegisterAssemblyTypes <TriggerInfo>(currentAssembly, WithLifetime.Transient); unityContainer.RegisterAssemblyTypes <FilterInfo>(currentAssembly, WithLifetime.Transient); unityContainer.RegisterAssemblyTypes <StopEventInfo>(currentAssembly, WithLifetime.Transient); }
public MainWindow() { // Setup logging Tx.LogFileName = "tx.log"; //Tx.LogFileName = ""; //Environment.SetEnvironmentVariable("TX_LOG_UNUSED", "1", EnvironmentVariableTarget.User); //Environment.SetEnvironmentVariable("TX_LOG_UNUSED", null, EnvironmentVariableTarget.User); // Setup translation data try { // Set the XML file's build action to "Embedded Resource" and "Never copy" for this to work. Tx.LoadFromEmbeddedResource("WpfDemo.lang.languages.txd"); } catch (ArgumentException) { // The file was not embedded, try reading the file. This enables file change notifications. Tx.UseFileSystemWatcher = true; Tx.LoadFromXmlFile(@"lang\languages.txd"); } // Simulate web environment //Tx.SetWebCulture("de-de;q=1,de-at;q=0.8,de;q=0.7,en-us;q=0.5,en;q=0.3"); //Tx.SetWebCulture("en-us;q=1,en-gb;q=0.8,en;q=0.7,de-de;q=0.5,de;q=0.3"); InitializeComponent(); //Info2Text.Text = Tx.QT("errors and warnings", "err", "5", "warn", "1"); //Info2Text.Text = Tx.Time(DateTime.Now, TxTime.fr); //Info2Text.Text = Tx.RelativeTime(DateTime.Now.AddMinutes(-4).AddSeconds(-10)); //Info2Text.Text = Tx.TimeSpan(DateTime.Now.AddMinutes(-1).AddSeconds(-10)); //Info2Text.Text = Tx.TimeSpan(TimeSpan.FromDays(3.4)); //Info2Text.Text = Tx.DataSize(123456); Info2Text.Text = Tx.T("months"); DataContext = this; }
public MainForm() { Instance = this; InitializeComponent(); // Set the XML file's build action to "Embedded Resource" and "Never copy" for this to work. Tx.LoadFromEmbeddedResource("Unclassified.LogSubmit.LogSubmit.txd"); TxDictionaryBinding.AddTextBindings(this); // Initialise views logSelectionView = new LogSelectionView(); // Read configuration file string configFile = Path.Combine( Path.GetDirectoryName(Application.ExecutablePath), "submit.config"); try { ConfigReader config = new ConfigReader(configFile); config.Read(); } catch (Exception ex) { logSelectionView.SetConfigError(ex); } // Initialise more views timeSelectionView = new TimeSelectionView(); notesView = new NotesView(); compressView = new CompressView(); transportView = new TransportView(); transportProgressView = new TransportProgressView(); views.Add(logSelectionView); views.Add(timeSelectionView); views.Add(notesView); views.Add(compressView); views.Add(transportView); views.Add(transportProgressView); // Other initialisation Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); UIPreferences.UpdateFormFont(this, Font, SystemFonts.MessageBoxFont); USizeGrip.AddToForm(this); systemMenu = new SystemMenu(this); systemMenu.AddCommand(Tx.T("menu.about"), OnSysMenuAbout, true); progressPanel = new Panel(); progressPanel.Left = 0; progressPanel.Top = 0; progressPanel.Width = 0; progressPanel.Height = 2; //progressPanel.BackColor = SystemColors.Highlight; progressPanel.BackColor = Color.Gray; Controls.Add(progressPanel); progressPanel.BringToFront(); // Parse command line arguments CommandLineReader cmdLine = new CommandLineReader(); fromErrorDlgOption = cmdLine.RegisterOption("errordlg"); fromShortcutOption = cmdLine.RegisterOption("shortcut"); logPathOption = cmdLine.RegisterOption("logpath", 1); endTimeOption = cmdLine.RegisterOption("endtime", 1); try { cmdLine.Parse(); } catch (Exception ex) { MessageBox.Show( Tx.T("msg.command line error", "msg", ex.Message), Tx.T("msg.title.error"), MessageBoxButtons.OK, MessageBoxIcon.Error); } SharedData.Instance.FromErrorDialog = fromErrorDlgOption.IsSet; SharedData.Instance.FromShortcut = fromShortcutOption.IsSet; if (logPathOption.IsSet) { try { logSelectionView.SetLogBasePath(logPathOption.Value); } catch { MessageBox.Show( Tx.T("msg.logpath parameter invalid", "value", logPathOption.Value), Tx.T("msg.title.error"), MessageBoxButtons.OK, MessageBoxIcon.Error); logSelectionView.ResetLogBasePath(); logSelectionView.FindLogBasePath(); } } else { logSelectionView.FindLogBasePath(); } if (endTimeOption.IsSet) { try { appStartTime = DateTime.Parse(endTimeOption.Value); SharedData.Instance.LastLogUpdateTime = appStartTime; } catch { MessageBox.Show( Tx.T("msg.endtime parameter invalid", "value", endTimeOption.Value), Tx.T("msg.title.error"), MessageBoxButtons.OK, MessageBoxIcon.Error); } } // Set start view SetView(logSelectionView, true); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("RegistryEditor.Administration.Resources.RegistryEditor.Translation.txd"); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("$safeprojectname$.Resources.ModuleNamePlaceholder.Translation.txd"); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("TaskManager.Administration.Resources.TaskManager.Translation.txd"); containerRegistry.RegisterSingleton <VisualStudioIcons>(); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("SystemInformation.Administration.Resources.SystemInformation.Translation.txd"); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("ClientPanel.Administration.Resources.ClientPanel.Translation.txd"); }
public void RegisterTypes(IContainerRegistry containerRegistry) { Tx.LoadFromEmbeddedResource("DeviceManager.Administration.Resources.DeviceManager.Translation.txd"); }