Skip to content

Instantly share code, notes, and snippets.

@3F 3F/0_Version.cs
Last active Jan 30, 2016

Embed
What would you like to do?
Example of the Version class for vsSolutionBuildEvent documentation
// This code was generated by a tool.
// Changes to this file may cause incorrect behavior and will be lost if the code is regenerated.
namespace net.r_eg.vsSBE
{
internal class Version
{
public static readonly System.Version number = new System.Version(0, 11, 3, 47085);
public const string numberWithRevString = "0.11.3.47085";
public const string numberString = "0.11.3";
public const string branchName = "master";
public const string branchSha1 = "399a7e8";
public const string branchRevCount = "212";
public const string informational = "0.11.3.47085 [ 399a7e8 ]";
public const string informationalFull = "0.11.3.47085 [ 399a7e8 ] /'master':212";
}
}
// ...
try
{
Provider.ILibrary library = loader.load(solutionFile, properties, libPath, false);
msg("Library: loaded from '{0}' :: v{1} [{2}] /'{3}':{4}",
library.Dllpath,
library.Version.Number.ToString(),
library.Version.BranchSha1,
library.Version.BranchName,
library.Version.BranchRevCount);
library.Event.solutionOpened(pUnkReserved, 0);
return library;
}
catch(Exception ex) {
// ...
}
throw new AbortException();
// ...
// ...
[assembly: AssemblyVersion(Version.numberString)]
[assembly: AssemblyFileVersion(Version.numberString)]
[assembly: AssemblyInformationalVersion(Version.informational)]
// ...
#if !DEBUG
labelVersionVal.Text = String.Format("v{0} [ {1} ]", Version.numberWithRevString, Version.branchSha1);
if(Version.branchName.ToLower() != "releases") {
labelVersionVal.Text += String.Format(" /\"{0}\":{1}", Version.branchName, Version.branchRevCount);
}
#else
labelVersionVal.Text = String.Format("v{0} Debug [ {1} ] /\"{2}\":{3}",
Version.numberWithRevString,
Version.branchSha1,
Version.branchName,
Version.branchRevCount);
#endif
@3F

This comment has been minimized.

Copy link
Owner Author

3F commented Apr 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.