public void Reset()
		{
			Name = OptionGroup.Name;
			Type = OptionGroup.Type;
			OptionSortOrder = OptionGroup.OptionSortOrder;
			Options = new ThreadSafeObservableList<Option>(OptionGroup.Options);
		}
		public void Reset(string p_strPropertyName)
		{
			if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.InstallStepSortOrder)))
				InstallStepSortOrder = Script.InstallStepSortOrder;
			else if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.InstallSteps)))
				InstallSteps = new ThreadSafeObservableList<InstallStep>(Script.InstallSteps);
		}
		public void Reset(string p_strPropertyName)
		{
			if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.Name)))
				Name = InstallStep.Name;
			else if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.GroupSortOrder)))
				GroupSortOrder = InstallStep.GroupSortOrder;
			else if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.OptionGroups)))
				OptionGroups = new ThreadSafeObservableList<OptionGroup>(InstallStep.OptionGroups);
		}
			/// <summary>
			/// A simple constructor that initializes the object with the given values.
			/// </summary>
			/// <param name="p_txTransaction">The transaction into which we are enlisting.</param>
			/// <param name="p_polPluginOrderLog">The <see cref="PluginOrderLog"/> whose actions are being transacted.</param>
			public TransactionEnlistment(Transaction p_txTransaction, PluginOrderLog p_polPluginOrderLog)
			{
				CurrentTransaction = p_txTransaction;
				EnlistedPluginOrderLog = p_polPluginOrderLog;
				m_oclOrderedPlugins = new ThreadSafeObservableList<Plugin>(EnlistedPluginOrderLog.m_oclOrderedPlugins);
				m_rolOrderedPlugins = new ReadOnlyObservableList<Plugin>(m_oclOrderedPlugins);

				EnlistedPluginOrderLog.m_oclOrderedPlugins.CollectionChanged += new NotifyCollectionChangedEventHandler(MasterOrderedPlugins_CollectionChanged);
			}
		public void Reset(string p_strPropertyName)
		{
			if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.Name)))
				Name = OptionGroup.Name;
			else if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.Type)))
				Type = OptionGroup.Type;
			else if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.OptionSortOrder)))
				OptionSortOrder = OptionGroup.OptionSortOrder;
			else if (p_strPropertyName.Equals(ObjectHelper.GetPropertyName(() => this.Options)))
				Options = new ThreadSafeObservableList<Option>(OptionGroup.Options);
		}
		/// <summary>
		/// Loads the plugin order data from the permanent store.
		/// </summary>
		private void LoadPluginOrder()
		{
			Trace.TraceInformation("Loading Plugin Order...");
			Trace.Indent();
			m_oclOrderedPlugins = new ThreadSafeObservableList<Plugin>();
            if (LogSerializer != null)
			    foreach (string strPlugin in LogSerializer.LoadPluginOrder())
			    {
				    Plugin plgPlugin = ManagedPluginRegistry.GetPlugin(strPlugin);
				    Trace.TraceInformation("Loading {0} (IsNull={1})", strPlugin, (plgPlugin == null));
				    if ((plgPlugin != null) && !m_oclOrderedPlugins.Contains(plgPlugin))
						m_oclOrderedPlugins.Add(plgPlugin);
			    }
			Trace.Unindent();
		}
 public void Reset()
 {
     Name           = InstallStep.Name;
     GroupSortOrder = InstallStep.GroupSortOrder;
     OptionGroups   = new ThreadSafeObservableList <OptionGroup>(InstallStep.OptionGroups);
 }
		public void Reset()
		{
			InstallStepSortOrder = Script.InstallStepSortOrder;
			InstallSteps = new ThreadSafeObservableList<InstallStep>(Script.InstallSteps);
		}
Exemplo n.º 9
0
 public void SetConfig(ThreadSafeObservableList <IModProfile> p_iplProfiles)
 {
     m_tslProfiles.Clear();
     m_tslProfiles = new ThreadSafeObservableList <IModProfile>(p_iplProfiles);
 }
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_cndCondition">The condition that must by fulfilled for this pattern's files to be installed.</param>
 /// <param name="p_lstFiles">The files that are to be installed if the given condition is fulfilled.</param>
 public ConditionallyInstalledFileSet(ICondition p_cndCondition, IList <InstallableFile> p_lstFiles)
 {
     m_cndCondition = p_cndCondition;
     m_lstFiles     = (p_lstFiles == null) ? new ThreadSafeObservableList <InstallableFile>() : new ThreadSafeObservableList <InstallableFile>(p_lstFiles);
     m_lstFiles.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Files_CollectionChanged);
 }
Exemplo n.º 11
0
            /// <summary>
            /// Sets the order of the plugins to the given order.
            /// </summary>
            /// <remarks>
            /// If the given list does not include all registered plugins, then the plugins are ordered in a manner
            /// so as to not displace the positions of the plugins whose order was not specified.
            /// </remarks>
            /// <param name="p_lstOrderedPlugins">The list indicating the desired order of the plugins.</param>
            public void SetPluginOrder(IList <Plugin> p_lstOrderedPlugins)
            {
                PluginComparer pcpComparer = PluginComparer.Filename;
                Dictionary <Plugin, Plugin>       dicPredecessors  = new Dictionary <Plugin, Plugin>();
                ThreadSafeObservableList <Plugin> oclUnorderedList = m_oclOrderedPlugins;
                IList <Plugin> lstOrderedList = p_lstOrderedPlugins;
                string         strError       = String.Empty;

                try
                {
                    strError = "Setup";
                    for (Int32 i = 0; i < oclUnorderedList.Count; i++)
                    {
                        if (!lstOrderedList.Contains(oclUnorderedList[i], pcpComparer))
                        {
                            dicPredecessors[oclUnorderedList[i]] = (i > 0) ? oclUnorderedList[i - 1] : null;
                        }
                    }

                    strError = "Specified";
                    //sort the items whose order has been specified
                    for (Int32 i = 0; i < lstOrderedList.Count; i++)
                    {
                        strError = "intOldIndex";
                        Int32 intOldIndex = 0;
                        for (intOldIndex = 0; intOldIndex < oclUnorderedList.Count; intOldIndex++)
                        {
                            if (pcpComparer.Equals(oclUnorderedList[intOldIndex], lstOrderedList[i]))
                            {
                                break;
                            }
                        }
                        if (intOldIndex >= oclUnorderedList.Count)
                        {
                            strError = "Insert";
                            oclUnorderedList.Insert(i, lstOrderedList[i]);
                            continue;
                        }

                        if (intOldIndex != i)
                        {
                            strError = "Move intOldIndex";
                            oclUnorderedList.Move(intOldIndex, i);
                        }
                    }

                    strError = "Predecessor";
                    //sort the items whose order has not been specified
                    // if an item's order hasn't been specified, it is placed after the
                    // item it followed in the original, unordered, list
                    for (Int32 i = lstOrderedList.Count; i < oclUnorderedList.Count; i++)
                    {
                        Plugin plgPredecessor = null;
                        Int32  intNewIndex    = -1;
                        if (dicPredecessors.ContainsKey(oclUnorderedList[i]))
                        {
                            plgPredecessor = dicPredecessors[oclUnorderedList[i]];
                        }

                        //if the predecessor is null, then the item was at the beginning of the list
                        if (plgPredecessor != null)
                        {
                            for (intNewIndex = 0; intNewIndex < oclUnorderedList.Count; intNewIndex++)
                            {
                                if (pcpComparer.Equals(oclUnorderedList[intNewIndex], plgPredecessor))
                                {
                                    break;
                                }
                            }
                        }

                        strError = "intNewIndex + 1";
                        if (intNewIndex + 1 != i)
                        {
                            oclUnorderedList.Move(i, intNewIndex + 1);
                        }
                    }
                    EnlistedPluginOrderLog.OrderValidator.CorrectOrder(oclUnorderedList);

                    if (CurrentTransaction == null)
                    {
                        Commit();
                    }
                    else
                    {
                        Enlist();
                    }
                }
                catch (Exception e)
                {
                    throw new Exception(strError, e);
                }
            }
Exemplo n.º 12
0
		public void Reset()
		{
			Name = InstallStep.Name;
			GroupSortOrder = InstallStep.GroupSortOrder;
			OptionGroups = new ThreadSafeObservableList<OptionGroup>(InstallStep.OptionGroups);
		}
		/// <summary>
		/// A simple constructor that initializes the object with the given values.
		/// </summary>
		/// <param name="p_cndCondition">The condition that must by fulfilled for this pattern's files to be installed.</param>
		/// <param name="p_lstFiles">The files that are to be installed if the given condition is fulfilled.</param>
		public ConditionallyInstalledFileSet(ICondition p_cndCondition, IList<InstallableFile> p_lstFiles)
		{
			m_cndCondition = p_cndCondition;
			m_lstFiles = (p_lstFiles == null) ? new ThreadSafeObservableList<InstallableFile>() : new ThreadSafeObservableList<InstallableFile>(p_lstFiles);
			m_lstFiles.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(Files_CollectionChanged);
		}
 public void Reset()
 {
     InstallStepSortOrder = Script.InstallStepSortOrder;
     InstallSteps         = new ThreadSafeObservableList <InstallStep>(Script.InstallSteps);
 }