/// <summary> /// Экспортирует массив данных в XLSX формат с учетом выбранной локали /// </summary> /// <param name="path">Путь к файлу, в который нужно сохранить данные</param> /// <param name="localisation">Локализация</param> /// <returns>Успешное завершение операции</returns> public override bool Export(String path, Localisation localisation) { try { if (!path.EndsWith(".xlsx")) path += ".xlsx"; log.Info(String.Format("Export to .xlsx file to: {0}", path)); var timer = new Stopwatch(); timer.Start(); var file = new FileInfo(path); using (var pck = new ExcelPackage(file)) { ExcelWorksheet ws = pck.Workbook.Worksheets.Add("Sheet1"); ws.Cells["A1"].LoadFromDataTable(dataTable, true); ws.Cells.AutoFitColumns(); pck.Save(); } timer.Stop(); log.Info(String.Format("Export complete! Elapsed time: {0} ms", timer.Elapsed.Milliseconds)); return true; } catch (Exception ex) { log.Error("Can't export to .xlsx file!", ex); return false; } }
/// <summary> /// Экспортирует массив данных в CSV формат с учетом выбранной локали /// </summary> /// <param name="path">Путь к файлу, в который нужно сохранить данные</param> /// <param name="localisation">Локализация</param> /// <returns>Успешное завершение операции</returns> public override bool Export(String path, Localisation localisation) { try { if (!path.EndsWith(".csv")) path += ".csv"; Thread.CurrentThread.CurrentCulture = new CultureInfo((int)localisation); log.Info(String.Format("Export to .csv file to: {0}", path)); var timer = new Stopwatch(); timer.Start(); using (var streamWriter = new StreamWriter(path)) using (var writer = new CsvWriter(streamWriter)) { writer.ValueSeparator = Thread.CurrentThread.CurrentCulture.TextInfo.ListSeparator[0]; dataTable.WriteCsv(writer); } timer.Stop(); log.Info(String.Format("CSV export complete! Elapsed time: {0} ms", timer.Elapsed.Milliseconds)); return true; } catch (Exception ex) { log.Error("Can't export to .csv file!", ex); return false; } }
public Localisation getDernierLocalisation(int idParticipant) { string requete = "Select * from Localisation WHERE idParticipant =" + idParticipant + " And date_actuelle = (Select Max(date_actuelle) From Localisation Where idParticipant = " + idParticipant + ")"; MySqlCommand cmd = new MySqlCommand(requete, conn); MySqlDataReader rdr = cmd.ExecuteReader(); rdr.Read(); Localisation l = new Localisation(rdr[1].ToString(), rdr[2].ToString(), rdr[3].ToString(), rdr[4].ToString(), Convert.ToInt16(rdr[5].ToString())); return(l); }
public void OnQuit() { if (HasChanges() || _timelineEditor.HasChanges()) { if (EditorUtility.DisplayDialog("State Machine Has Been Modified", "Do you want to save the changes you made to the state machine:\n\n" + StringUtils.GetAssetPath(_currentFileName) + "\n\nYour changes will be lost if you don't save them.", "Save", "Don't Save")) { Save(); } } Localisation.WarnIfDirty(); }
public MainForm() { InitializeComponent(); Province.SetBasePath(basePath); State.SetBasePath(basePath); Country.SetBasePath(basePath); Localisation.SetBasePath(basePath); resourceManager = new ResourceManager(basePath); resultDialog = new ResultDialog(); Reload(); }
private async Task CheckIfTokenIsActivatedAsync() { if (await VIEW_MODEL.CheckIfTokenIsActivatedAsync()) { OnTokenActivated(); } else { statusBannerText.Text = Localisation.GetLocalizedString("SetupPage_TokenActivationFailed"); info_ian.Show(); } }
/// <summary> /// Converts the entity into a domain model. /// </summary> /// <returns>The domain model.</returns> /// <param name="entity">Localisation entity.</param> internal static Localisation ToDomainModel(this LocalisationEntity entity) { Localisation model = new Localisation { Unknown1 = entity.Unknown1, Unknown2 = entity.Unknown2, Unknown3 = entity.Unknown3, Entries = entity.Entries.ToDomainModels().ToList() }; return(model); }
private string GetValue(string component) { if (string.IsNullOrEmpty(component)) { return(null); } if (_keys) { return(Localisation.Map(component)); } return(component); }
/// <summary> /// Converts the domain model into an entity. /// </summary> /// <returns>The entity.</returns> /// <param name="model">Localisation.</param> internal static LocalisationEntity ToEntity(this Localisation model) { LocalisationEntity entity = new LocalisationEntity { Unknown1 = model.Unknown1, Unknown2 = model.Unknown2, Unknown3 = model.Unknown3, Entries = model.Entries.ToEntities().ToList() }; return(entity); }
private void DeleteSelected() { for (int i = 0; i < _editorPrefs._selectedKeys.Length; i++) { Localisation.Remove(_editorPrefs._selectedKeys[i]); } UpdateKeys(); _editorPrefs._selectedKeys = new string[0]; SaveEditorPrefs(); _needsRepaint = true; }
private void DuplicateSelected() { if (!string.IsNullOrEmpty(_editorPrefs._selectedKey)) { string newKey = _editorPrefs._selectedKey + " (Copy)"; Localisation.Set(newKey, Localisation.GetCurrentLanguage(), Localisation.GetRawString(_editorPrefs._selectedKey)); _keys = GetKeys(); SelectKey(newKey); _needsRepaint = true; } }
private async Task RequestTokenAsync() { if (await VIEW_MODEL.RequestNewTokenAsync()) { UpdateViewState(State_2); } else { statusBannerText.Text = Localisation.GetLocalizedString("SetupPage_RequestTokenFailed"); info_ian.Show(); } }
public void Initialize(int id) { title.GetComponent <Text>().text = Localisation.Translate(name, true); GetComponent <Button>().onClick.AddListener(delegate { LevelManager.Load(id); }); int scoreValue = LevelManager.GetScoreForID(id); if (scoreValue > 0) { score.GetComponentInChildren <Text>().text = scoreValue.ToString(); score.SetActive(true); } }
private void updatetopspeedvalue() { switch (this.parent.SpeedUnits) { case Speed.MPH: this.parent.UpdateTopSpeedLabel(Localisation.ToMPH(this.topspeed.Speed).ToString()); break; case Speed.KPH: this.parent.UpdateTopSpeedLabel(Localisation.ToKPH(this.topspeed.Speed).ToString()); break; } }
public void OnLocationChanged(Location p_location) { if (p_location != null) { Localisation location = new Localisation(); location.Latitude = (float )p_location.Latitude; location.Longitude = (float)p_location.Longitude; Initialisation BDD = new Initialisation(); BDD.DBConnection(); BDD.BDDConnection.InsertOrIgnore(location); BDD.BDDConnection.Close(); } }
private void Awake() { if (instance != null) { Destroy(this); } else { instance = this; } if (!FirebaseCommunicator.instance.IsLoggedIn) { menuObject.SetActive(false); askForIDParent.SetActive(true); FirebaseCommunicator.LoggedIn.AddListener(() => { ShowMenuScreen(); FirebaseCommunicator.instance.StartGame(); }); } else { ShowMenuScreen(); } // GameManager.NoMissionExists.AddListener(OnNoMissionExists); GameManager.NewMissionAdded.AddListener(OnNewMissionAdded); if (Localisation.currentLanguage == Language.Portuguese) { portugueseToggle.isOn = true; } portugueseToggle.onValueChanged.AddListener((isOn) => { if (isOn) { Localisation.SetLanguage(Language.Portuguese); } }); englishToggle.onValueChanged.AddListener((isOn) => { if (isOn) { Localisation.SetLanguage(Language.English); } }); }
private void RenderBottomBar() { EditorGUILayout.Separator(); EditorGUILayout.BeginHorizontal(GUILayout.Height(kBottomBarHeight)); { if (GUILayout.Button("Add New", EditorStyles.toolbarButton, GUILayout.Width(_editorPrefs._keyWidth))) { if (!Localisation.Exists(_addNewKey) && !string.IsNullOrEmpty(_addNewKey)) { Localisation.Set(_addNewKey, Localisation.GetCurrentLanguage(), string.Empty); _keys = GetKeys(); SelectKey(_addNewKey); _addNewKey = ""; } } string[] folders = Localisation.GetStringFolders(); int currentFolderIndex = 0; string keyWithoutFolder; Localisation.GetFolderIndex(_addNewKey, out currentFolderIndex, out keyWithoutFolder); EditorGUI.BeginChangeCheck(); int newFolderIndex = EditorGUILayout.Popup(currentFolderIndex, folders); string currentFolder = newFolderIndex == 0 ? "" : folders[newFolderIndex]; if (EditorGUI.EndChangeCheck()) { if (newFolderIndex != 0) { _addNewKey = currentFolder + "/" + keyWithoutFolder; } } EditorGUILayout.LabelField("/", GUILayout.Width(8)); if (newFolderIndex != 0) { keyWithoutFolder = EditorGUILayout.TextField(keyWithoutFolder); _addNewKey = currentFolder + "/" + keyWithoutFolder; } else { _addNewKey = EditorGUILayout.TextField(_addNewKey); } GUILayout.FlexibleSpace(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Separator(); }
/// <summary> /// Экспортирует массив данных в ARFF формат с учетом выбранной локали /// </summary> /// <param name="path">Путь к файлу, в который нужно сохранить данные</param> /// <param name="localisation">Локализация</param> /// <returns>Успешное завершение операции</returns> public override bool Export(String path, Localisation localisation) { try { if (!path.EndsWith(".arff")) path += ".arff"; Thread.CurrentThread.CurrentCulture = new CultureInfo((int)localisation); log.Info(String.Format("Export to .arff file to: {0}", path)); var timer = new Stopwatch(); timer.Start(); using (var writer = new StreamWriter(path)) { writer.WriteLine("@RELATION iris"); foreach (var column in dataTable.Columns.Cast<DataColumn>()) { if (column.DataType == typeof(double)) { writer.WriteLine(String.Format("@ATTRIBUTE \"{0}\" NUMERIC", column.ColumnName)); } else if (column.DataType == typeof(DateTime)) { string dateFormat = Thread.CurrentThread.CurrentCulture.DateTimeFormat.FullDateTimePattern; writer.WriteLine(String.Format("@ATTRIBUTE \"{0}\" DATE [{1}]", column.ColumnName, dateFormat)); } else { writer.WriteLine(String.Format("@ATTRIBUTE \"{0}\" STRING", column.ColumnName)); } } string listSeparator = Thread.CurrentThread.CurrentCulture.TextInfo.ListSeparator; writer.WriteLine("@DATA"); foreach (DataRow row in dataTable.Rows) writer.WriteLine(String.Join(listSeparator, row.ItemArray)); } timer.Stop(); log.Info(String.Format("ARFF export complete! Elapsed time: {0} ms", timer.Elapsed.Milliseconds)); return true; } catch (Exception ex) { log.Error("Can't export to .arff file!", ex); return false; } }
public Localisation GetTitleLocalisation(string titleId, string languageGameId, string game) { IList <Localisation> localisations = new List <Localisation>(); Title title = titles[titleId]; if (title.IsEmpty()) { return(null); } Language language = languages.Values. First(lang => lang.GameIds.Any(langGameId => langGameId.Game == game && langGameId.Id == languageGameId)); List <string> titleIdsToCheck = new List <string>() { title.Id }; List <string> languageIdsToCheck = new List <string>() { language.Id }; titleIdsToCheck.AddRange(title.FallbackTitles); languageIdsToCheck.AddRange(language.FallbackLanguages); foreach (string titleIdToCheck in titleIdsToCheck) { foreach (string languageIdToCheck in languageIdsToCheck) { foreach (Name name in titles[titleIdToCheck].Names) { if (name.LanguageId == languageIdToCheck) { Localisation localisation = new Localisation(); localisation.Id = titleIdToCheck; localisation.LanguageId = languageIdToCheck; localisation.Name = name.Value; localisation.Adjective = name.Adjective; localisation.Comment = name.Comment; return(localisation); } } } } return(null); }
void OnDestroy() { if (Localisation.HasUnsavedChanges()) { if (EditorUtility.DisplayDialog("Localisation Table Has Been Modified", "Do you want to save the changes you made to the table?\nYour changes will be lost if you don't save them.", "Save", "Don't Save")) { Localisation.SaveStrings(); } else { Localisation.LoadStrings(); } } }
public override DataItem LoadData(XElement element, UndoRedoManager undoRedo) { var item = new MultilineStringItem(this, undoRedo); if (ElementPerLine) { item.Value = string.Join(Seperator, element.Elements().Select((e) => e.Value.ToString())); } else { if (NeedsLocalisation) { var id = element.Value; try { item.LocalisationID = id; item.Value = Localisation.GetLocalisation(LocalisationFile, id); } catch (Exception) { // fallback to assuming the text was in the element item.LocalisationID = null; item.Value = id; } } else { item.Value = element.Value; } } foreach (var att in Attributes) { var el = element.Attribute(att.Name); DataItem attItem = null; if (el != null) { attItem = att.LoadData(new XElement(el.Name, el.Value.ToString()), undoRedo); } else { attItem = att.CreateData(undoRedo); } item.Attributes.Add(attItem); } return(item); }
public static void addLocalisation(Localisation localisation) { string host = "163.172.144.237"; string elementKey = "master123"; using (RedisClient redisClient = new RedisClient(host, 6379, elementKey)) { IRedisTypedClient <Localisation> localisationRedis = redisClient.As <Localisation>(); IRedisList <Localisation> listUser = localisationRedis.Lists[$"Localisation:{localisation.pseudo}"]; //expire list 5h redisClient.Custom("EXPIRE", $"Localisation:{localisation.pseudo}", "18000"); listUser.Add(localisation); } }
private void OnEnable() { // exitButton.gameObject.SetActive(true); foreach (Transform child in layoutGroup) { Destroy(child.gameObject); } foreach (var characterClass in possibleStartingClasses) { var classSelect = Instantiate(classSelectButton, layoutGroup); var toggle = classSelect.GetComponent <Toggle>(); if (!characterClass.Unlocked) { classSelect.Init(characterClass.ClassName, lockedClassSprite, lockedIconColor); toggle.interactable = false; } else { classSelect.Init(characterClass.ClassName, characterClass.initialWeapon.GetComponentInChildren <SpriteRenderer>().sprite); toggle.interactable = true; if (GameManager.instance.currentSelectedClass == characterClass) { toggle.isOn = true; } } toggle.group = layoutGroup.GetComponent <ToggleGroup>(); toggle.onValueChanged.AddListener((isOn) => { if (isOn) { LogsManager.SendLogDirectly(new Log( LogType.ClassSelected, new Dictionary <string, string>() { { "Class", characterClass.ClassName } } )); GameManager.instance.currentSelectedClass = characterClass; } }); } classSelectTitleText.text = Localisation.Get(classSelectTitleTextKey); }
private object GetScalar <T>(string name, T defaultValue) { //Get the raw registry value object rawResult = Key.GetValue(name, null); if (rawResult == null) { return(defaultValue); } //Check if it is a serialised object byte[] resultArray = rawResult as byte[]; if (resultArray != null) { using (MemoryStream stream = new MemoryStream(resultArray)) try { BinaryFormatter formatter = new BinaryFormatter(); if (typeof(T) != typeof(object)) { formatter.Binder = new TypeNameSerializationBinder(typeof(T)); } return((T)formatter.Deserialize(stream)); } catch (InvalidCastException) { Key.DeleteValue(name); MessageBox.Show(S._("Could not load the setting {0}\\{1}. The " + "setting has been lost.", Key, name), S._("Eraser"), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, Localisation.IsRightToLeft(null) ? MessageBoxOptions.RtlReading : 0); } } else if (typeof(T) == typeof(Guid)) { return(new Guid((string)rawResult)); } else if (typeof(T).GetInterfaces().Any(x => x == typeof(IConvertible))) { return(Convert.ChangeType(rawResult, typeof(T))); } else { return(rawResult); } return(defaultValue); }
private void русскийRUToolStripMenuItem_Click(object sender, EventArgs e) { if (Localisation.GetInstance().Language.Equals("RU")) { return; } Localisation.GetInstance().Language = "RU"; this.Text = "РЕКОМЕНДАЦИИ ПО УСТРАНЕНИЮ ОШИБОК"; граничащиеПараметрыToolStripMenuItem.Text = "НАСТРОЙКИ ПАРАМЕТРОВ"; спрToolStripMenuItem.Text = "СПРАВКА НЕШТАТНЫХ СИТУАЦИЙ"; трендыToolStripMenuItem.Text = "ТРЕНДЫ"; сменитьЯзыкToolStripMenuItem.Text = "СМЕНИТЬ ЯЗЫК"; создатьОтчетToolStripMenuItem.Text = "СОЗДАТЬ ОТЧЕТ"; recountToolStripMenuItem.Text = "ПЕРЕСЧИТАТЬ"; граничащиеПараметрыToolStripMenuItem1.Text = "ГРАНИЧАЩИЕ ПАРАМЕТРЫ"; чисткаЭкструдераToolStripMenuItem.Text = "ЧИСТКА ЭКСТРУДЕРА"; алгоритмыНСToolStripMenuItem.Text = "АЛГОРИТМЫ НС"; groupBox1.Text = "ПРОВЕРКА НА ОШИБКИ"; groupBox6.Text = "НАЙДЕНЫЕ ОШИБКИ"; groupBox7.Text = "КОД/ТИП НЕШТАТНОЙ СИТУАЦИИ"; groupBox8.Text = "НЕШТАТНЫЕ СИТУАЦИИ"; groupBox3.Text = "ПРИЧИНА"; groupBox4.Text = "ДЕЙСТВИЕ НА ПРИЧИНУ"; groupBox5.Text = "КОНТРОЛИРУЕМЫЕ ПАРАМЕТРЫ"; groupBox2.Text = "ПОСЛЕДНЯЯ ЧИСТКА ЭКСТРУДЕРА"; label3.Text = "ДАТА:"; label4.Text = "ПРОЧИСТКА:"; errorsNamesDataGridView.Columns["Column1"].HeaderText = "КОД"; errorsNamesDataGridView.Columns["Column2"].HeaderText = "ТИП"; findingErrorsDataGridView.Columns["Code"].HeaderText = "КОД ОШИБКИ"; findingErrorsDataGridView.Columns["Name"].HeaderText = "ПРИЧИНА"; findingErrorsDataGridView.Columns["Param"].HeaderText = "НАЗВАНИЕ ПАРАМЕТРА"; findingErrorsDataGridView.Columns["ParamValue"].HeaderText = "ВРЕМЯ ВОЗНИКНОВЕНИЯ"; Errors(); FindErrors(); ChangeFindingErrorsLanguage(); ExtruderCleaning(); }
private void englishENToolStripMenuItem_Click(object sender, EventArgs e) { if (Localisation.GetInstance().Language.Equals("EN")) { return; } Localisation.GetInstance().Language = "EN"; this.Text = "EMERGENCY SITUATION RECOMMENDATIONS"; граничащиеПараметрыToolStripMenuItem.Text = "PARAMETERS SETTINGS"; спрToolStripMenuItem.Text = "E.S. HELP"; трендыToolStripMenuItem.Text = "TRENDS"; сменитьЯзыкToolStripMenuItem.Text = "LANGUAGE"; создатьОтчетToolStripMenuItem.Text = "CREATE REPORT"; recountToolStripMenuItem.Text = "RECOUNT"; граничащиеПараметрыToolStripMenuItem1.Text = "BORDER PARAMETERS"; чисткаЭкструдераToolStripMenuItem.Text = "CLEANING THE EXTRUDER"; алгоритмыНСToolStripMenuItem.Text = "ES ALGORITHMS"; groupBox1.Text = "CHECK FOR ERRORS"; groupBox6.Text = "FOUND ERRORS"; groupBox7.Text = "CODE/TYPE OF EMERGENCY SITUATION"; groupBox8.Text = "EMERGENCY SITUATIONS"; groupBox3.Text = "REASON"; groupBox4.Text = "ACTION FOR THE REASON"; groupBox5.Text = "CONTROLLED PARAMETERS"; groupBox2.Text = "LAST CLEANING OF THE EXTRUDER"; label3.Text = "DATE:"; label4.Text = "CLEAR:"; errorsNamesDataGridView.Columns["Column1"].HeaderText = "ERROR CODE"; errorsNamesDataGridView.Columns["Column2"].HeaderText = "TYPE"; findingErrorsDataGridView.Columns["Code"].HeaderText = "ERROR CODE"; findingErrorsDataGridView.Columns["Name"].HeaderText = "REASON"; findingErrorsDataGridView.Columns["Param"].HeaderText = "PARAMETER NAME"; findingErrorsDataGridView.Columns["ParamValue"].HeaderText = "TIME OF OCCURANCE"; Errors(); FindErrors(); ChangeFindingErrorsLanguage(); ExtruderCleaning(); }
public void Render(Render render) { Version.Draw(render); _nameInput.Draw(render); _nameLabel.Draw(render); _buttonCreatePerson.Draw(render); render.Start(); render.DrawString(Program.Game.Font1, Localisation.GetName("tip0"), new Vector2(150, 180), Color.Black); render.DrawString(Program.Game.Font1, Localisation.GetName("tip1"), new Vector2(150, 200), Color.Black); Program.Game.PlayerRender(2); Program.Game.PlayerRenderTexture(Program.Game.Slots[_currentSlot], 2); render.End(); _image.Draw(render); }
public string GetLocalisedString(params LocalisationLocalVariable[] variables) { if (variables.Length > 0 || _cachedLanguage != Localisation.GetCurrentLanguage() || Localisation.AreGlobalVariablesOutOfDate(_cachedVariables) #if UNITY_EDITOR || !Application.isPlaying #endif ) { _cachedLanguage = Localisation.GetCurrentLanguage(); _cachedText = Localisation.Get(_localisationKey, variables); _cachedVariables = Localisation.GetGlobalVariables(_cachedText); } return(_cachedText); }
/// <summary> /// Function for converting the <c>float</c> representation of complexity into a human-readable one. /// <c>Localisation</c> is performed to get the text in a given language. /// </summary> /// <param name="complexity">The level 'complexity'</param> /// <returns>A text-representation of the complexity</returns> private string ComplexityAsString(float complexity) { if (complexity < 0.3f) { return(Localisation.Translate("easy")); } else if (complexity > 0.7f) { return(Localisation.Translate("hard")); } else { return(Localisation.Translate("intermediate")); } }
public void ToogleLanguage(object sender, EventArgs e) { //Resources = new ResourceDictionary(); if (locale == Localisation.English) { Resources.Source = new Uri(string.Format("../../resources/Languages/local.ru-RU.xaml"), UriKind.Relative); locale = Localisation.Russian; } else { Resources.Source = new Uri(string.Format("../../resources/Languages/local.en-US.xaml"), UriKind.Relative); locale = Localisation.English; } }
/// <summary> /// Triggered when the Program is started for the first time. /// </summary> /// <param name="sender">The sender of the object.</param> /// <param name="e">Event arguments.</param> private static void OnGUIInitInstance(object sender, InitInstanceEventArgs e) { GuiProgram program = (GuiProgram)sender; eraserClient = new RemoteExecutorServer(); Application.SafeTopLevelCaptionFormat = S._("Eraser"); //Load the task list try { if (File.Exists(TaskListPath)) { using (FileStream stream = new FileStream(TaskListPath, FileMode.Open, FileAccess.Read, FileShare.Read)) { eraserClient.Tasks.LoadFromStream(stream); } } } catch (InvalidDataException ex) { File.Delete(TaskListPath); MessageBox.Show(S._("Could not load task list. All task entries have " + "been lost. The error returned was: {0}", ex.Message), S._("Eraser"), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, Localisation.IsRightToLeft(null) ? MessageBoxOptions.RtlReading | MessageBoxOptions.RightAlign : 0); } //Decide whether to display any UI. GuiArguments arguments = new GuiArguments(); Args.Parse(program.CommandLine, CommandLinePrefixes, CommandLineSeparators, arguments); e.ShowMainForm = !arguments.AtRestart && !arguments.Quiet; //Queue tasks meant for running at restart if we are given that command line. if (arguments.AtRestart) { eraserClient.QueueRestartTasks(); } //Run the eraser client. eraserClient.Run(); //Create the main form. program.MainForm = new MainForm(); }
/* Вызов методов для занесения стандартных параметров в * -Перечень ошибок */ public HelperForm() { InitializeComponent(); DBClasses.Parameters.getParam().connection = Directory.GetCurrentDirectory() + @"\DataBase\DataMining.db"; Localisation.GetInstance().Language = "EN"; StartViewParametrs(); русскийRUToolStripMenuItem_Click(this, new EventArgs()); try { Analyse_other(); } catch { MessageBox.Show(Localisation.GetInstance().Language.Equals("RU") ? "База данных пуста, заполните базу данных" : "The Database is empty, fill the Database"); } }
public void RefreshText(SystemLanguage language = SystemLanguage.Unknown) { if (language == SystemLanguage.Unknown) { language = Localisation.GetCurrentLanguage(); } if (_cachedLanguage != language || Localisation.AreGlobalVariablesOutOfDate(_cachedGlobalVariables) #if UNITY_EDITOR || !Application.isPlaying #endif ) { UpdateText(language); } }
/// <summary> /// Конвертирует массив данных в нужнный формат с учетом нужной локализации /// </summary> /// <param name="inputData">Входные данные</param> /// <param name="outputFilePath">Файл, в который нужно сохранить данные</param> /// <param name="format">Формат файла, в который нужно сохранить</param> /// <param name="localisation">Выбранная локализация</param> /// <returns>Успех конвертации</returns> public static bool convert(System.Data.DataTable inputData, string outputFilePath, ConversionFormat format, Localisation localisation) { if (format == ConversionFormat.CSV) { var conv = new CSVConverter(); return conv.Import(inputData) && conv.Export(outputFilePath, localisation); } else if (format == ConversionFormat.XLSX) { var conv = new XLSXConverter(); return conv.Import(inputData) && conv.Export(outputFilePath, localisation); } else if (format == ConversionFormat.ARFF) { var conv = new ARFFConverter(); return conv.Import(inputData) && conv.Export(outputFilePath, localisation); } return false; }
public abstract bool Export(String path, Localisation localisation);
private static void Add(Localisation localisation, ushort version, byte subVersion, byte[] key) { if (!MapleKeys.Keys.ContainsKey(localisation)) { MapleKeys.Keys.Add(localisation, new Dictionary<KeyValuePair<ushort, byte>, byte[]>()); } MapleKeys.Keys[localisation].Add(new KeyValuePair<ushort, byte>(version, subVersion), key); }