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;
    }
Exemple #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);
        }
 public void Add(CompatibleVersionItem item)
 {
   Items.Add(item);
 }
 public void Add(CompatibleVersionItem item)
 {
     Items.Add(item);
 }