Ejemplo n.º 1
0
        /// <summary>
        /// Setup for the plugin management libraries.
        /// </summary>
        protected virtual void SetupPluginManagement(FileUtil p_futFileUtility)
        {
            string strPath = EnvironmentInfo.ApplicationPersonalDataFolderPath;

            strPath = Path.Combine(Path.Combine(Path.Combine(strPath, "loot"), ModeId), "masterlist.yaml");

            if (SupportsPluginAutoSorting)
            {
                if (!File.Exists(strPath))
                {
                    if (!Directory.Exists(strPath))
                    {
                        Directory.CreateDirectory(Path.GetDirectoryName(strPath));
                    }

                    using (Stream masterlist = new MemoryStream(Properties.Resources.masterlist))
                    {
                        using (ZipArchive archive = new ZipArchive(masterlist, ZipArchiveMode.Read))
                        {
                            archive.GetEntry(String.Format("{0}.yaml", ModeId.ToLower())).ExtractToFile(strPath);
                        }
                    }
                }

                PluginSorter = new PluginSorter(EnvironmentInfo, this, p_futFileUtility, strPath);
            }

            PluginOrderManager = new PluginOrderManager(EnvironmentInfo, this, p_futFileUtility);
        }
        /// <summary>
        /// Setup for the plugin management libraries.
        /// </summary>
        protected virtual void SetupPluginManagement(FileUtil p_futFileUtility)
        {
            string strPath = EnvironmentInfo.ApplicationPersonalDataFolderPath;

            strPath = Path.Combine(Path.Combine(Path.Combine(strPath, "loot"), ModeId), "masterlist.yaml");

            if (SupportsPluginAutoSorting)
            {
                ManageMasterlistFile(strPath, false);

                try
                {
                    PluginSorter = new PluginSorter(EnvironmentInfo, this, p_futFileUtility, strPath);
                }
                catch (NotSupportedException)
                {
                    ManageMasterlistFile(strPath, true);
                    PluginSorter = new PluginSorter(EnvironmentInfo, this, p_futFileUtility, strPath);
                }
            }

            PluginOrderManager = new PluginOrderManager(EnvironmentInfo, this, p_futFileUtility);
        }
 /// <summary>
 /// A simple constructor that initializes the object with the given dependencies.
 /// </summary>
 /// <param name="p_bstPluginSorter">The PluginSorter instance to use to set plugin order.</param>
 public GamebryoPluginOrderLogSerializer(ILoadOrderManager p_bstLoadOrder, PluginSorter p_bstPluginSorter)
 {
     LoadOrderManager = p_bstLoadOrder;
     PluginSorter     = p_bstPluginSorter;
 }
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
 /// <param name="p_lstSorter">The PluginSorter instance to use to set plugin order.</param>
 public PluginSorterUpdater(IEnvironmentInfo p_eifEnvironmentInfo, PluginSorter p_lstSorter)
     : base(p_eifEnvironmentInfo)
 {
     SetRequiresRestart(false);
     PluginSorter = p_lstSorter;
 }