Example #1
0
        internal static ComReferenceNode AddComReference(ProjectNode project, VSCOMPONENTSELECTORDATA selectorData)
        {
            // Get the ReferenceContainerNode for this project.
            IReferenceContainer container = project.GetReferenceContainer();

            container.AddReferenceFromSelectorData(selectorData);

            // Now find the refererence added.
            ReferenceContainerNode containerNode = container as ReferenceContainerNode;

            for (HierarchyNode n = containerNode.FirstChild; n != null; n = n.NextSibling)
            {
                if (n is ComReferenceNode)
                {
                    ComReferenceNode refererenceNode = n as ComReferenceNode;

                    // We check if the name is the same and the type guid is the same
                    if (refererenceNode.TypeGuid == selectorData.guidTypeLibrary && String.Compare(refererenceNode.Caption, selectorData.bstrTitle, StringComparison.OrdinalIgnoreCase) == 0)
                    {
                        return(refererenceNode);
                    }
                }
            }

            throw new InvalidOperationException("The Com Refererence added cannot be found");
        }
Example #2
0
 internal XSharpOAComReference(ComReferenceNode comReference) : base(comReference)
 {
 }
 public XSharpComReferenceNodeProperties(ComReferenceNode node)
     : base(node)
 {
     _node = node;
 }
		/// <summary>
		/// Creates a com reference node from a selector data.
		/// </summary>
		protected virtual ComReferenceNode CreateComReferenceNode(Microsoft.VisualStudio.Shell.Interop.VSCOMPONENTSELECTORDATA selectorData)
		{
			ComReferenceNode node = new ComReferenceNode(this.ProjectMgr, selectorData);
			return node;
		}