internal bool InitializeWithTypeLibAttrs(TaskLoggingHelper log, System.Runtime.InteropServices.ComTypes.TYPELIBATTR tlbAttr, ITaskItem originalTaskItem, string targetProcessorArchitecture)
 {
     System.Runtime.InteropServices.ComTypes.TYPELIBATTR typeLibAttr = tlbAttr;
     ComReference.RemapAdoTypeLib(log, ref typeLibAttr);
     if (!ComReference.GetPathOfTypeLib(log, ref typeLibAttr, out this.typeLibPath))
     {
         return(false);
     }
     return(this.InitializeWithPath(log, this.typeLibPath, originalTaskItem, targetProcessorArchitecture));
 }
Example #2
0
        /// <summary>
        /// Initialize the object with type library attributes
        /// </summary>
        internal bool InitializeWithTypeLibAttrs(TaskLoggingHelper log, bool silent, TYPELIBATTR tlbAttr, ITaskItem originalTaskItem, string targetProcessorArchitecture)
        {
            TYPELIBATTR remappableTlbAttr = tlbAttr;

            ComReference.RemapAdoTypeLib(log, silent, ref remappableTlbAttr);

            // for attribute references, the path is not specified, so we need to get it from the registry
            if (!ComReference.GetPathOfTypeLib(log, silent, ref remappableTlbAttr, out this.fullTypeLibPath))
            {
                return(false);
            }

            // Now that we have the path, we can call InitializeWithPath to get the correct TYPELIBATTR set up
            // and the correct ITypeLib pointer.
            return(InitializeWithPath(log, silent, this.fullTypeLibPath, originalTaskItem, targetProcessorArchitecture));
        }