Beispiel #1
0
        /// <summary>
        /// Gets the symbols that were not referenced during processing (usually linking).
        /// </summary>
        /// <param name="referencedSymbols">Collection of symbol names in string form.</param>
        /// <param name="messageHandler">Message handler to display errors while acquiring symbols.</param>
        /// <returns>Collection of unreferenced symbols.</returns>
        internal SymbolCollection GetOrphanedSymbols(StringCollection referencedSymbols, IMessageHandler messageHandler)
        {
            SymbolCollection unreferencedSymbols = new SymbolCollection();

            // Loop through all of the symbols in all of the sections in this collection
            // looking for names that are not in the provided string collection.
            foreach (Section section in this.collection.Keys)
            {
                if (SectionType.Product == section.Type || SectionType.Module == section.Type || SectionType.PatchCreation == section.Type || SectionType.Patch == section.Type)
                {
                    // Skip all symbols in the entry section;
                    // They may appear to be unreferenced but they
                    // will get into the linked image.
                    continue;
                }

                foreach (Symbol symbol in section.GetSymbols(messageHandler))
                {
                    if (!referencedSymbols.Contains(symbol.Name))
                    {
                        // If the symbol was created by the user, then it will have
                        // a row associated with it.  We don't care about generated
                        // (those with out Rows) unreferenced symbols so skip them.
                        if (null != symbol.Row && !unreferencedSymbols.Contains(symbol.Name))
                        {
                            unreferencedSymbols.Add(symbol);
                        }
                    }
                }
            }

            return(unreferencedSymbols);
        }
Beispiel #2
0
        /// <summary>
        /// Gets the symbols that were not referenced during processing (usually linking).
        /// </summary>
        /// <param name="referencedSymbols">Collection of symbol names in string form.</param>
        /// <param name="messageHandler">Message handler to display errors while acquiring symbols.</param>
        /// <returns>Collection of unreferenced symbols.</returns>
        internal SymbolCollection GetOrphanedSymbols(StringCollection referencedSymbols, IMessageHandler messageHandler)
        {
            SymbolCollection unreferencedSymbols = new SymbolCollection();

            // Loop through all of the symbols in all of the sections in this collection
            // looking for names that are not in the provided string collection.
            foreach (Section section in this.collection)
            {
                foreach (Symbol symbol in section.GetSymbols(messageHandler))
                {
                    if (!referencedSymbols.Contains(symbol.Name))
                    {
                        // If the symbol was created by the user, then it will have
                        // a row associated with it.  We don't care about generated
                        // (those with out Rows) unreferenced symbols so skip them.
                        if (null != symbol.Row && !unreferencedSymbols.Contains(symbol.Name))
                        {
                            unreferencedSymbols.Add(symbol);
                        }
                    }
                }
            }

            return(unreferencedSymbols);
        }
Beispiel #3
0
 /// <summary>
 /// Loads the standard actions' symbols into the entry section.
 /// </summary>
 /// <param name="allSymbols">Collection of symbols.</param>
 /// <param name="entrySection">Entry section.</param>
 /// <param name="actionTable">Table that contains the standard actions.</param>
 private void LoadStandardActionSymbols(SymbolCollection allSymbols, Section entrySection, ActionTable actionTable)
 {
     foreach (Action action in actionTable)
     {
         // if the action's symbol has not already been defined (i.e. overriden by the user), add it now
         Symbol symbol = action.GetSymbol(entrySection);
         if (!allSymbols.Contains(symbol.Name))
         {
             allSymbols.Add(symbol);
         }
     }
 }
        /// <summary>
        /// Gets the symbols that were not referenced during processing (usually linking).
        /// </summary>
        /// <param name="referencedSymbols">Collection of symbol names in string form.</param>
        /// <param name="messageHandler">Message handler to display errors while acquiring symbols.</param>
        /// <returns>Collection of unreferenced symbols.</returns>
        internal SymbolCollection GetOrphanedSymbols(StringCollection referencedSymbols, IMessageHandler messageHandler)
        {
            SymbolCollection unreferencedSymbols = new SymbolCollection();

            // Loop through all of the symbols in all of the sections in this collection
            // looking for names that are not in the provided string collection.
            foreach (Section section in this.collection.Keys)
            {
                if (SectionType.Product == section.Type || SectionType.Module == section.Type || SectionType.PatchCreation == section.Type || SectionType.Patch == section.Type)
                {
                    // Skip all symbols in the entry section; 
                    // They may appear to be unreferenced but they 
                    // will get into the linked image.
                    continue;
                }

                foreach (Symbol symbol in section.GetSymbols(messageHandler))
                {
                    if (!referencedSymbols.Contains(symbol.Name))
                    {
                        // If the symbol was created by the user, then it will have
                        // a row associated with it.  We don't care about generated
                        // (those with out Rows) unreferenced symbols so skip them.
                        if (null != symbol.Row && !unreferencedSymbols.Contains(symbol.Name))
                        {
                            unreferencedSymbols.Add(symbol);
                        }
                    }
                }
            }

            return unreferencedSymbols;
        }
Beispiel #5
0
 /// <summary>
 /// Load the standard action symbols.
 /// </summary>
 /// <param name="allSymbols">Collection of symbols.</param>
 private void LoadStandardActionSymbols(SymbolCollection allSymbols)
 {
     foreach (WixActionRow actionRow in this.standardActions)
     {
         // if the action's symbol has not already been defined (i.e. overriden by the user), add it now
         if (!allSymbols.Contains(actionRow.Symbol.Name))
         {
             allSymbols.Add(actionRow.Symbol);
         }
     }
 }