Skip to content

Instantly share code, notes, and snippets.

@3F
Last active January 30, 2016 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3F/f54ad9736a9cbb984785 to your computer and use it in GitHub Desktop.
Save 3F/f54ad9736a9cbb984785 to your computer and use it in GitHub Desktop.
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
Copy link
Author

3F commented Apr 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment