Ejemplo n.º 1
0
        public void AddLanguageFile(LanguageFile languageFile)
        {
            // Check if language file already exists in project.
            if (this.LanguageFiles.Contains(languageFile))
            {
                return;
            }

            this.LanguageFiles.Add(languageFile);
            this.OnLanguageFilesChanged();
        }
Ejemplo n.º 2
0
        public bool RemoveLanguageFile(LanguageFile languageFile)
        {
            // Check if project contains language file.
            if (!this.LanguageFiles.Contains(languageFile))
            {
                return(false);
            }

            // Remove from project.
            this.LanguageFiles.Remove(languageFile);

            this.OnLanguageFilesChanged();

            return(true);
        }
        private void AddLanguageFile_OnClick(object sender, RoutedEventArgs e)
        {
            // Configure open file dialog box.
            OpenFileDialog dlg = new OpenFileDialog { DefaultExt = ".txt", Filter = "Language Files (.txt)|*.txt" };

            // Show open file dialog box.
            bool? result = dlg.ShowDialog();

            // Process open file dialog box results 
            if (result != true)
            {
                return;
            }

            // Show language name dialog box.
            TextBoxWindow textboxDlg = new TextBoxWindow();
            result = textboxDlg.ShowDialog("Add Language", "Please enter the name of the language!");

            if (result != true)
            {
                return;
            }

            // Add language file to project.
            ProjectSettings projectSettings = (ProjectSettings)this.DataContext;
            LanguageFile languageFile = new LanguageFile { LanguageTag = textboxDlg.Text, Path = dlg.FileName };
            projectSettings.AddLanguageFile(languageFile);

            // Refresh list.
            this.LanguageFileList.Items.Refresh();
        }
Ejemplo n.º 4
0
 private bool Equals(LanguageFile other)
 {
     return string.Equals(this.Path, other.Path);
 }
Ejemplo n.º 5
0
        public bool RemoveLanguageFile(LanguageFile languageFile)
        {
            // Check if project contains language file.
            if (!this.LanguageFiles.Contains(languageFile))
            {
                return false;
            }

            // Remove from project.
            this.LanguageFiles.Remove(languageFile);

            this.OnLanguageFilesChanged();

            return true;
        }
Ejemplo n.º 6
0
        public void AddLanguageFile(LanguageFile languageFile)
        {
            // Check if language file already exists in project.
            if (this.LanguageFiles.Contains(languageFile))
            {
                return;
            }

            this.LanguageFiles.Add(languageFile);
            this.OnLanguageFilesChanged();
        }
Ejemplo n.º 7
0
 private bool Equals(LanguageFile other)
 {
     return(string.Equals(this.Path, other.Path));
 }