示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FormDialogVersionHistory"/> class.
        /// <param name="icon">A <see cref="Icon"/> to use with the form.</param>
        /// <param name="programName">Name of the program which version history to show.</param>
        /// </summary>
        public FormDialogVersionHistory(Icon icon, string programName)
        {
            InitializeComponent();
            Icon = icon;

            versionHistory =
                VersionDataCache.GetVersionHistoryFromCache(programName);

            var localization = new TabDeliLocalization();

            localization.GetLocalizedTexts(Properties.Resources.version_history_localization);

            btOK.Text            = localization.GetMessage("txtOK", "OK", OverrideCultureString);
            lbSelectVersion.Text = localization.GetMessage("txtSelectVersion", "Select a version:", OverrideCultureString);

            // ReSharper disable once VirtualMemberCallInConstructor
            Text            = localization.GetMessage("txtCaption", "Version history for the '{0}' application", OverrideCultureString, programName);
            allVersionsText = localization.GetMessage("txtAllVersions", "All versions", OverrideCultureString);

            cmbVersionHistorySelector.Items.Add(allVersionsText);
            foreach (var value in versionHistory)
            {
                cmbVersionHistorySelector.Items.Add(value.Key.ToString());
            }

            cmbVersionHistorySelector.SelectedIndex = 0;
        }
示例#2
0
        /// <summary>
        /// This method is called by the constructors. Localizes the dialog and sets the assembly information fields contents.
        /// </summary>
        private void MainInit()
        {
            try // about dialog shouldn't crash the application
            {
                var localization = new TabDeliLocalization();
                localization.GetLocalizedTexts(Properties.Resources.about_dialog_localization_txt);

                btOK.Text = localization.GetMessage("txtOK", "OK", OverrideCultureString);

                try
                {
                    Text = localization.GetMessage("txtText", "About - {0}", OverrideCultureString, AssemblyTitle);
                }
                catch
                {
                    Text = localization.GetMessage("txtText", "About - {0}", OverrideCultureString); // no title in about box title
                }

                lbBuildDateAndTimeValue.Text =
                    aboutAssembly.GetBuildDateTime()?.ToString("G") ?? "-";

                lbCheckVersionText.Text = localization.GetMessage("txtCheck", "Check version:", OverrideCultureString);
                sllLinkVersion.Text     = localization.GetMessage("txtClickCheck", "click to check", OverrideCultureString);
                na = localization.GetMessage("txtCheckNA", "N/A", OverrideCultureString);
                lbBoxDescriptionText.Text =
                    localization.GetMessage("txtDescription", "Description:", OverrideCultureString);
                lbCompanyNameText.Text =
                    localization.GetMessage("txtCompanyName", "Company name:", OverrideCultureString);
                lbCopyrightText.Text   = localization.GetMessage("txtCopyright", "Copyright:", OverrideCultureString);
                lbProductNameText.Text =
                    localization.GetMessage("txtProductName", "Product name:", OverrideCultureString);
                lbVersionText.Text = localization.GetMessage("txtVersion", "Version:", OverrideCultureString);
                lbLicenseText.Text = localization.GetMessage("txtLicense", "License:", OverrideCultureString);

                lbBuildDateTime.Text = localization.GetMessage("txtBuildDateTime", "Build date and time:", OverrideCultureString);

                btViewVersionHistory.Text = localization.GetMessage("txtVersionHistory", "Version history", OverrideCultureString);

                Icon.ExtractAssociatedIcon(aboutAssembly.Location);
            }
            catch
            {
                // ignored..
            }

            btViewVersionHistory.Enabled =
                !VersionDataCache.VersionHistoryCacheIsEmpty(AssemblyProduct);

            lbProductName.Text               = AssemblyProduct;
            lbVersion.Text                   = AssemblyVersion;
            lbCopyright.Text                 = AssemblyCopyright;
            lbCompanyName.Text               = AssemblyCompany;
            tbBoxDescription.Text            = AssemblyDescription;
            tbBoxDescription.HideSelection   = true;
            tbBoxDescription.SelectionLength = 0;
            btOK.Focus();
        }