Esempio n. 1
0
 public ApplicationId(byte[] publicKeyToken, string name, System.Version version, string processorArchitecture, string culture)
 {
     if (name == null)
     {
         throw new ArgumentNullException("name");
     }
     if (name.Length == 0)
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_EmptyApplicationName"));
     }
     if (version == null)
     {
         throw new ArgumentNullException("version");
     }
     if (publicKeyToken == null)
     {
         throw new ArgumentNullException("publicKeyToken");
     }
     this.m_publicKeyToken = new byte[publicKeyToken.Length];
     Array.Copy(publicKeyToken, 0, this.m_publicKeyToken, 0, publicKeyToken.Length);
     this.m_name = name;
     this.m_version = version;
     this.m_processorArchitecture = processorArchitecture;
     this.m_culture = culture;
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public FileInfoEx(string fileName, int rootDirLength)
 {
     myFileInfo = new FileInfo(fileName);
     var verInfo = FileVersionInfo.GetVersionInfo(fileName);
     if (myFileVersion != null)
         myFileVersion = new System.Version(verInfo.FileMajorPart, verInfo.FileMinorPart, verInfo.FileBuildPart, verInfo.FilePrivatePart).ToString();
     myHash = AppUpdate.Utils.FileChecksum.GetSHA256Checksum(fileName);
     RelativeName = fileName.Substring(rootDirLength + 1);
 }
Esempio n. 4
0
        public void Can_Get_Ordered_Migrations_For_1_12_0()
        {
            var oneEleven = new Version(1, 11, 0);
            var oneTwelve = new Version(1, 12, 0);

            //var ordered = _resolver.OrderedUpgradeMigrations(oneEleven, oneTwelve);

            //foreach (var m in ordered)
            //{
            //    Assert.AreEqual(oneTwelve, m.GetType().GetCustomAttribute<MigrationAttribute>(false).TargetVersion);
            //}
        }
Esempio n. 5
0
        public void Can_Determine_The_MerchelloDatabaseVersion()
        {
            //// Arrange
            var expected = new Version(1, 7, 0);
            //// Act
            var result = _databaseSchemaCreation.ValidateSchema();
            Assert.NotNull(result);

            var version = result.DetermineInstalledVersion();

            //// Assert
            Assert.AreEqual(expected, version);
        }
Esempio n. 6
0
 public void creates_valid_version_from_system_version()
 {
     System.Version version = new System.Version(78, 56, 34, 12);
     Version serializableVersion = new Version(version);
     Assert.AreEqual(version.Major, serializableVersion.Major,
                     "Major number was not correctly parsed");
     Assert.AreEqual(version.Minor, serializableVersion.Minor,
                     "Minor number was not correctly parsed");
     Assert.AreEqual(version.Build, serializableVersion.Build,
                     "Build number was not correctly parsed");
     Assert.AreEqual(version.Revision, serializableVersion.Revision,
                     "Revision number was not correctly parsed");
 }
 internal OperatingSystem(PlatformID platform, System.Version version, string servicePack)
 {
     if ((platform < PlatformID.Win32S) || (platform > PlatformID.MacOSX))
     {
         throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", new object[] { (int) platform }), "platform");
     }
     if (version == null)
     {
         throw new ArgumentNullException("version");
     }
     this._platform = platform;
     this._version = (System.Version) version.Clone();
     this._servicePack = servicePack;
 }
        //---------------------------------------------------------------------
        public ExtensionInfo(string         name,
            string         version,
            string         type,
            string         assemblyName,
            string         className,
            string         description,
            string         userGuidePath,
            System.Version coreVersion)
        {
            persistentInfo = new PersistentDataset.ExtensionInfo();
            persistentInfo.Name = name;
            persistentInfo.Version = version;
            persistentInfo.TypeName = type;
            persistentInfo.AssemblyName = assemblyName;
            persistentInfo.ClassName = className;
            persistentInfo.Description = description;
            persistentInfo.UserGuidePath = userGuidePath;

            this.coreVersion = coreVersion;
        }
 private OperatingSystem(SerializationInfo info, StreamingContext context)
 {
     SerializationInfoEnumerator enumerator = info.GetEnumerator();
     while (enumerator.MoveNext())
     {
         string name = enumerator.Name;
         if (name != null)
         {
             if (!(name == "_version"))
             {
                 if (name == "_platform")
                 {
                     goto Label_0067;
                 }
                 if (name == "_servicePack")
                 {
                     goto Label_0089;
                 }
             }
             else
             {
                 this._version = (System.Version) info.GetValue("_version", typeof(System.Version));
             }
         }
         continue;
     Label_0067:
         this._platform = (PlatformID) info.GetValue("_platform", typeof(PlatformID));
         continue;
     Label_0089:
         this._servicePack = info.GetString("_servicePack");
     }
     if (this._version == null)
     {
         throw new SerializationException(Environment.GetResourceString("Serialization_MissField", new object[] { "_version" }));
     }
 }
Esempio n. 10
0
		static void ShowUpdateWindowIfRelevant () {
			try {
				System.DateTime remindDate;
				var remindVersion = new System.Version(EditorPrefs.GetString("AstarRemindUpdateVersion", "0.0.0.0"));
				if (latestVersion == remindVersion && System.DateTime.TryParse(EditorPrefs.GetString("AstarRemindUpdateDate", "1/1/1971 00:00:01"), out remindDate)) {
					if (System.DateTime.UtcNow < remindDate) {
						// Don't remind yet
						return;
					}
				} else {
					EditorPrefs.DeleteKey("AstarRemindUpdateDate");
					EditorPrefs.DeleteKey("AstarRemindUpdateVersion");
				}
			} catch {
				Debug.LogError("Invalid AstarRemindUpdateVersion or AstarRemindUpdateDate");
			}

			var skipVersion = new System.Version(EditorPrefs.GetString("AstarSkipUpToVersion", AstarPath.Version.ToString()));

			if (AstarPathEditor.FullyDefinedVersion(latestVersion) != AstarPathEditor.FullyDefinedVersion(skipVersion) && AstarPathEditor.FullyDefinedVersion(latestVersion) > AstarPathEditor.FullyDefinedVersion(AstarPath.Version)) {
				EditorPrefs.DeleteKey("AstarSkipUpToVersion");
				EditorPrefs.DeleteKey("AstarRemindUpdateDate");
				EditorPrefs.DeleteKey("AstarRemindUpdateVersion");

				AstarUpdateWindow.Init(latestVersion, latestVersionDescription);
			}
		}
Esempio n. 11
0
		static void ParseServerMessage (string result) {
			if (string.IsNullOrEmpty(result)) {
				return;
			}

			hasParsedServerMessage = true;

			#if ASTARDEBUG
			Debug.Log("Result from update check:\n"+result);
			#endif

			string[] splits = result.Split('|');
			latestVersionDescription = splits.Length > 1 ? splits[1] : "";

			if (splits.Length > 4) {
				// First 4 are just compatibility fields
				var fields = splits.Skip(4).ToArray();

				// Take all pairs of fields
				for (int i = 0; i < (fields.Length/2)*2; i += 2) {
					string key = fields[i];
					string val = fields[i+1];
					astarServerData[key] = val;
				}
			}

			try {
				latestVersion = new System.Version(astarServerData["VERSION:branch"]);
			} catch (System.Exception ex) {
				Debug.LogWarning("Could not parse version\n"+ex);
			}

			try {
				latestBetaVersion = new System.Version(astarServerData["VERSION:beta"]);
			} catch (System.Exception ex) {
				Debug.LogWarning("Could not parse version\n"+ex);
			}
		}
Esempio n. 12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ConnectVersion"/> class.
 /// </summary>
 public ConnectVersion()
 {
     AssemblyName assemblyName = Assembly.GetCallingAssembly().GetName();
         _version = assemblyName.Version;
 }
Esempio n. 13
0
 internal static string/*!*/ GetStrongName(string name, Version version, string culture, byte[] publicKey, bool retargetable)
 {
     if(version == null)
         version = new Version();
     StringBuilder result = new StringBuilder();
     result.Append(name);
     result.Append(", Version=");
     result.Append(version.ToString());
     result.Append(", Culture=");
     result.Append(((culture == null || culture.Length == 0) ? "neutral" : culture));
     result.Append(AssemblyNode.GetKeyString(publicKey));
     if(retargetable)
         result.Append(", Retargetable=Yes");
     return result.ToString();
 }
Esempio n. 14
0
 public override bool Construct()
 {
     Version = new System.Version(1, 0, 0, 2);
     return true;
 }
Esempio n. 15
0
 public static bool IsVersionCompatible(this Assembly assembly, string otherVersion)
 {
     // according to http://semver.org/ versions are compatible so long as they are part of the same major version
     var ver = new System.Version(otherVersion);
     return assembly.GetName().Version.Major == ver.Major;
 }
Esempio n. 16
0
 public override bool Construct()
 {
     HasSeparateThreadInstance = false;
     Version = new System.Version(1, 0);
     return true;
 }
Esempio n. 17
0
		static VerInfo()
		{
			System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
			Name = assembly.GetName().Name;
			Version = assembly.GetName().Version;

			object[] devph = assembly.GetCustomAttributes( typeof( DevelopPhaseAttribute ) , false );
			if ( devph.Length > 0 )
			{
				DevPhase = (devph[0] as DevelopPhaseAttribute).Phase;
			}

			object[] config = assembly.GetCustomAttributes( typeof( System.Reflection.AssemblyConfigurationAttribute ) , false );
			if ( config.Length > 0 )
			{
				Config = (config[0] as System.Reflection.AssemblyConfigurationAttribute).Configuration;
			}
		}
Esempio n. 18
-1
 public ExecuteMethod()
 {
     _currentVersion = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
     _outputText = new System.Text.StringBuilder();
     _mockConsole = new StringWriter(_outputText);
     _actualConsole = System.Console.Out;
     System.Console.SetOut(_mockConsole);
 }