Пример #1
0
		/// <summary>
		/// Constructs a PluginInfo object
		/// </summary>
		/// <param name="InFile"></param>
		/// <param name="InLoadedFrom">Where this pl</param>
		public PluginInfo(FileReference InFile, PluginLoadedFrom InLoadedFrom)
		{
			Name = Path.GetFileNameWithoutExtension(InFile.FullName);
			File = InFile;
			Directory = File.Directory;
			Descriptor = PluginDescriptor.FromFile(File, InLoadedFrom == PluginLoadedFrom.GameProject);
			LoadedFrom = InLoadedFrom;
		}
Пример #2
0
 /// <summary>
 /// Constructs a PluginInfo object
 /// </summary>
 /// <param name="InFileName"></param>
 /// <param name="InLoadedFrom">Where this pl</param>
 public PluginInfo(string InFileName, PluginLoadedFrom InLoadedFrom)
 {
     Name = Path.GetFileNameWithoutExtension(InFileName);
     FileName = Path.GetFullPath(InFileName);
     Directory = Path.GetDirectoryName(FileName);
     Descriptor = PluginDescriptor.FromFile(FileName);
     LoadedFrom = InLoadedFrom;
 }
Пример #3
0
        /// <summary>
        /// Read all the plugin descriptors under the given directory
        /// </summary>
        /// <param name="ParentDirectory">The parent directory to look in.</param>
        /// <param name="LoadedFrom">The directory type</param>
        /// <returns>Sequence of the found PluginInfo object.</returns>
        public static IReadOnlyList<PluginInfo> ReadPluginsFromDirectory(DirectoryReference ParentDirectory, PluginLoadedFrom LoadedFrom)
		{
			List<PluginInfo> Plugins;
			if (!PluginInfoCache.TryGetValue(ParentDirectory, out Plugins))
			{
				Plugins = new List<PluginInfo>();
				foreach (FileReference PluginFileName in EnumeratePlugins(ParentDirectory))
				{
					PluginInfo Plugin = new PluginInfo(PluginFileName, LoadedFrom);
					Plugins.Add(Plugin);
				}
				PluginInfoCache.Add(ParentDirectory, Plugins);
			}
			return Plugins;
		}