GetVersion() public static method

public static GetVersion ( ) : Version
return Version
        public FormCertUtil()
        {
            InitializeComponent();

            this.Text = this.Text.Replace("{version}", AssemblyUtils.GetVersion().ToString(3));

            this.toolStripStatusLabel.Text = string.Empty;

            foreach (var cryptoObject in CertUtilConstants.CryptographicObjects)
            {
                this.comboBoxObject.Items.Add(cryptoObject.Key);
            }

            this.comboBoxObject.SelectedItem = this.comboBoxObject.Items[0];

            foreach (var pkcFormat in CertUtilConstants.PublicKeyCertificatesFormats)
            {
                this.comboBoxFormat.Items.Add(pkcFormat.Key);
            }

            this.comboBoxFormat.SelectedItem = this.comboBoxFormat.Items[0];

            // Handlers.
            this.comboBoxObject.SelectionChangeCommitted += ComboBoxObject_SelectionChangeCommitted;
            this.FormClosing += new FormClosingEventHandler(this.FormCertUtil_Closing);
        }
コード例 #2
0
ファイル: NeonManager.cs プロジェクト: tgiachi/Argon.Engine
        private void PrintHeader()
        {
            var framework = Assembly
                            .GetEntryAssembly()?
                            .GetCustomAttribute <TargetFrameworkAttribute>()?
                            .FrameworkName;

            var stats = new
            {
                OsPlatform       = System.Runtime.InteropServices.RuntimeInformation.OSDescription,
                AspDotnetVersion = framework
            };


            Console.WriteLine($@" 
 $$$$$$\                                          
$$  __$$\                                         
$$ /  $$ | $$$$$$\   $$$$$$\   $$$$$$\  $$$$$$$\  
$$$$$$$$ |$$  __$$\ $$  __$$\ $$  __$$\ $$  __$$\ 
$$  __$$ |$$ |  \__|$$ /  $$ |$$ /  $$ |$$ |  $$ |
$$ |  $$ |$$ |      $$ |  $$ |$$ |  $$ |$$ |  $$ |
$$ |  $$ |$$ |      \$$$$$$$ |\$$$$$$  |$$ |  $$ |
\__|  \__|\__|       \____$$ | \______/ \__|  \__|
                    $$\   $$ |                    
                    \$$$$$$  |                    
                     \______/                
:: Home Control v {AssemblyUtils.GetVersion()}
:: Os {stats.OsPlatform}
:: .NET core version {stats.AspDotnetVersion}
                        ");
            Console.WriteLine($"Starting Neon (branch {ThisAssembly.Git.Branch}) {ThisAssembly.Git.Commit} sha: {ThisAssembly.Git.Sha}");
        }
コード例 #3
0
        public FormSSLCertBundleGenerator()
        {
            InitializeComponent();

            this.Text = this.Text.Replace("{version}", AssemblyUtils.GetVersion().ToString(3));

            this.toolStripStatusLabel.Text = string.Empty;

            this.comboBoxKeySize.Items.Add(X509Constants.RSAKeySize.KeySize1024);
            this.comboBoxKeySize.Items.Add(X509Constants.RSAKeySize.KeySize2048);
            this.comboBoxKeySize.Items.Add(X509Constants.RSAKeySize.KeySize4096);

            this.comboBoxValidity.Items.AddRange(Enumerable.Range(1, 24).Cast <object>().ToArray());

            // Default values.
            this.comboBoxKeySize.SelectedItem  = this.comboBoxKeySize.Items[1];
            this.comboBoxValidity.SelectedItem = this.comboBoxValidity.Items[11];

            this.numericUpDownSerialNumber.Maximum = long.MaxValue;
            this.numericUpDownSerialNumber.Minimum = 2;
            this.numericUpDownSerialNumber.Value   = 2;

            // SSL Certificate Enhanced Key Usage property must contain Server Authentication (1.3.6.1.5.5.7.3.1).
            this.checkBoxServerAuthentication.Checked = true;
            this.checkBoxServerAuthentication.Enabled = false;

            this.pictureBoxInfo.SetToolTip("Multiple Subject Alternative Names (SANs) can be specified separated by semicolons.");

            // Handlers.
            this.FormClosing += new FormClosingEventHandler(this.FormSSLCertBundleGenerator_Closing);
        }
コード例 #4
0
ファイル: DiscoveryService.cs プロジェクト: tgiachi/Neon
        private void StartAdvertiser()
        {
            _logger.LogDebug($"Starting advertiser on local network");
            var neonService = new ServiceProfile("neon", "_neonhome._tcp", 5000);

            neonService.AddProperty("http", "5000");
            neonService.AddProperty("https", "5001");
            neonService.AddProperty("appVersion", AssemblyUtils.GetVersion());
            neonService.AddProperty("uuid", _uuid);

            _serviceAdvertiser.Advertise(neonService);
        }
コード例 #5
0
        public FormAbout()
        {
            InitializeComponent();

            Version version = AssemblyUtils.GetVersion();

            bool isDebug = false;

            Debug.Assert(isDebug = true);
            var strVersion = isDebug ? version.ToString() : version.ToString(3);

            this.labelVersion.Text = this.labelVersion.Text.Replace("{version}", strVersion);

            this.KeyDown += new KeyEventHandler(formAbout_KeyPress);
            this.richTextBoxCopyright.LinkClicked += new LinkClickedEventHandler(richTextBoxCopyright_LinkClicked);
            this.linkLabelContact.LinkClicked     += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelContact_LinkClicked);
            this.linkLabelSource.LinkClicked      += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelSource_LinkClicked);
            this.richTextBoxCopyright.Text         = this.richTextBoxCopyright.Text.Replace("{sshNetLibVersion}", AssemblyUtils.GetVersion("Renci.SshNet").ToString());
        }
コード例 #6
0
ファイル: PreSharpEntryPoint.cs プロジェクト: wkfff/PreSharp
    private static void Install()
    {
        string programFiles        = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
        string preSharpDir         = Path.Combine(programFiles, "PreSharp");
        string preSharpTargetsFile = Path.Combine(preSharpDir, "PreSharp.targets");
        string preSharpExecutable  = Path.Combine(preSharpDir, "PreSharp.exe");
        var    versionsDic         = new Dictionary <string, string> {
            { "v3.5", "9.0" }, { "v4.0", "10.0" }
        };

        //Setup PreSharp
        Directory.CreateDirectory(preSharpDir);

        if (!AssemblyUtils.CopyTo(preSharpExecutable))
        {
            Console.WriteLine("PreSharp " + AssemblyUtils.GetVersion().ToString() + " is already installed. Only updating system configuration.");
        }

        string preSharpTargetsFileContents = new StreamReader(Assembly.GetExecutingAssembly().GetManifestResourceStream("PreSharp.PreSharp.targets")).ReadToEnd();

        File.WriteAllText(preSharpTargetsFile, preSharpTargetsFileContents);

        //For each .net version
        foreach (var version in versionsDic)
        {
            string msBuildExtensionsDir = Path.Combine(programFiles, @"MsBuild\" + version.Key);
            string customAfterMicrosoftCommonTargetsFile = Path.Combine(msBuildExtensionsDir, "Custom.After.Microsoft.Common.targets");
            string visualStudioKeyPath = @"SOFTWARE\Microsoft\VisualStudio\" + version.Value;

            //They dont seem to decide where to keep the stuff...
            string[] dotNetKeyPaths = new string[] { @"SOFTWARE\Microsoft\NET Framework Setup\NDP\" + version.Key,
                                                     @"SOFTWARE\Microsoft\NET Framework Setup\NDP\" + version.Key.Substring(0, Math.Max(version.Key.LastIndexOf('.'), 0)) + @"\Full\" };

            bool foundDotNet = false;
            foreach (string dotNetKeyPath in dotNetKeyPaths)
            {
                using (var dotNetKey = Registry.LocalMachine.OpenSubKey(dotNetKeyPath, false)) {
                    if (dotNetKey != null && ((1).Equals(dotNetKey.GetValue("Install")) || (1).Equals(dotNetKey.GetValue("Full"))))
                    {
                        foundDotNet = true;
                        break;
                    }
                }
            }
            if (!foundDotNet)
            {
                continue;
            }

            //Setup MSBUILD
            Directory.CreateDirectory(msBuildExtensionsDir);

            XElement import = new XElement(XName.Get("Import", string.Empty),
                                           new XAttribute("Project", @"$(ProgramFiles)\PreSharp\PreSharp.targets"),
                                           new XAttribute("Condition", @" Exists('$(ProgramFiles)\PreSharp\PreSharp.targets') and Exists('$(ProgramFiles)\PreSharp\PreSharp.exe') and '$(DISABLE_PRESHARP)' == '' "));

            XElement project;
            if (!File.Exists(customAfterMicrosoftCommonTargetsFile))
            {
                project = new XElement("Project", import);
            }
            else
            {
                project = XElement.Parse(Regex.Replace(File.ReadAllText(customAfterMicrosoftCommonTargetsFile), @"<Project\s*xmlns\s*=\s*""http://[^""]*""\s*>", "<Project>"));
                if (!project.Elements("Import").Attributes("Project").Where(attr => attr.Value == @"$(ProgramFiles)\PreSharp\PreSharp.targets").Any())
                {
                    project.Add(import);
                }
            }
            File.WriteAllText(customAfterMicrosoftCommonTargetsFile, project.ToString().Replace("<Project>", "<Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">"));

            //Setup VS
            bool installedInVs = false;
            using (var vsKey = Registry.LocalMachine.OpenSubKey(visualStudioKeyPath, false)) {
                if (vsKey != null && vsKey.GetValue("InstallDir") != null)
                {
                    using (var key = Registry.LocalMachine.OpenSubKey(visualStudioKeyPath + @"\MSBuild\SafeImports", true)) {
                        if (key != null)
                        {
                            key.SetValue("PreSharp", preSharpTargetsFile);
                        }
                    }

                    using (var key = Registry.LocalMachine.OpenSubKey(visualStudioKeyPath + @"\Languages\File Extensions\.cst", true)) {
                        if (key == null)
                        {
                            using (var newKey = Registry.LocalMachine.OpenSubKey(visualStudioKeyPath + @"\Languages\File Extensions", true).CreateSubKey(".cst")) {
                                newKey.SetValue(null, "{694DD9B6-B865-4C5B-AD85-86356E9C88DC}");
                            }
                        }
                    }

                    installedInVs = true;
                }
            }

            Console.WriteLine("PreSharp " + AssemblyUtils.GetVersion().ToString() + " was successfully installed in .net " + version.Key + (installedInVs ? "" : " (no Visual Studio)"));
        }
    }
コード例 #7
0
 internal static string GetWASSufix()
 {
     return($"WAS/{AssemblyUtils.GetVersion()}");
 }
コード例 #8
0
        public FormAbout()
        {
            InitializeComponent();

            var version = AssemblyUtils.GetProductVersion();

            this.labelVersion.Text         = this.labelVersion.Text.Replace("{version}", version);
            this.richTextBoxCopyright.Text = this.richTextBoxCopyright.Text.Replace("{bouncyCastleCryptoLibVersion}", AssemblyUtils.GetVersion("BouncyCastle.Crypto").ToString());
            this.richTextBoxCopyright.Text = this.richTextBoxCopyright.Text.Replace("{disruptiveSoftwareCryptographyLibVersion}", AssemblyUtils.GetVersion("DisruptiveSoftware.Cryptography").ToString());

            this.KeyDown += new KeyEventHandler(FormAbout_KeyPress);

            this.richTextBoxCopyright.LinkClicked += new LinkClickedEventHandler(RichTextBoxCopyright_LinkClicked);
            this.linkLabelContact.LinkClicked     += new LinkLabelLinkClickedEventHandler(this.LinkLabelContact_LinkClicked);
            this.linkLabelSource.LinkClicked      += new LinkLabelLinkClickedEventHandler(this.LinkLabelSource_LinkClicked);
        }
コード例 #9
0
 private void LinkLabelContact_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     Process.Start(string.Format("mailto:{0}?subject=About {1} v{2}", this.linkLabelContact.Text, Properties.Resources.Title, AssemblyUtils.GetVersion()));
 }
コード例 #10
0
 private void linkLabelContact_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     System.Diagnostics.Process.Start(String.Format("mailto:{0}?subject=About {1} v{2}", this.linkLabelContact.Text, QuickConnectPluginExt.Title, AssemblyUtils.GetVersion()));
 }
コード例 #11
0
 public ActionResult GetVersion()
 {
     return(Ok(AssemblyUtils.GetVersion()));
 }
コード例 #12
0
        public FormAbout()
        {
            InitializeComponent();

            var version = AssemblyUtils.GetProductVersion();

            this.labelPluginName.Text += String.Format(" ({0})", Info.PluginType);
            this.labelVersion.Text     = this.labelVersion.Text.Replace("{version}", version);

            this.KeyDown += new KeyEventHandler(formAbout_KeyPress);
            this.richTextBoxCopyright.LinkClicked += new LinkClickedEventHandler(richTextBoxCopyright_LinkClicked);
            this.linkLabelContact.LinkClicked     += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelContact_LinkClicked);
            this.linkLabelSource.LinkClicked      += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabelSource_LinkClicked);
            this.richTextBoxCopyright.Text         = this.richTextBoxCopyright.Text.Replace("{sshNetLibVersion}", AssemblyUtils.GetVersion("Renci.SshNet").ToString());
        }
コード例 #13
0
 private async Task SendVersion(ChatId chat)
 {
     await _telegramBotClient.SendTextMessageAsync(chat, $"Neon v{AssemblyUtils.GetVersion()}");
 }