Exemplo n.º 1
0
 public SelectContextFrm(Dictionary<string, string> beDic, string projectName, VSLangProj.VSProject curProj)
 {
     InitializeComponent();
     this.BEList = beDic;
     this.projectName = projectName;
     this.CurProj = curProj;
 }
Exemplo n.º 2
0
    public ReferenceEventArgs(IVsHierarchy hierarchy, uint itemId, VSLangProj.Reference reference)
    {
      ErrorHelper.ThrowIsNull(hierarchy, nameof(hierarchy));
      ErrorHelper.ThrowIsNull(reference, nameof(reference));

      Hierarchy = hierarchy;
      ItemId    = itemId;
      Reference = reference;
    }
        public VSMDPythonProvider(VSLangProj.VSProject project)
        {
            if (project == null)
                throw new ArgumentNullException("project");

            vsproject = project;

            // Create the provider
            this.ReferencesEvents_ReferenceRemoved(null);
            vsproject.Events.ReferencesEvents.ReferenceAdded += new VSLangProj._dispReferencesEvents_ReferenceAddedEventHandler(ReferencesEvents_ReferenceAdded);
            vsproject.Events.ReferencesEvents.ReferenceRemoved += new VSLangProj._dispReferencesEvents_ReferenceRemovedEventHandler(ReferencesEvents_ReferenceRemoved);
            vsproject.Events.ReferencesEvents.ReferenceChanged += new VSLangProj._dispReferencesEvents_ReferenceChangedEventHandler(ReferencesEvents_ReferenceRemoved);
        }
 /// <summary>
 /// When a reference is removed/changed, let the provider know
 /// </summary>
 /// <param name="reference">Reference being removed</param>
 void ReferencesEvents_ReferenceRemoved(VSLangProj.Reference reference)
 {
     // Because our provider only has an AddReference method and no way to
     // remove them, we end up having to recreate it.
     provider = new IronPython.CodeDom.PythonProvider();
     if (vsproject.References != null)
     {
         foreach (VSLangProj.Reference currentReference in vsproject.References)
         {
             provider.AddReference(currentReference.Path);
         }
     }
 }
 /// <summary>
 /// When a reference is added, add it to the provider
 /// </summary>
 /// <param name="reference">Reference being added</param>
 void ReferencesEvents_ReferenceAdded(VSLangProj.Reference reference)
 {
     provider.AddReference(reference.Path);
 }
Exemplo n.º 6
0
 void VSLangProj.VSProject.Exec(VSLangProj.prjExecCommand command, int bSuppressUI, object varIn, out object pVarOut)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Exemplo n.º 7
0
 void VSLangProj.VSProject.CopyProject(string bstrDestFolder, string bstrDestUNCPath, VSLangProj.prjCopyProjectOption copyProjectOption, string bstrUsername, string bstrPassword)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Exemplo n.º 8
0
      static public void AddReferencesToProject(VSLangProj.References references, Project project)
      {
         if (project == null)
            throw new Exception("Invalid  Project parameter");

         VSLangProj.VSProject vsProject = (VSLangProj.VSProject)project.Object;

         foreach (VSLangProj.Reference refernce in references)
         {
            try
            {

               vsProject.References.Add(refernce.Path);
            }
            catch (Exception ex)
            {
               //ignore...
               Logger.LogException(ex);
            }
         }
      }
        /// <summary>
        /// Creates the visual studio reference from reference.
        /// </summary>
        /// <param name="solution">The solution.</param>
        /// <param name="pReference">The p reference.</param>
        /// <returns></returns>
        internal static ProjectReference CreateVisualStudioReferenceFromReference(SolutionNode solution, VSLangProj.Reference pReference)
        {
            if (pReference == null || (pReference.SourceProject == null && String.IsNullOrEmpty(pReference.Path)))
                return null;

            string strongName = null;
            if (pReference.StrongName)
            {
                string culture = pReference.Culture;
                if (String.IsNullOrEmpty(culture))
                    culture = "neutral";
                strongName = String.Format("{0}, Version={1}, Culture={2}, PublicKeyToken={3}", pReference.Name, pReference.Version, culture, pReference.PublicKeyToken);
            }
            else
                strongName = String.Format("{0}, Version={1}", pReference.Name, pReference.Version);

            return CreateVSReference(solution, pReference.ContainingProject, pReference.SourceProject, pReference.Name, pReference.Path, pReference.Version, strongName, pReference.CopyLocal);
        }
Exemplo n.º 10
0
 public VSProjectWrapper(VSLangProj.VSProject vsproj)
 {
     _vsproj = vsproj;
 }