public void GetClrVersionTest() { string targetFrameworkVersion = "v3.5"; string expected = "2.0.50727.0"; string actual; actual = Util_Accessor.GetClrVersion(targetFrameworkVersion); Assert.AreEqual(expected, actual); targetFrameworkVersion = "3.5"; actual = Util_Accessor.GetClrVersion(targetFrameworkVersion); Assert.AreEqual(expected, actual); System.Version currentVersion = System.Environment.Version; System.Version clr4Version = new System.Version(currentVersion.Major, currentVersion.Minor, currentVersion.Build, 0); targetFrameworkVersion = "v4.0"; actual = Util_Accessor.GetClrVersion(targetFrameworkVersion); expected = clr4Version.ToString(); Assert.AreEqual(expected, actual); targetFrameworkVersion = "v4.2"; actual = Util_Accessor.GetClrVersion(targetFrameworkVersion); expected = clr4Version.ToString(); Assert.AreEqual(expected, actual); }
static NRAPUtils() { #if false Version version = new Version(FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion); if (version.Revision == 0) { if (version.Build == 0) { AssemblyVersion = "v" + version.ToString(2); } else { AssemblyVersion = "v" + version.ToString(3); } } else { AssemblyVersion = "v" + version; } #endif RedLabel = new GUIStyle(HighLogic.Skin.label) { normal = { textColor = XKCDColors.Red }, hover = { textColor = XKCDColors.Red } }; }
public void VersionCommandShouldOutputVersion() { var args = new ScriptCsArgs { Version = true }; var fs = new Mock <IFileSystem>(); var resolver = new Mock <IPackageAssemblyResolver>(); var executor = new Mock <IScriptExecutor>(); var engine = new Mock <IScriptEngine>(); var scriptpackResolver = new Mock <IScriptPackResolver>(); var packageInstaller = new Mock <IPackageInstaller>(); var logger = new Mock <ILog>(); var filePreProcessor = new Mock <IFilePreProcessor>(); var root = new ScriptServiceRoot(fs.Object, resolver.Object, executor.Object, engine.Object, filePreProcessor.Object, scriptpackResolver.Object, packageInstaller.Object, logger.Object); var factory = new CommandFactory(root); var result = factory.CreateCommand(args); // clear the fake console output _outputText.Clear(); result.Execute(); Assert.Contains("scriptcs version " + _currentVersion.ToString(), _outputText.ToString()); }
public void WriteVersion(System.Version version) { if (version != null) { WriteAttribute(Constants.Xml.VersionAttribute, version.ToString()); } }
private string GetTargetName() { if (buildState == BuildState.Update) { return("update.7z"); } var existingArchives = System.IO.Directory.GetFiles(UnityBuildFolder, "Ravenfall.v*a-alpha.7z"); if (existingArchives.Length == 0) { return("ravenfall.7z"); } var archives = existingArchives.Select(x => new { File = x, Version = GetVersion(x) }).OrderByDescending(x => x.Version).ToList(); var a = archives.FirstOrDefault(); if (a == null) { return("ravenfall.7z"); } System.Version v = IncrementVersion(a.Version, 0, 0, 0, 1); return("Ravenfall.v" + v.ToString() + "a-alpha.7z"); }
/// <summary> /// アプリケーションの現在のバージョンを取得します。 /// </summary> /// <returns>アプリケーションの現在のバージョン</returns> public static string GetVer() { System.Reflection.Assembly asm = System.Reflection.Assembly.GetExecutingAssembly(); System.Version ver = asm.GetName().Version; return(ver.ToString()); }
/// <summary> /// Updates the ink library. Executed whenever an ink file is changed by InkToJSONPostProcessor /// Can be called manually, but incurs a performance cost. /// </summary> public static void Rebuild() { // Disable the asset post processor in case any assetdatabase functions called as a result of this would cause further operations. InkPostProcessor.disabled = true; // Remove any old file connections Clean(); // Reset the asset name instance.name = "Ink Library " + unityIntegrationVersionCurrent.ToString(); // Add any new file connections (if any are found it replaces the old library entirely) string[] inkFilePaths = GetAllInkFilePaths(); bool inkLibraryChanged = false; List <InkFile> newInkLibrary = new List <InkFile>(inkFilePaths.Length); for (int i = 0; i < inkFilePaths.Length; i++) { InkFile inkFile = GetInkFileWithAbsolutePath(inkFilePaths [i]); // If the ink library doesn't have a representation for this file, then make one if (inkFile == null) { inkLibraryChanged = true; string localAssetPath = InkEditorUtils.AbsoluteToUnityRelativePath(inkFilePaths [i]); DefaultAsset inkFileAsset = AssetDatabase.LoadAssetAtPath <DefaultAsset>(localAssetPath); // If the ink file can't be found, it might not yet have been imported. We try to manually import it to fix this. if (inkFileAsset == null) { AssetDatabase.ImportAsset(localAssetPath); inkFileAsset = AssetDatabase.LoadAssetAtPath <DefaultAsset>(localAssetPath); if (inkFileAsset == null) { Debug.LogWarning("Ink File Asset not found at " + localAssetPath + ". This can occur if the .meta file has not yet been created. This issue should resolve itself, but if unexpected errors occur, rebuild Ink Library using Assets > Recompile Ink"); continue; } } inkFile = new InkFile(inkFileAsset); } newInkLibrary.Add(inkFile); } if (inkLibraryChanged) { instance.inkLibrary = newInkLibrary; SortInkLibrary(); } BuildLookupDictionary(); RebuildInkFileConnections(); foreach (InkFile inkFile in instance.inkLibrary) { inkFile.FindCompiledJSONAsset(); } instance.Save(true); // Re-enable the ink asset post processor InkPostProcessor.disabled = false; Debug.Log("Ink Library was rebuilt."); }
public AppInfo() { InitializeComponent(); System.Reflection.Assembly assembly = Assembly.GetExecutingAssembly(); System.Reflection.AssemblyName asmName = assembly.GetName(); System.Version versions = asmName.Version; version.Text = "Version V." + versions.ToString(); }
private void SetVersionInfo() { //自分自身のAssemblyを取得 Assembly asm = Assembly.GetExecutingAssembly(); //バージョンの取得 System.Version ver = asm.GetName().Version; Version.Content = "ver." + ver.ToString(); }
/// <summary> /// 写入备份注释和版本信息。 /// </summary> /// <param name="xtw">XML 书写器。</param> /// <param name="Version">文档版本。主要用来实现文档版本识别和控制,一般备份数据时写入文档生成器版本号,还原数据时通过版本号判断能否正确导入数据支持。</param> /// <param name="Description">文档备注。</param> /// <param name="Generator">文档生成器描述。</param> private void WriteVersion(System.Xml.XmlTextWriter xtw, System.Version Version, string Description, string Generator) { xtw.WriteStartElement("Version"); xtw.WriteElementString("Version", Version.ToString()); xtw.WriteElementString("DataTime", System.DateTime.Now.ToString()); xtw.WriteElementString("Description", Description); xtw.WriteElementString("Generator", Generator); xtw.WriteEndElement(); }
private void TestClassTypes() { string method_name = "ProcessClassTypes"; System.Reflection.MethodInfo method_info = sample_class_type.GetMethod(method_name); System.Version version = new System.Version("1.2.3.4"); method_info.Invoke(sample_class_instance, new System.Object[] { version }); Assert.IsTrue(Logger.CallLogger.LastLog.Contains(sample_class_name + "::" + method_name)); Assert.IsTrue(Logger.CallLogger.LastLog.Contains(version.ToString())); }
public static string CheckVersion(string input) { Version version = null; try { version = new Version(input); version = new Version(version.Major, version.Minor); } catch { version = new Version(1, 0); } return(version.ToString()); }
/// <summary> /// Add image /// </summary> /// <param name="deployment"></param> /// <param name="name"></param> /// <param name="imageName"></param> /// <param name="version"></param> /// <param name="createOptions"></param> /// <param name="restart"></param> /// <param name="stopped"></param> /// <param name="properties"></param> /// <returns></returns> public static IEdgeDeployment WithModule(this IEdgeDeployment deployment, string name, string imageName, System.Version version, CreateContainerParameters createOptions, ModuleRestartPolicy restart, bool stopped, Dictionary <string, dynamic> properties) => deployment.WithModule(new EdgeDeploymentModuleModel { CreateOptions = createOptions, ImageName = imageName, Name = name, Properties = properties, RestartPolicy = restart != ModuleRestartPolicy.Always ? restart : (ModuleRestartPolicy?)null, Stopped = stopped ? true : (bool?)null, Version = version?.ToString() });
private void IncrementVersion(int?major = null, int?minor = null, int?build = null, int?revision = null) { var currentVersion = new Version(this.version); currentVersion = new Version( (currentVersion.Major < 0 ? 0 : currentVersion.Major) + (major ?? 0), (currentVersion.Minor < 0 ? 0 : currentVersion.Minor) + (minor ?? 0), (currentVersion.Build < 0 ? 0 : currentVersion.Build) + (build ?? 0), (currentVersion.Revision < 0 ? 0 : currentVersion.Revision) + (revision ?? 0) ); this.version = currentVersion.ToString(); Debug.Log("Build version: " + this.version); }
public static string CreatePathName(string name, System.Version version) { const string method = "CreatePathName"; if (name == null) { throw new NullParameterException(typeof(DirectoryPath), method, "name"); } if (!IsName(name)) { throw new InvalidParameterFormatException(typeof(DirectoryPath), method, "name", name, Constants.Validation.CompleteNamePattern); } return(version == null ? name : name + "-" + version.ToString().Replace(".", "-")); }
/// <summary>Get the version info for a specified MBIN <paramref name="mbin"/>.</summary> /// <param name="mbin">The MBIN file to display the version info for.</param> /// <param name="quiet"> /// If true then a plain, script-friendly version string is displayed. /// If false then a human-friendly message is displayed. /// </param> public static string GetVersionString(MBINFile mbin = null, bool quiet = false) { if (mbin == null) { return(GetVersionString(quiet)); } System.Version mbinVersion = mbin.Header.GetMBINVersion(); string versionString = mbinVersion.ToString(); return(!quiet ? (versionString != "0.0.0.0") ? "Compiled with MBINCompiler v" + versionString : "Unknown MBIN version!\nNot compiled by MBINCompiler." : versionString); }
private static void OnFixedGUI(UnityModManager.ModEntry modEntry) { if (modEntry.Active) { DrawUtil.DrawText("HueDebugging enabled"); #if DEBUG System.Version version = Assembly.GetExecutingAssembly().GetName().Version; DrawUtil.DrawText("Version " + version.ToString()); #endif CollisionDrawer.DrawAllColliders(); if (settings.PlayerGroundCheck) { PlayerCollision.OnFixedGUI(); } DrawUtil.OnFixedGUI(); } }
public IEnumerable <GitCommit> GetCommitsFromTagTo(System.Version versionFrom, System.Version versionTo) { var filter = new CommitFilter { SortBy = CommitSortStrategies.Reverse | CommitSortStrategies.Time, IncludeReachableFrom = versionFrom != null?versionFrom.ToString() : "master", // sincelist }; if (versionTo != null) { filter.ExcludeReachableFrom = versionTo.ToString(); // untillist; } using (var repo = new Repository(RepositoryPath)) { var commits = repo.Commits.QueryBy(filter); foreach (var commit in commits) { yield return(new GitCommit() { Hash = commit.Sha, Message = commit.Message.Trim(), CommitedAt = commit.Committer.When }); } } }
public static string UpdateAvailable(Version current, Version latest) { return(Key("UpdateAvailable").Translate(current.ToString(), latest.ToString())); }
/// <summary> /// Updates the ink library. Executed whenever an ink file is changed by InkToJSONPostProcessor /// Can be called manually, but incurs a performance cost. /// </summary> public static void Rebuild() { // Disable the asset post processor in case any assetdatabase functions called as a result of this would cause further operations. InkPostProcessor.disabled = true; // Clear the old data instance.inkLibrary.Clear(); instance.inkLibraryDictionary.Clear(); // Reset the asset name instance.name = "Ink Library " + unityIntegrationVersionCurrent.ToString(); // Add any new file connections (if any are found it replaces the old library entirely) string[] inkFilePaths = GetAllInkFilePaths(); bool inkLibraryChanged = false; List <InkFile> newInkLibrary = new List <InkFile>(inkFilePaths.Length); for (int i = 0; i < inkFilePaths.Length; i++) { InkFile inkFile = GetInkFileWithAbsolutePath(inkFilePaths [i]); // If the ink library doesn't have a representation for this file, then make one if (inkFile == null) { inkLibraryChanged = true; string localAssetPath = InkEditorUtils.AbsoluteToUnityRelativePath(inkFilePaths [i]); DefaultAsset inkFileAsset = AssetDatabase.LoadAssetAtPath <DefaultAsset>(localAssetPath); // If the ink file can't be found, it might not yet have been imported. We try to manually import it to fix this. if (inkFileAsset == null) { AssetDatabase.ImportAsset(localAssetPath); inkFileAsset = AssetDatabase.LoadAssetAtPath <DefaultAsset>(localAssetPath); if (inkFileAsset == null) { // If this occurs as a result assets not having been imported before OnValidate => Validate we should return immediately and set a flag to true. // If an asset import is detected immediately after this via InkPostProcessor, then this rebuild may (will?) have been unnecessary anyway. // At time of writing (11/05/21) I've not done this and am locally toying with EditorApplication.delayCall in OnValidate. Debug.LogWarning("Ink File Asset not found at " + localAssetPath + ". This can occur if the .meta file has not yet been created. This issue should resolve itself, but if unexpected errors occur, rebuild Ink Library using Assets > Recompile Ink"); continue; } } inkFile = new InkFile(inkFileAsset); } newInkLibrary.Add(inkFile); } if (inkLibraryChanged) { instance.inkLibrary = newInkLibrary; SortInkLibrary(); } BuildLookupDictionary(); RebuildInkFileConnections(); foreach (InkFile inkFile in instance.inkLibrary) { inkFile.FindCompiledJSONAsset(); } instance.Save(true); // Re-enable the ink asset post processor InkPostProcessor.disabled = false; Debug.Log("Ink Library was rebuilt.\n" + instance.inkLibrary.Count + " ink files are currently tracked."); }
protected override int ApplyChanges() { if (ProjectMgr == null) { return(VSConstants.E_INVALIDARG); } ProjectMgr.SetProjectProperty(Constants.Project.Property.Manufacturer.Name, m_manufacturer); ProjectMgr.SetProjectProperty(Constants.Project.Property.MergeModuleFile.Name, m_mergeModuleFile); ProjectMgr.SetProjectProperty(Constants.Project.Property.Version.Name, m_version == null ? null : m_version.ToString()); IsDirty = false; return(VSConstants.S_OK); }
void setFloatingText() { var text = ""; switch (outMode) { default: case outModeE.none: { text = "None"; break; } case outModeE.geninfo: { text = ""; if (rman != null) { var campos = Camera.main.transform.position; var cfwd = Camera.main.transform.forward; var cpop = campos; if (rman.pathctrl != null && rman.pathctrl.path != null) { cpop = rman.pathctrl.FindClosestPointOnPath(campos); } var delta = cpop - campos + new Vector3(0, rman.home_height, 0); var nlink = rman.linkcloudctrl.GetLinkCount(); var nnode = rman.linkcloudctrl.GetLinkCount(); var lnkvis = rman.linkcloudctrl.linksvisible; var snode = rman.pathctrl.startnodename; var enode = rman.pathctrl.endnodename; text += "Last Cmd:" + getLastVoiceCmd(); text += "\nLinks:" + nlink + " Nodes:" + nnode + "Visible:" + lnkvis; text += "\nStartNode:" + snode + " EndNode:" + enode; text += "\nrgoScale:" + rman.rgoScale.ToString("F2") + " (" + rman.scaleIncFak + " Fak )"; text += "\nrgoRotate:" + rman.rgoRotate.ToString("F1") + " (" + rman.rotationIncDeg + " deg )"; text += "\nrgoTrans:" + rman.rgoTranslate.ToString("F2") + " (" + rman.tranlsationIncMeter + " M )"; text += "\nMC.pos:" + campos.ToString("F2") + " hh:" + rman.home_height; text += "\nMC.fwd:" + cfwd.ToString("F2") + " CPOP:" + cpop.ToString("F2"); text += "\nDelta:" + delta.ToString("F2" + " Error Correct:" + rman.autoerrorcorrect); text += "\nVoice Total Keys:" + rman.keycount + " k1:" + rman.keyman.totalKeys1() + " k2:" + rman.keyman.totalKeys2(); #if NETFX_CORE text += "\nUniversal Windows Platform (NETFX_CORE defined)"; #else text += "\nHostName:" + System.Environment.MachineName + "\nBuildVersion:" + sysver.ToString(); text += "\n.NET Framework:" + System.Environment.Version + " OS:" + System.Environment.OSVersion.ToString(); #endif // Following Won't compile in UWP //object[] list = Assembly.GetExecutingAssembly().GetCustomAttributes(true); //if (list.Length > 0) //{ // var alist = list.OfType<TargetFrameworkAttribute>(); // foreach (var att in alist) // { // text += "Framework:" + att.FrameworkName + " DisplayName:" + att.FrameworkDisplayName; // } //} } text += "\nUpdate:" + ucnt; text += " Secs:" + lastelapsecs.ToString("F1"); text += " Frate:" + lastfrrate.ToString("F1"); text += " dt:" + lastmaxdeltat.ToString("F3"); break; } case outModeE.voiceCmdHistory: { text = scrollThroughLinkedList(rman.keyman.kwhistory); break; } case outModeE.trace: { text = scrollThroughLinkedList(rman.loglist); break; } case outModeE.version: { text = ""; break; } case outModeE.help: { text = scrollThroughLinkedList(helplist); break; } } tm.text = text; }
private void FillInInfo() { Assembly app = Assembly.GetExecutingAssembly(); AssemblyTitleAttribute title = (AssemblyTitleAttribute)app.GetCustomAttributes(typeof(AssemblyTitleAttribute), false)[0]; AssemblyProductAttribute product = (AssemblyProductAttribute)app.GetCustomAttributes(typeof(AssemblyProductAttribute), false)[0]; AssemblyCopyrightAttribute copyright = (AssemblyCopyrightAttribute)app.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false)[0]; AssemblyCompanyAttribute company = (AssemblyCompanyAttribute)app.GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]; AssemblyDescriptionAttribute description = (AssemblyDescriptionAttribute)app.GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false)[0]; System.Version version = app.GetName().Version; if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed) { version = System.Deployment.Application.ApplicationDeployment.CurrentDeployment.CurrentVersion; } SetCurrentValue(TitleProperty, System.String.Format("About {0}", title.Title)); lblName.SetCurrentValue(TextBlock.TextProperty, title.Title); lblDescription.SetCurrentValue(TextBlock.TextProperty, description.Description); lblVersion.SetCurrentValue(TextBlock.TextProperty, System.String.Format("Version {0}", version.ToString())); lblCopyright.SetCurrentValue(TextBlock.TextProperty, copyright.Copyright.ToString()); lblCompany.SetCurrentValue(TextBlock.TextProperty, company.Company); lblDisclaimer.SetCurrentValue(TextBlock.TextProperty, "All rights reserved."); }