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


C# Project.GetRootFolder方法代码示例

本文整理汇总了C#中Project.GetRootFolder方法的典型用法代码示例。如果您正苦于以下问题:C# Project.GetRootFolder方法的具体用法?C# Project.GetRootFolder怎么用?C# Project.GetRootFolder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Project的用法示例。


在下文中一共展示了Project.GetRootFolder方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InstallPackage

        public override async Task<bool> InstallPackage(Project project, string packageName, string version)
        {
            if (!string.IsNullOrEmpty(version))
                packageName += $"@{version}";

            string arg = $"/c jspm install {packageName}";
            string cwd = project.GetRootFolder();
            string json = Path.Combine(cwd, "package.json");

            if (!File.Exists(json))
            {
                string content = "{\"name\":\"myproject\", \"version\":\"1.0.0\"}";
                File.WriteAllText(json, content, new UTF8Encoding(false));
                project.ProjectItems.AddFromFile(json);
            }

            if (IsJspmConfigured(json))
            {
                return await CallCommand(arg, cwd);
            }
            else
            {
                return await ShowConsole(arg, cwd);
            }
        }
开发者ID:modulexcite,项目名称:PackageInstaller,代码行数:25,代码来源:Jspm.cs

示例2: InstallPackage

        public override async Task<bool> InstallPackage(Project project, string packageName, string version, string args = null)
        {
            string installArgs = GetInstallArguments(packageName, version);

            string arg = $"/c {installArgs} {args}";
            string cwd = project.GetRootFolder();

            return await CallCommandAsync(arg, cwd);
        }
开发者ID:madskristensen,项目名称:PackageInstaller,代码行数:9,代码来源:Typings.cs

示例3: InstallPackage

        public override async Task<bool> InstallPackage(Project project, string packageName, string version)
        {
            if (!string.IsNullOrEmpty(version))
                packageName += $"#{version}";

            string arg = $"/c bower install {packageName} --save --no-color";
            string cwd = project.GetRootFolder();
            string json = Path.Combine(cwd, "bower.json");

            if (!File.Exists(json))
            {
                string content = "{\"name\":\"myproject\"}";
                File.WriteAllText(json, content, new UTF8Encoding(false));
                project.ProjectItems.AddFromFile(json);
            }

            return await CallCommand(arg, cwd);
        }
开发者ID:modulexcite,项目名称:PackageInstaller,代码行数:18,代码来源:Bower.cs

示例4: ReloadExtension

        public ReloadExtension(Project project)
        {
            _project = project;
            string folder = project.GetRootFolder();

            if (string.IsNullOrEmpty(folder))
                return;

            _watcher = new FileSystemWatcher(folder);
            _watcher.Changed += FileChanged;
            _watcher.IncludeSubdirectories = true;
            _watcher.NotifyFilter = NotifyFilters.Size | NotifyFilters.CreationTime;
            _watcher.EnableRaisingEvents = VSPackage.Options.EnableReload;

            _timer = new Timer(TimerElapsed, null, 0, VSPackage.Options.Delay);

            VSPackage.Options.Saved += OptionsSaved;
        }
开发者ID:madskristensen,项目名称:BrowserReloadOnSave,代码行数:18,代码来源:ReloadExtension.cs

示例5: InstallPackage

        public override void InstallPackage(Project project, string packageName, string version)
        {
            if (!string.IsNullOrEmpty(version))
                packageName += $"@{version}";

            string arg = $"/c npm install {packageName} --save";
            string cwd = project.GetRootFolder();
            string json = Path.Combine(cwd, "package.json");

            if (!File.Exists(json))
            {
                string content = "{\"name\":\"myproject\", \"version\":\"1.0.0\"}";
                File.WriteAllText(json, content, new UTF8Encoding(false));
                project.ProjectItems.AddFromFile(json);
            }

            AddAdditionalFiles(project, cwd, packageName);
            CallCommand(arg, cwd);
        }
开发者ID:yannduran,项目名称:PackageInstaller,代码行数:19,代码来源:Npm.cs

示例6: InstallPackage

        public override async Task<bool> InstallPackage(Project project, string packageName, string version, string args = null)
        {
            string installArgs = GetInstallArguments(packageName, version);

            string arg = $"/c {installArgs} --no-color {args}";
            string cwd = project.GetRootFolder();
            string json = Path.Combine(cwd, "bower.json");

            if (!File.Exists(json))
            {
                string content = "{\"name\":\"myproject\"}";
                File.WriteAllText(json, content, new UTF8Encoding(false));
                project.ProjectItems.AddFromFile(json);
            }

            return await CallCommandAsync(arg, cwd);
        }
开发者ID:madskristensen,项目名称:PackageInstaller,代码行数:17,代码来源:Bower.cs


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