Esempio n. 1
0
 public InstallationProgressForm()
 {
     InitializeComponent();
     Lng.Translate(this);
     Text = Text.Replace(InstallerConstants.InstallerTitle, InstallerProperties.InstallerTitle);
     LblPleaseWait.Text = LblPleaseWait.Text.Replace(InstallerConstants.ProductName, InstallerProperties.ProductName);
 }
Esempio n. 2
0
        public AboutForm()
        {
            InitializeComponent();

            Icon = IconCreator.Get(IconChar.Info, Color.Gray);
            Lng.Translate(this);
        }
Esempio n. 3
0
        public void LngElemTest()
        {
            // Test translation to Hungarian
            Assert.AreEqual("Igen", Lng.Elem(Language.Hungarian, "Yes"));

            // Test translation to German
            Assert.AreEqual("Ja", Lng.Elem(Language.German, "Yes"));

            // Test some elements to ensure not deleting rows accidentally on sheets
            Assert.AreEqual("WMI Adattár", Lng.Elem(Language.Hungarian, "WMI Repository"));
            Assert.AreEqual("WMI 存储库", Lng.Elem(Language.Chinese, "WMI Repository"));
            Assert.AreEqual("WMI-Repository", Lng.Elem(Language.German, "WMI Repository"));

            // Test translation with non-existing translate
            Assert.AreEqual("Yes", Lng.Elem(Language.Albanian, "Yes"));

            // Test translation with non-existing language element
            Assert.AreEqual("Non-existing language element", Lng.Elem(Language.German, "Non-existing language element"));

            Lng.DefaultLanguage = Language.Hungarian;
            Assert.AreEqual("WMI Adattár", Lng.Elem("WMI Repository"));

            Lng.DefaultLanguage = Language.Chinese;
            Assert.AreEqual("WMI 存储库", Lng.Elem("WMI Repository"));

            // Test translation from Hungarian to English
            var translateFromHungarian = Lng.Translate(Language.Hungarian, "Ismétlődés", Language.English);

            Assert.AreEqual("Repetition", translateFromHungarian);

            // Test translation from Hungarian to Hungarian
            translateFromHungarian = Lng.Translate(Language.Hungarian, "Ismétlődés", Language.Hungarian);
            Assert.AreEqual("Ismétlődés", translateFromHungarian);
        }
        public MainForm()
        {
            try
            {
                string keyName   = @"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION";
                string valueName = Path.GetFileName(Application.ExecutablePath);
                if (Registry.GetValue(keyName, valueName, null) == null)
                {
                    Registry.SetValue(keyName, valueName, 32768, RegistryValueKind.DWord);
                }
            }
            catch
            {
                ErrorBox.Show(Lng.Elem("Registry write error"), Lng.Elem(@"You need to start the application with administrator right for the first time if you want to use the map functionality or create HKEY_LOCAL_MACHINE\SOFTWARE\[WOW6432Node\]Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION\Storyteller.exe REG_DWORD 0x8000 registry entries."));
            }

            InitializeComponent();

            LoadIcons();

            imageList.Images.Add("0", IconChar.Folder.ToBitmap(16, Color.DarkGoldenrod));
            imageList.Images.Add("1", IconChar.Image.ToBitmap(16, Color.ForestGreen));
            imageList.Images.Add("2", IconChar.FileAudio.ToBitmap(16, Color.LightSeaGreen));
            imageList.Images.Add("3", IconChar.User.ToBitmap(16, Color.BlanchedAlmond));

            DirectoryExtension.CreateApplicationDirectories();

            tvImages.Nodes.GetFilesAndFolders(PathProvider.Maps, 1, ExtensionProvider.ImagesFilter);
            tvMusic.Nodes.GetFilesAndFolders(PathProvider.Music, 2, ExtensionProvider.AudioFilter);
            tvSoundEffects.Nodes.GetFilesAndFolders(PathProvider.SoundEffects, 2, ExtensionProvider.AudioFilter);
            tvCharacters.Nodes.GetFilesAndFolders(PathProvider.Characters, 1, ExtensionProvider.ImagesFilter);
            tvVideoClips.Nodes.GetFilesAndFolders(PathProvider.VideoClips, 1, ExtensionProvider.VideoFilter);

            tvImages.ExpandAll();

            FillListViewGroup(lvMarket, "Accomodation");
            FillListViewGroup(lvMarket, "Animals");
            FillListViewGroup(lvMarket, "Clothes");
            FillListViewGroup(lvMarket, "Debauchery");
            FillListViewGroup(lvMarket, "Food");
            FillListViewGroup(lvMarket, "Other");
            FillListViewGroup(lvMarket, "Trappings");
            FillListViewGroup(lvMarket, "Travelling");

            GetLanguages();

            Lng.Translate(this);

            LoadStory(rtbStory);

            charcterGenerator = new CharcterGenerator
            {
                TopLevel        = false,
                FormBorderStyle = FormBorderStyle.None,
                Dock            = DockStyle.Fill
            };
            pCharacterContent.Controls.Add(charcterGenerator);
            charcterGenerator.Show();
        }
Esempio n. 5
0
        public LicenseAgreementForm()
        {
            InitializeComponent();
            Lng.Translate(this);
            Text = Text.Replace(InstallerConstants.InstallerTitle, InstallerProperties.InstallerTitle);

            var assembly          = Assembly.GetCallingAssembly();
            var licenseFileStream = resourceProvider.GetResourceByShortName(assembly, "LicenseAgreement.rtf");

            RtbLicenseAgreement.LoadFile(licenseFileStream, RichTextBoxStreamType.RichText);
        }
Esempio n. 6
0
        public SelectComponentsForm(InstallSequence installSequence, HashSet <string> installerGroups)
        {
            InitializeComponent();

            InstallSequence = installSequence;
            foreach (var group in installerGroups)
            {
                ComboBox.Items.Add(group);
            }

            Lng.Translate(this);
            Text = Text.Replace(InstallerConstants.InstallerTitle, InstallerProperties.InstallerTitle);
            ComboBox.SelectedIndex = 0;
        }
Esempio n. 7
0
        public static TEnumType GetByDescription <TEnumType>(string description)
        {
            var englishDescription = Lng.Translate(Lng.DefaultLanguage, description, Language.English);
            var values             = Enum.GetValues(typeof(TEnumType));

            foreach (TEnumType value in values)
            {
                if (englishDescription == Core.Utils.EnumUtils.GetDescription(value as Enum))
                {
                    return(value);
                }
            }

            return(Parse <TEnumType>(englishDescription));
        }
        public CharcterGenerator(bool canGenerate = false)
        {
            InitializeComponent();

            btnDone.Visible     = canGenerate;
            btnGenerate.Visible = canGenerate;
            btnDone.Enabled     = canGenerate;
            btnGenerate.Enabled = canGenerate;

            if (!canGenerate)
            {
                nudAimV.ReadOnly = true;
            }

            Icon = IconCreator.Get(IconChar.UserCircle, Color.Maroon);
            Lng.Translate(this);
            cbImageSizeMode.SelectedIndex = 1;
        }
        public PrerequisitesForm(InstallSequence installers)
        {
            Prerequisites = installers.Where(installer => installer.Enabled && installer.InstallerType == InstallerType.Prerequisite).ToList();
            if (!Prerequisites.Any())
            {
                DialogResult = DialogResult.OK;
                Close();
            }

            InitializeComponent();

            foreach (var prerequisite in Prerequisites)
            {
                LvPrerequisites.Items.Add(new ListViewItem(prerequisite.ToString()));
            }

            Lng.Translate(this);
            Text                   = Text.Replace(InstallerConstants.InstallerTitle, InstallerProperties.InstallerTitle);
            LblWelcome.Text        = LblWelcome.Text.Replace(InstallerConstants.ProductName, InstallerProperties.ProductName);
            LblChooseLanguage.Text = LblChooseLanguage.Text.Replace(InstallerConstants.ProductName, InstallerProperties.ProductName);
        }
Esempio n. 10
0
 public StartInstallForm()
 {
     InitializeComponent();
     Lng.Translate(this);
     Text = Text.Replace(InstallerConstants.InstallerTitle, InstallerProperties.InstallerTitle);
 }