internal bool ScanVersionInfo(string asm)
    {
      Assembly plugin = null;
      try
      {
        plugin = Assembly.LoadFrom(asm);
      }
      catch {}

      if (plugin == null)
      {
        return false;
      }

      CompatibleVersionAttribute[] versions = (CompatibleVersionAttribute[])CompatibilityManager.GetRequestedVersions(plugin);
      foreach (CompatibleVersionAttribute attr in versions)
      {
        CompatibleVersionItem compatibleVersionItem = new CompatibleVersionItem();
        compatibleVersionItem.MinRequiredVersion = attr.MinRequiredVersion.ToString();
        compatibleVersionItem.DesignedForVersion = attr.DesignedForVersion.ToString();
        CompatibleVersion.Add(compatibleVersionItem);
      }

      IEnumerable<UsesSubsystemAttribute> subSystems = (IEnumerable<UsesSubsystemAttribute>)CompatibilityManager.GetSubSystemsUsed(plugin);
      foreach (UsesSubsystemAttribute attr in subSystems)
      {
        SubSystemItem subsystemItem = new SubSystemItem();
        subsystemItem.Name = attr.Subsystem;
        //subsystemItem.Version = attr.Version.ToString();
        SubSystemsUsed.Add(subsystemItem);
      }
      return true;
    }
Example #2
0
        internal bool ScanVersionInfo(string asm)
        {
            Assembly plugin = null;

            try
            {
                plugin = Assembly.LoadFrom(asm);
            }
            catch {}

            if (plugin == null)
            {
                return(false);
            }

            CompatibleVersionAttribute[] versions = (CompatibleVersionAttribute[])CompatibilityManager.GetRequestedVersions(plugin);
            foreach (CompatibleVersionAttribute attr in versions)
            {
                CompatibleVersionItem compatibleVersionItem = new CompatibleVersionItem();
                compatibleVersionItem.MinRequiredVersion = attr.MinRequiredVersion.ToString();
                compatibleVersionItem.DesignedForVersion = attr.DesignedForVersion.ToString();
                CompatibleVersion.Add(compatibleVersionItem);
            }

            IEnumerable <UsesSubsystemAttribute> subSystems = (IEnumerable <UsesSubsystemAttribute>)CompatibilityManager.GetSubSystemsUsed(plugin);

            foreach (UsesSubsystemAttribute attr in subSystems)
            {
                SubSystemItem subsystemItem = new SubSystemItem();
                subsystemItem.Name = attr.Subsystem;
                //subsystemItem.Version = attr.Version.ToString();
                SubSystemsUsed.Add(subsystemItem);
            }
            return(true);
        }
 static int Compare(SubSystemItem ssi1, SubSystemItem ssi2)
 {
   return ssi1.Name.CompareTo(ssi2.Name);
 }
 public void Add(SubSystemItem item)
 {
   Items.Add(item);
 }
 static int Compare(SubSystemItem ssi1, SubSystemItem ssi2)
 {
     return(ssi1.Name.CompareTo(ssi2.Name));
 }
 public void Add(SubSystemItem item)
 {
     Items.Add(item);
 }