Inheritance: NAnt.Core.Element
Ejemplo n.º 1
0
            private object GetTypedValue(AssemblyAttribute attribute, StringCollection assemblies, StringCollection imports) {
                // locate type assuming TypeName is fully qualified typename
                PermissionSet domainPermSet = new PermissionSet(PermissionState.Unrestricted);
                AppDomain newDomain = AppDomain.CreateDomain("TypeGatheringDomain", AppDomain.CurrentDomain.Evidence, 
                    AppDomain.CurrentDomain.SetupInformation, domainPermSet);

#if NET_4_0
                TypedValueGatherer typedValueGatherer = (TypedValueGatherer) 
                    newDomain.CreateInstanceAndUnwrap(typeof(TypedValueGatherer).Assembly.FullName, 
                    typeof(TypedValueGatherer).FullName, false, BindingFlags.Public | BindingFlags.Instance, 
                    null, new object[0], CultureInfo.InvariantCulture, new object[0]);
#else
                TypedValueGatherer typedValueGatherer = (TypedValueGatherer) 
                    newDomain.CreateInstanceAndUnwrap(typeof(TypedValueGatherer).Assembly.FullName, 
                    typeof(TypedValueGatherer).FullName, false, BindingFlags.Public | BindingFlags.Instance, 
                    null, new object[0], CultureInfo.InvariantCulture, new object[0], 
                    AppDomain.CurrentDomain.Evidence);
#endif

                object typedValue = typedValueGatherer.GetTypedValue(
                    assemblies, imports, attribute.TypeName, attribute.Value);

                // unload newly created AppDomain
                AppDomain.Unload(newDomain);

                return typedValue;
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Removes a member from the collection.
 /// </summary>
 /// <param name="item">The <see cref="AssemblyAttribute"/> to remove from the collection.</param>
 public void Remove(AssemblyAttribute item)
 {
     base.List.Remove(item);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AssemblyAttributeCollection"/> class
 /// with the specified array of <see cref="AssemblyAttribute"/> instances.
 /// </summary>
 public AssemblyAttributeCollection(AssemblyAttribute[] value)
 {
     AddRange(value);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Retrieves the index of a specified <see cref="AssemblyAttribute"/> object in the collection.
 /// </summary>
 /// <param name="item">The <see cref="AssemblyAttribute"/> object for which the index is returned.</param> 
 /// <returns>
 /// The index of the specified <see cref="AssemblyAttribute"/>. If the <see cref="AssemblyAttribute"/> is not currently a member of the collection, it returns -1.
 /// </returns>
 public int IndexOf(AssemblyAttribute item)
 {
     return base.List.IndexOf(item);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Inserts a <see cref="AssemblyAttribute"/> into the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
 /// <param name="item">The <see cref="AssemblyAttribute"/> to insert.</param>
 public void Insert(int index, AssemblyAttribute item)
 {
     base.List.Insert(index, item);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Determines whether a <see cref="AssemblyAttribute"/> is in the collection.
 /// </summary>
 /// <param name="item">The <see cref="AssemblyAttribute"/> to locate in the collection.</param> 
 /// <returns>
 /// <see langword="true" /> if <paramref name="item"/> is found in the 
 /// collection; otherwise, <see langword="false" />.
 /// </returns>
 public bool Contains(AssemblyAttribute item)
 {
     return base.List.Contains(item);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Copies the entire collection to a compatible one-dimensional array, starting at the specified index of the target array.        
 /// </summary>
 /// <param name="array">The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing.</param> 
 /// <param name="index">The zero-based index in <paramref name="array"/> at which copying begins.</param>
 public void CopyTo(AssemblyAttribute[] array, int index)
 {
     base.List.CopyTo(array, index);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Adds a <see cref="AssemblyAttribute"/> to the end of the collection.
 /// </summary>
 /// <param name="item">The <see cref="AssemblyAttribute"/> to be added to the end of the collection.</param> 
 /// <returns>The position into which the new element was inserted.</returns>
 public int Add(AssemblyAttribute item)
 {
     return base.List.Add(item);
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Adds the elements of a <see cref="AssemblyAttribute"/> array to the end of the collection.
 /// </summary>
 /// <param name="items">The array of <see cref="AssemblyAttribute"/> elements to be added to the end of the collection.</param> 
 public void AddRange(AssemblyAttribute[] items)
 {
     for (int i = 0; (i < items.Length); i = (i + 1)) {
         Add(items[i]);
     }
 }
 /// <summary>
 /// Removes a member from the collection.
 /// </summary>
 /// <param name="item">The <see cref="AssemblyAttribute"/> to remove from the collection.</param>
 public void Remove(AssemblyAttribute item)
 {
     base.List.Remove(item);
 }
 /// <summary>
 /// Inserts a <see cref="AssemblyAttribute"/> into the collection at the specified index.
 /// </summary>
 /// <param name="index">The zero-based index at which <paramref name="item"/> should be inserted.</param>
 /// <param name="item">The <see cref="AssemblyAttribute"/> to insert.</param>
 public void Insert(int index, AssemblyAttribute item)
 {
     base.List.Insert(index, item);
 }
 /// <summary>
 /// Retrieves the index of a specified <see cref="AssemblyAttribute"/> object in the collection.
 /// </summary>
 /// <param name="item">The <see cref="AssemblyAttribute"/> object for which the index is returned.</param>
 /// <returns>
 /// The index of the specified <see cref="AssemblyAttribute"/>. If the <see cref="AssemblyAttribute"/> is not currently a member of the collection, it returns -1.
 /// </returns>
 public int IndexOf(AssemblyAttribute item)
 {
     return(base.List.IndexOf(item));
 }
 /// <summary>
 /// Determines whether a <see cref="AssemblyAttribute"/> is in the collection.
 /// </summary>
 /// <param name="item">The <see cref="AssemblyAttribute"/> to locate in the collection.</param>
 /// <returns>
 /// <see langword="true" /> if <paramref name="item"/> is found in the
 /// collection; otherwise, <see langword="false" />.
 /// </returns>
 public bool Contains(AssemblyAttribute item)
 {
     return(base.List.Contains(item));
 }
 /// <summary>
 /// Adds a <see cref="AssemblyAttribute"/> to the end of the collection.
 /// </summary>
 /// <param name="item">The <see cref="AssemblyAttribute"/> to be added to the end of the collection.</param>
 /// <returns>The position into which the new element was inserted.</returns>
 public int Add(AssemblyAttribute item)
 {
     return(base.List.Add(item));
 }