Exemplo n.º 1
0
 public ModChange(CkanModule mod, GUIModChangeType changeType, SelectionReason reason)
 {
     Mod        = mod;
     ChangeType = changeType;
     // If we don't have a Reason, the user probably wanted to install it
     Reason = reason ?? new SelectionReason.UserRequested();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Set the properties to match a change set element.
        /// Doesn't update grid, use SetInstallChecked or SetUpgradeChecked
        /// if you need to update the grid.
        /// </summary>
        /// <param name="change">Type of change</param>
        public void SetRequestedChange(GUIModChangeType change)
        {
            switch (change)
            {
            case GUIModChangeType.Install:
                IsInstallChecked = true;
                IsUpgradeChecked = false;
                break;

            case GUIModChangeType.Remove:
                IsInstallChecked = false;
                IsUpgradeChecked = false;
                IsReplaceChecked = false;
                break;

            case GUIModChangeType.Update:
                IsInstallChecked = true;
                IsUpgradeChecked = true;
                break;

            case GUIModChangeType.Replace:
                IsInstallChecked = true;
                IsReplaceChecked = true;
                break;
            }
        }
Exemplo n.º 3
0
 public void OnModChanged(CkanModule module, GUIModChangeType changeType)
 {
     if (changeType == GUIModChangeType.Update || changeType == GUIModChangeType.Install)
     {
         // Todo: logic that will handle an updated mod, check all of its part files against the modified versions and propogate the changes if it can or alert the user if it can't.
     }
 }
Exemplo n.º 4
0
        public ModChange(GUIMod mod, GUIModChangeType changeType, SelectionReason reason)
        {
            Mod        = mod;
            ChangeType = changeType;
            Reason     = reason;

            if (Reason == null)
            {
                // Hey, we don't have a Reason
                // Most likely the user wanted to install it
                Reason = new SelectionReason.UserRequested();
            }
        }
Exemplo n.º 5
0
 public ModChange(GUIMod mod, GUIModChangeType changeType, SelectionReason reason)
 {
     Mod = mod;
     ChangeType = changeType;
     Reason = reason;
     
     if (Reason == null)
     {
         // Hey, we don't have a Reason
         // Most likely the user wanted to install it
         Reason = new SelectionReason.UserRequested();
     }
 }
Exemplo n.º 6
0
        public void OnModChanged(CkanModule module, GUIModChangeType changeType)
        {
            if (changeType == GUIModChangeType.Update || changeType == GUIModChangeType.Install)
            {
                var parts = GetInstalledModParts(module.identifier);
                foreach (var part in parts.Where(part => _mDisabledParts.ContainsKey(part.Key)))
                {
                    Cache.RemovePartFromCache(part.Key);
                    Cache.MovePartToCache(part.Key);
                }
            }

            RefreshInstalledModsList();
        }
Exemplo n.º 7
0
        public void OnModChanged(CkanModule module, GUIModChangeType changeType)
        {
            if (changeType == GUIModChangeType.Update || changeType == GUIModChangeType.Install)
            {
                var parts = GetInstalledModParts(module.identifier);
                foreach (var part in parts.Where(part => _mDisabledParts.ContainsKey(part.Key)))
                {
                    Cache.RemovePartFromCache(part.Key);
                    Cache.MovePartToCache(part.Key);
                }
            }

            RefreshInstalledModsList();
        }
Exemplo n.º 8
0
 public void OnModChanged(CkanModule module, GUIModChangeType changeType)
 {
     if (changeType == GUIModChangeType.Update || changeType == GUIModChangeType.Install)
     {
         // Todo: logic that will handle an updated mod, check all of its part files against the modified versions and propogate the changes if it can or alert the user if it can't.
     }
 }
Exemplo n.º 9
0
 public ModUpgrade(CkanModule mod, GUIModChangeType changeType, SelectionReason reason, CkanModule targetMod)
     : base(mod, changeType, reason)
 {
     this.targetMod = targetMod;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Callback registered with CKAN to execute any code in the plugin module
 /// whenever CKAN notifies of a change in the mod list.
 /// </summary>
 /// <param name="module">CKAN representation of a mod.</param>
 /// <param name="changeType">The change type made: None, Install, Remove, Update </param>
 public void OnModChanged(CkanModule module, GUIModChangeType changeType)
 {
 }
Exemplo n.º 11
0
 /// <summary>
 /// Callback registered with CKAN to execute any code in the plugin module
 /// whenever CKAN notifies of a change in the mod list.
 /// </summary>
 /// <param name="module">CKAN representation of a mod.</param>
 /// <param name="changeType">The change type made: None, Install, Remove, Update </param>
 public void OnModChanged(CkanModule module, GUIModChangeType changeType)
 {
 }