本文整理汇总了C#中IProjectService.GetProjectPath方法的典型用法代码示例。如果您正苦于以下问题:C# IProjectService.GetProjectPath方法的具体用法?C# IProjectService.GetProjectPath怎么用?C# IProjectService.GetProjectPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IProjectService
的用法示例。
在下文中一共展示了IProjectService.GetProjectPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddPlugin
/// <summary>
/// Adds the plugin.
/// </summary>
/// <param name="projectService">The project service.</param>
/// <param name="plugin">The plugin.</param>
/// <param name="folderName">Name of the folder.</param>
/// <param name="extensionName">Name of the extension.</param>
/// <returns>True or false.</returns>
public bool AddPlugin(
IProjectService projectService,
Plugin plugin,
string folderName,
string extensionName)
{
TraceService.WriteLine("PluginService::AddPlugin " + plugin.FriendlyName);
bool added = false;
string projectPath = projectService.GetProjectPath();
string source = plugin.Source;
string destination = string.Format(@"{0}\Lib\{1}", projectPath, plugin.FileName);
CodeConfig codeConfig = this.codeConfigService.GetCodeConfig(projectService, plugin.FriendlyName, false);
//// we need to work out if the user has requested that the plugin is added from nuget
//// and also if the plugin can be added from nuget - currently not all can!
bool addPluginFromLocalDisk = this.codeConfigService.UseLocalDiskCopy(codeConfig);
//// at this moment we only want ot do the core as this plugin might not be
//// supported in the ui project.
if (extensionName == Settings.Core ||
extensionName == Settings.CoreTests)
{
added = this.AddCorePlugin(
projectService,
plugin,
codeConfig,
addPluginFromLocalDisk,
destination,
source);
}
else
{
//// now if we are not the core project we need to add the platform specific assemblies
//// and the bootstrap item templates!
string extensionSource = this.GetSourcePath(plugin, extensionName);
string extensionDestination = this.GetPluginPath(extensionName, destination);
if (this.fileSystem.File.Exists(extensionSource))
{
//// if the plugin is supported add in the core library.
added = this.AddUIPlugin(
projectService,
plugin.FriendlyName,
source,
destination,
extensionSource,
extensionDestination,
addPluginFromLocalDisk);
}
}
return added;
}
示例2: ProcessConfig
/// <summary>
/// Processes the config.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="projectService">The project service.</param>
/// <param name="codeConfig">The code config.</param>
internal void ProcessConfig(
IVisualStudioService visualStudioService,
IProjectService projectService,
CodeConfig codeConfig)
{
TraceService.WriteLine("ServicesService::ProcessConfig");
if (codeConfig != null)
{
//// do we have any dependent plugins?
codeConfig.DependentPlugins.ForEach(x => this.AddDependantPlugin(visualStudioService, x));
string sourceDirectory = this.settingsService.MvvmCrossAssembliesPath;
//// don't need to add reference if we are going to use nuget.
if (this.settingsService.UseNugetForServices == false)
{
foreach (string reference in codeConfig.References)
{
projectService.AddReference(
"Lib",
projectService.GetProjectPath() + @"\Lib\" + reference,
sourceDirectory + @"\" + reference,
this.settingsService.IncludeLibFolderInProjects,
this.settingsService.CopyAssembliesToLibFolder);
}
}
//// if we want to add via nuget then generate the command.
if (this.settingsService.UseNugetForServices ||
codeConfig.NugetInstallationMandatory == "Y")
{
////this.nugetService.UpdateViaNuget(projectService, codeConfig);
}
//// apply any code dependencies
IEnumerable<string> messages = this.codeConfigService.ApplyCodeDependencies(
visualStudioService,
codeConfig);
this.Messages.AddRange(messages);
}
}
示例3: ProcessConfig
/// <summary>
/// Processes the config.
/// </summary>
/// <param name="visualStudioService">The visual studio service.</param>
/// <param name="projectService">The project service.</param>
/// <param name="configFile">The config file.</param>
internal void ProcessConfig(
IVisualStudioService visualStudioService,
IProjectService projectService,
string configFile)
{
TraceService.WriteLine("ServicesService::ProcessConfig");
CodeConfig codeConfig = this.codeConfigService.GetCodeConfigFromPath(configFile);
if (codeConfig != null)
{
//// do we have any dependent plugins?
if (codeConfig.DependentPlugins != null)
{
foreach (string dependentPlugin in codeConfig.DependentPlugins)
{
List<Plugin> plugins = new List<Plugin>();
string source = this.settingsService.InstalledDirectory + @"\Plugins\" + dependentPlugin;
//// append dll if its missing.
if (source.ToLower().EndsWith(".dll") == false)
{
source += ".dll";
}
FileInfo fileInfo = new FileInfo(source);
Plugin plugin = this.pluginTranslator.Translate(fileInfo);
plugins.Add(plugin);
this.pluginsService.AddPlugins(
visualStudioService,
plugins,
string.Empty,
false);
}
}
string sourceDirectory = this.settingsService.InstalledDirectory + @"\Plugins\Core";
//// don't need to add reference if we are going to use nuget.
if (this.settingsService.UseNugetForServices == false)
{
foreach (string reference in codeConfig.References)
{
projectService.AddReference(
"Lib",
projectService.GetProjectPath() + @"\Lib\" + reference,
sourceDirectory + @"\" + reference,
this.settingsService.IncludeLibFolderInProjects,
this.settingsService.CopyAssembliesToLibFolder);
}
}
//// if we want to add via nuget then generate the command.
if (this.settingsService.UseNugetForServices ||
codeConfig.NugetInstallationMandatory == "Y")
{
////this.nugetService.UpdateViaNuget(projectService, codeConfig);
}
//// apply any code dependencies
IEnumerable<string> messages = this.codeConfigService.ApplyCodeDependencies(
visualStudioService,
codeConfig);
this.Messages.AddRange(messages);
}
}
示例4: AddPlugin
/// <summary>
/// Adds the plugin.
/// </summary>
/// <param name="projectService">The project service.</param>
/// <param name="plugin">The plugin.</param>
/// <param name="folderName">Name of the folder.</param>
/// <param name="extensionName">Name of the extension.</param>
/// <returns>True or false.</returns>
internal bool AddPlugin(
IProjectService projectService,
Plugin plugin,
string folderName,
string extensionName)
{
TraceService.WriteLine("PluginsService::AddPlugin " + plugin.FriendlyName);
bool added = false;
string projectPath = projectService.GetProjectPath();
string source = plugin.Source;
string destination = string.Format(@"{0}\Lib\{1}", projectPath, plugin.FileName);
//// at this moment we only want ot do the core as this plugin might not be
//// supported in the ui project.
if (extensionName == Settings.Core ||
extensionName == Settings.CoreTests)
{
//// dont need to add reference if we are going to use nuget.
if (this.SettingsService.UseNugetForPlugins == false)
{
projectService.AddReference(
"Lib",
destination,
source,
this.SettingsService.IncludeLibFolderInProjects);
}
added = true;
}
else
{
//// now if we are not the core project we need to add the platform specific assemblies
//// and the bootstrap item templates!
string extensionSource = this.GetExtensionSource(folderName, extensionName, source);
string extensionDestination = this.GetExtensionDestination(folderName, extensionName, destination);
if (this.FileSystem.File.Exists(extensionSource))
{
//// if the plugin is supported add in the core library.
added = this.AddNonCorePlugin(
projectService,
plugin.FriendlyName,
source,
destination,
extensionSource,
extensionDestination);
}
}
return added;
}