示例#1
0
        /// <summary>
        /// Links a reference node to the project and hierarchy.
        /// </summary>
        protected override void BindReferenceData()
        {
            string relativePath = CommonUtils.GetRelativeFilePath(ProjectMgr.ProjectFolder, _filename);

            // If the item has not been set correctly like in case of a new reference added it now.
            // The constructor for the AssemblyReference node will create a default project item. In that case the Item is null.
            // We need to specify here the correct project element.
            if (ItemNode == null || ItemNode is VirtualProjectElement)
            {
                ItemNode = new MsBuildProjectElement(ProjectMgr, relativePath, ProjectFileConstants.Reference);
            }

            // Set the basic information we know about
            ItemNode.SetMetadata(ProjectFileConstants.Name, Path.GetFileName(_filename));
            ItemNode.SetMetadata(PythonConstants.PythonExtension, relativePath);
        }
示例#2
0
        /// <summary>
        /// Links a reference node to the project and hierarchy.
        /// </summary>
        protected override void BindReferenceData()
        {
            Debug.Assert(_feed != null, "The _feed field has not been initialized");

            // If the item has not been set correctly like in case of a new reference added it now.
            // The constructor for the AssemblyReference node will create a default project item. In that case the Item is null.
            // We need to specify here the correct project element.
            if (ItemNode == null || ItemNode is VirtualProjectElement)
            {
                ItemNode = new MsBuildProjectElement(
                    ProjectMgr,
                    _feed + "?" + _productId,
                    ProjectFileConstants.WebPiReference
                    );
            }

            // Set the basic information we know about
            ItemNode.SetMetadata("Feed", _feed);
            ItemNode.SetMetadata("ProductId", _productId);
            ItemNode.SetMetadata("FriendlyName", _friendlyName);
        }