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


C# Project.IsSupported方法代码示例

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


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

示例1: Get

        public static ProjectSettings Get(Project project)
        {
            if (!project.IsSupported())
                return null;

            string key = project.GetIdentifier();
            return settings.ValueOrNull(key);
        }
开发者ID:ivan-korshun,项目名称:VS-PublishExtensions2013,代码行数:8,代码来源:SettingsStore.cs

示例2: Create

        public static ProjectSettings Create(Project project)
        {
            if (!project.IsSupported())
                return null;

            string key = project.GetIdentifier();
            if (!settings.ContainsKey(key))
            {
                string fullPath = project.GetSettingsFilePath();
                ProjectSettings projectSettings = ProjectSettings.Load(fullPath);
                settings.Add(key, projectSettings);
            }
            return settings[key];
        }
开发者ID:ivan-korshun,项目名称:VS-PublishExtensions2013,代码行数:14,代码来源:SettingsStore.cs

示例3: AddProjectToCache

        private void AddProjectToCache(Project project)
        {
            if (!project.IsSupported())
            {
                return;
            }
            ProjectName oldProjectName;
            _projectCache.TryGetProjectNameByShortName(project.Name, out oldProjectName);

            ProjectName newProjectName = _projectCache.AddProject(project);

            if (String.IsNullOrEmpty(DefaultProjectName) ||
                newProjectName.ShortName.Equals(DefaultProjectName, StringComparison.OrdinalIgnoreCase))
            {
                DefaultProjectName = oldProjectName != null ?
                                     oldProjectName.CustomUniqueName :
                                     newProjectName.ShortName;
            }
        }
开发者ID:nickfloyd,项目名称:NuGet,代码行数:19,代码来源:SolutionManager.cs

示例4: OnProjectAdded

        private void OnProjectAdded(Project project)
        {
            if (project.IsSupported() && !project.IsParentProjectExplicitlyUnsupported())
            {
                EnsureProjectCache();
                AddProjectToCache(project);

                if (ProjectAdded != null)
                {
                    ProjectAdded(this, new ProjectEventArgs(project));
                }
            }
        }
开发者ID:nickfloyd,项目名称:NuGet,代码行数:13,代码来源:SolutionManager.cs

示例5: OnProjectRenamed

        private void OnProjectRenamed(Project project, string oldName)
        {
            if (!String.IsNullOrEmpty(oldName))
            {
                EnsureProjectCache();

                if (project.IsSupported())
                {
                    RemoveProjectFromCache(oldName);
                    AddProjectToCache(project);
                }
                else if (project.IsSolutionFolder())
                {
                    // In the case where a solution directory was changed, project FullNames are unchanged. 
                    // We only need to invalidate the projects under the current tree so as to sync the CustomUniqueNames.
                    foreach (var item in project.GetSupportedChildProjects())
                    {
                        RemoveProjectFromCache(item.FullName);
                        AddProjectToCache(item);
                    }
                }
            }
        }
开发者ID:nickfloyd,项目名称:NuGet,代码行数:23,代码来源:SolutionManager.cs

示例6: UpdateCache

        private static void UpdateCache(Project project)
        {
            if (!project.IsSupported())
                return;

            // check if the settings file exists
            string filePath = project.GetSettingsFilePath();
            try
            {
                if (File.Exists(filePath))
                {
                    string projectId = project.GetIdentifier();
                    ProjectSettings projectSettings = ProjectSettings.Load(filePath);
                    settings.Remove(projectId);
                    settings.Add(projectId, projectSettings);

                    Logger.Log(" -> Settings file loaded for project '{0}'", project.Name);
                }
                else
                {
                    Logger.Debug(" -> Project '{0}': No settings file exists for publishing", project.Name);
                }
            }
            catch (XmlSerializationException ex)
            {
                Logger.Log(Logger.Divider);
                Logger.Log(ex, "Error in publish settings file '{0}'", Path.Combine(SettingsStore.SettingsFolder, SettingsStore.SettingsFileName));
                Logger.Log(Logger.Divider);

                MessageBox.Show(
                    "The publish settings file contains errors, please correct the errors manually and save the file." +
                    Environment.NewLine + Environment.NewLine +
                    "See the output window for more information.",
                    "Invalid Settings File",
                    MessageBoxButton.OK,
                    MessageBoxImage.Error);
            }
            catch (Exception ex)
            {
                Logger.Debug(ex, "Error in publish settings file '{0}'", Path.Combine(SettingsStore.SettingsFolder, SettingsStore.SettingsFileName));
            }
        }
开发者ID:ivan-korshun,项目名称:VS-PublishExtensions2013,代码行数:42,代码来源:SettingsStore.cs

示例7: OnProjectAdded

 private void OnProjectAdded(Project project)
 {
     if (project.IsSupported()) {
         EnsureProjectCache();
         AddProjectToCache(project);
     }
 }
开发者ID:grendello,项目名称:nuget,代码行数:7,代码来源:SolutionManager.cs


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