Пример #1
0
 private void loadTabItems()
 {
     //For each Mod Store Tab set ModStoreManager (forces tab item refresh)
     foreach (TabPage tabPage in tabControl1.Controls)
     {
         ModStoreTabControl modStoreTabControl = tabPage.Controls[0] as ModStoreTabControl;
         if (modStoreTabControl != null)
         {
             modStoreTabControl.Manager = config;
         }
     }
 }
Пример #2
0
        private void ModStore_Initialise()
        {
            //Load Config
            XmlSerializer xs = new XmlSerializer(typeof(ModStoreManager));

            if (File.Exists(config.ConfigPath))
            {
                using (var fs = File.Open(config.ConfigPath, FileMode.Open))
                {
                    config = (ModStoreManager)xs.Deserialize(fs);
                }
            }

            if (config.AvailableItems.Count == 0 || (DateTime.Now - config.LastUpdate).TotalDays >= 1.0)
            {
                //Ask user to update repository information
                updateModuleList();
            }

            //If no modules, update failed so close mod store
            if (config.AvailableItems.Count == 0)
            {
                Close();
                return;
            }

            //Check if user deleted module
            config.CheckForDeletedItems();

            //Set Control Config
            foreach (TabPage tabPage in tabControl1.Controls)
            {
                ModStoreTabControl modStoreTabControl = tabPage.Controls[0] as ModStoreTabControl;
                if (modStoreTabControl != null)
                {
                    modStoreTabControl.Manager = config;
                }
            }
        }