当前位置: 首页>>代码示例>>C#>>正文


C# IProjectService.GetProjectPath方法代码示例

本文整理汇总了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;
        }
开发者ID:CliffCawley,项目名称:NinjaCoderForMvvmCross,代码行数:67,代码来源:PluginService.cs

示例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);
            }
        }
开发者ID:rmarinho,项目名称:NinjaCoderForMvvmCross,代码行数:49,代码来源:ServicesService.cs

示例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);
            }
        }
开发者ID:CliffCawley,项目名称:NinjaCoderForMvvmCross,代码行数:77,代码来源:ServicesService.cs

示例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;
        }
开发者ID:nanohex,项目名称:NinjaCoderForMvvmCross,代码行数:64,代码来源:PluginsService.cs


注:本文中的IProjectService.GetProjectPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。