Beispiel #1
0
        public Task <IProfileVisual> CreateProfileAsync(IVsHierarchy hierarchy, object optionsControl)
        {
            CustomPublishProfile customProfile = new CustomPublishProfile()
            {
                ProfileName   = "ReproProfile",
                Configuration = "Release"
            };
            string profileFullPath = Path.Combine(PublishProfilesFolder, "CustomProfile.pubxml");

            File.WriteAllText(profileFullPath, customProfile.ToString());
            IProfileVisual visual = new ReproVisual(customProfile, profileFullPath, hierarchy);

            return(System.Threading.Tasks.Task.FromResult(visual));
        }
Beispiel #2
0
 public bool TryGetProfileVisual(string profileId, out IProfileVisual profileVisual)
 {
     profileVisual = null;
     try
     {
         string profileContents       = File.ReadAllText(profileId);
         CustomPublishProfile profile = new CustomPublishProfile();
         profile.LoadModel(profileContents);
         bool isCustomProfile = !string.IsNullOrEmpty(profile.ProfileName) && !string.IsNullOrEmpty(profile.Configuration);
         if (isCustomProfile)
         {
             profileVisual = new ReproVisual(profile, profileId, _hierarchy);
             return(true);
         }
     }
     catch { }
     return(false);
 }