Beispiel #1
0
        /// <summary>
        /// Gets an array of matching symbols for a reference.
        /// </summary>
        /// <param name="wixSimpleReferenceRow">Simple references to resolve.</param>
        /// <returns>Symbols if they were found or empty array if the symbols were not found.</returns>
        internal Symbol[] GetSymbolsForSimpleReference(WixSimpleReferenceRow wixSimpleReferenceRow)
        {
            Symbol[] symbols = null;

            try
            {
                Symbol symbol = this[wixSimpleReferenceRow.SymbolicName];

                if (null == symbol)
                {
                    symbols = new Symbol[0];
                }
                else
                {
                    symbols = new Symbol[1];
                    symbols[0] = symbol;
                }
            }
            catch (DuplicateSymbolsException e)
            {
                symbols = e.GetDuplicateSymbols();
            }

            return symbols;
        }
Beispiel #2
0
 /// <summary>
 /// Creates a shallow copy of a row from another row.
 /// </summary>
 /// <param name="source">The row the data is copied from.</param>
 protected Row(Row source)
 {
     this.table = source.table;
     this.tableDefinition = source.tableDefinition;
     this.rowNumber = source.rowNumber;
     this.operation = source.operation;
     this.sectionId = source.sectionId;
     this.sourceLineNumbers = source.sourceLineNumbers;
     this.fields = source.fields;
     this.symbol = source.symbol;
 }
Beispiel #3
0
        public void AddDuplicate(Symbol symbol)
        {
            if (null == symbol)
            {
                throw new ArgumentNullException("symbol");
            }

            ArrayList symbols;
            object o = this.collection[symbol.Name];
            if (null == o)
            {
                throw new InvalidOperationException(WixStrings.EXP_DidnotFindDuplicateSymbol);
            }
            else
            {
                symbols = o as ArrayList;
                if (null == symbols)
                {
                    symbols = new ArrayList();
                    symbols.Add((Symbol) o);
                }
            }

            symbols.Add(symbol);
            this.collection[symbol.Name] = symbols;
        }
Beispiel #4
0
        /// <summary>
        /// Adds a symbol to the collection.
        /// </summary>
        /// <param name="symbol">Symbol to add collection.</param>
        /// <remarks>Add symbol to hash by name.</remarks>
        public void Add(Symbol symbol)
        {
            if (null == symbol)
            {
                throw new ArgumentNullException("symbol");
            }

            this.collection.Add(symbol.Name, symbol);
        }
Beispiel #5
0
 /// <summary>
 /// Gets the symbol for this action.
 /// </summary>
 /// <param name="section">Section the symbol should reference since actions don't belong to sections.</param>
 /// <returns>Symbol for this action.</returns>
 internal Symbol GetSymbol(Section section)
 {
     Symbol symbol = new Symbol(section, "Actions", String.Concat(Action.SequenceTypeToString(this.sequenceType), "/", this.id));
     return symbol;
 }
 /// <summary>
 /// Creates a feature back link to the specified
 /// </summary>
 /// <param name="componentId">Identifier of component to refer to </param>
 /// <param name="type">Type of feature backlink.</param>
 /// <param name="target">Symbol that refers to the feature.</param>
 public FeatureBacklink(string componentId, FeatureBacklinkType type, Symbol target)
     : this(componentId, type, target.RowId)
 {
 }
        /// <summary>
        /// Adds a symbol to the collection.
        /// </summary>
        /// <param name="symbol">Symbol to add collection.</param>
        /// <remarks>Add symbol to hash by name.</remarks>
        public void AddDuplicate(Symbol symbol)
        {
            if (null == symbol)
            {
                throw new ArgumentNullException("symbol");
            }

            ArrayList symbols;
            object o = this.collection[symbol.Name];
            if (null == o)
            {
                throw new ArgumentNullException("o");
            }
            else if (o is ArrayList)
            {
                symbols = (ArrayList)o;
            }
            else
            {
                Debug.Assert(o is Symbol);
                symbols = new ArrayList();
                symbols.Add((Symbol)o);
            }

            symbols.Add(symbol);
            this.collection[symbol.Name] = symbols;
        }