Ejemplo n.º 1
0
 /// <summary>
 /// Updates the profile.
 /// </summary>
 public void UpdateProfile(IModProfile p_impModProfile, byte[] p_bteIniEdits, byte[] p_bteLoadOrder, string[] p_strOptionalFiles)
 {
     UpdateCurrentProfileModCount();
     SaveProfile(p_impModProfile, null, p_bteIniEdits, p_bteLoadOrder, p_strOptionalFiles);
     m_tslProfiles.Remove(CurrentProfile);
     m_tslProfiles.Add(p_impModProfile);
     SaveConfig();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Removes a task from the monitor.
 /// </summary>
 /// <remarks>
 /// Tasks can only be removed if they are not running.
 /// </remarks>
 /// <param name="p_tskTask">The task to remove.</param>
 public void RemoveDownload(AddModTask p_tskTask)
 {
     if (CanRemove(p_tskTask))
     {
         p_tskTask.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(Task_PropertyChanged);
         m_oclTasks.Remove(p_tskTask);
         m_setActiveTasks.Remove(p_tskTask);
     }
 }
Ejemplo n.º 3
0
            /// <summary>
            /// Handles the <see cref="INotifyCollectionChanged.CollectionChanged"/> event of the
            /// master list of ordered plugins.
            /// </summary>
            /// <remarks>
            /// This applies any changes that are made to the maser list to the transacted list
            /// with which we are currently working.
            /// </remarks>
            /// <param name="sender">The object that raised the event.</param>
            /// <param name="e">A <see cref="NotifyCollectionChangedEventArgs"/> describing the event arguments.</param>
            private void MasterOrderedPlugins_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
            {
                switch (e.Action)
                {
                case NotifyCollectionChangedAction.Add:
                {
                    Plugin plgPrevious = null;
                    if (e.NewStartingIndex > 0)
                    {
                        plgPrevious = EnlistedPluginOrderLog.m_oclOrderedPlugins[e.NewStartingIndex - 1];
                    }
                    Int32 intStartIndex = m_oclOrderedPlugins.IndexOf(plgPrevious, PluginComparer.Filename) + 1;
                    foreach (Plugin plgAdded in e.NewItems)
                    {
                        m_oclOrderedPlugins.Insert(intStartIndex++, plgAdded);
                    }
                }
                break;

                case NotifyCollectionChangedAction.Remove:
                    foreach (Plugin plgRemoved in e.OldItems)
                    {
                        m_oclOrderedPlugins.Remove(plgRemoved, PluginComparer.Filename);
                    }
                    break;

                case NotifyCollectionChangedAction.Replace:
                    for (Int32 i = 0; i < e.OldItems.Count; i++)
                    {
                        m_oclOrderedPlugins.Remove((Plugin)e.OldItems[i], PluginComparer.Filename);

                        Int32  intNewIndex = e.NewStartingIndex + i;
                        Plugin plgPrevious = null;
                        if (intNewIndex > 0)
                        {
                            plgPrevious = EnlistedPluginOrderLog.m_oclOrderedPlugins[intNewIndex - 1];
                        }
                        Int32 intStartIndex = m_oclOrderedPlugins.IndexOf(plgPrevious, PluginComparer.Filename) + 1;
                        m_oclOrderedPlugins.Insert(intStartIndex, (Plugin)e.NewItems[i]);
                    }
                    break;

                case NotifyCollectionChangedAction.Reset:
                    m_oclOrderedPlugins.Clear();
                    break;
                }
            }
Ejemplo n.º 4
0
 /// <summary>
 /// Removes a task from the monitor.
 /// </summary>
 /// <remarks>
 /// Tasks can only be removed if they are not running.
 /// </remarks>
 /// <param name="p_tskTask">The task to remove.</param>
 public void RemoveActivity(IBackgroundTask p_tskTask)
 {
     if (CanRemove(p_tskTask))
     {
         p_tskTask.PropertyChanged -= new System.ComponentModel.PropertyChangedEventHandler(Task_PropertyChanged);
         m_oclTasks.Remove(p_tskTask);
         m_setActiveTasks.Remove(p_tskTask);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Removes the specified mod from the registry.
 /// </summary>
 /// <param name="p_modMod">The mod to unregister.</param>
 public void UnregisterMod(IMod p_modMod)
 {
     m_oclRegisteredMods.Remove(p_modMod);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Removes a task from the monitor.
 /// </summary>
 /// <remarks>
 /// Tasks can only be removed if they are not running.
 /// </remarks>
 /// <param name="p_tskTask">The task to remove.</param>
 public void RemoveTask(ModInstaller p_tskTask)
 {
     m_oclTasks.Remove(p_tskTask);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Removes a category from the list.
 /// </summary>
 /// <param name="p_mctCategory">The <see cref="IModCategory"/> to be removed.</param>
 public void RemoveCategory(IModCategory p_mctCategory)
 {
     m_tslCategories.Remove(p_mctCategory);
     SaveCategories();
 }