Skip to content

Commit

Permalink
Fix assembly name for AGX, don't do version check for AGX as assembly…
Browse files Browse the repository at this point in the history
… version is not set
  • Loading branch information
djungelorm committed Dec 16, 2016
1 parent 9c98f17 commit f74d3dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions server/src/Utils/APILoader.cs
Expand Up @@ -19,7 +19,7 @@ public static class APILoader
/// <param name="apiName">Name of the API to load.</param>
/// <param name="requiredVersion">Required API version.</param>
[SuppressMessage ("Gendarme.Rules.Smells", "AvoidLongMethodsRule")]
public static bool Load (Type api, string assemblyName, string apiName, Version requiredVersion)
public static bool Load (Type api, string assemblyName, string apiName, Version requiredVersion = null)
{
if (api == null)
throw new ArgumentNullException ("api");
Expand All @@ -33,9 +33,11 @@ public static bool Load (Type api, string assemblyName, string apiName, Version

// Version check
var version = new Version (assembly.versionMajor, assembly.versionMinor);
if (version.CompareTo (requiredVersion) < 0) {
Error ("Failed to load " + assemblyName + "; found version " + version + " but version >= " + requiredVersion + " is required");
return false;
if (requiredVersion != null) {
if (version.CompareTo (requiredVersion) < 0) {
Error ("Failed to load " + assemblyName + "; found version " + version + " but version >= " + requiredVersion + " is required");
return false;
}
}

// Get type of APIs static class
Expand Down
2 changes: 1 addition & 1 deletion service/SpaceCenter/src/ExternalAPI/AGX.cs
Expand Up @@ -7,7 +7,7 @@ static class AGX
{
public static void Load ()
{
IsAvailable = APILoader.Load (typeof(AGX), "ActionGroupsExtended", "ActionGroupsExtended.AGExtExternal, AGExt", new Version (2, 2));
IsAvailable = APILoader.Load (typeof(AGX), "AGExt", "ActionGroupsExtended.AGExtExternal");
}

public static bool IsAvailable { get; private set; }
Expand Down

0 comments on commit f74d3dc

Please sign in to comment.