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


C# Microsoft.GetPropertyValue方法代码示例

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


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

示例1: Find

 public int Find(Microsoft.Build.Evaluation.Project prj)
 {
     int iCount = Items.Count;
     int i = 0;
     string sGUID = prj.GetPropertyValue("ProjectGuid");
     for (i=0;i<iCount;i++)
     {
         string GuidOfItem = Items[i].Project.GetPropertyValue("ProjectGuid");
         if (sGUID.Equals(GuidOfItem))
         {
             return i;
         }
     }
     return -1;
 }
开发者ID:dstrucl,项目名称:Tangenta40,代码行数:15,代码来源:ProjectReferencesList.cs

示例2: GetBoolProperty

		static bool? GetBoolProperty(Microsoft.Build.Evaluation.Project p, string propertyName)
		{
			string val = p.GetPropertyValue(propertyName);
			if (val.Equals("true", StringComparison.OrdinalIgnoreCase))
				return true;
			if (val.Equals("false", StringComparison.OrdinalIgnoreCase))
				return false;
			return null;
		}
开发者ID:mono-soc-2012,项目名称:NRefactory,代码行数:9,代码来源:CSharpProject.cs

示例3: SetCompilerSettings

        void SetCompilerSettings(Microsoft.Build.Evaluation.Project p)
        {
            CompilerSettings = new CompilerSettings
            {
                AllowUnsafeBlocks = GetBoolProperty(p, "AllowUnsafeBlocks") ?? false,
                CheckForOverflow = GetBoolProperty(p, "CheckForOverflowUnderflow") ?? false
            };
            string[] defines = p.GetPropertyValue("DefineConstants")
                .Split(new [] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string define in defines)
                CompilerSettings.ConditionalSymbols.Add(define);

            var config = ConfigurationLoader.Config;
            foreach (var define in config.Defines)
                CompilerSettings.ConditionalSymbols.Add(define);
        }
开发者ID:gtarcoder,项目名称:vim_config1,代码行数:16,代码来源:CSharpProject.cs

示例4: GetCommandsDisplayLabel

        public static string GetCommandsDisplayLabel(
            Microsoft.Build.Evaluation.Project project,
            IPythonProject2 projectNode
        ) {
            var label = project.GetPropertyValue("PythonCommandsDisplayLabel") ?? string.Empty;
            
            var match = _customCommandLabelRegex.Match(label);
            if (match.Success) {
                label = LoadResourceFromAssembly(
                    match.Groups["assembly"].Value,
                    match.Groups["namespace"].Value,
                    match.Groups["key"].Value
                );
            }

            if (string.IsNullOrEmpty(label)) {
                return Strings.PythonMenuLabel;
            }

            return PerformSubstitutions(projectNode, label);
        }
开发者ID:smallwave,项目名称:PTVS,代码行数:21,代码来源:CustomCommand.cs

示例5: GetCommands

        public static IEnumerable<CustomCommand> GetCommands(
            Microsoft.Build.Evaluation.Project project,
            PythonProjectNode projectNode
        ) {
            var commandNames = project.GetPropertyValue(PythonCommands);
            if (!string.IsNullOrEmpty(commandNames)) {
                foreach (var name in commandNames.Split(';').Where(n => !string.IsNullOrEmpty(n)).Distinct()) {
                    ProjectTargetInstance targetInstance;
                    if (!project.Targets.TryGetValue(name, out targetInstance)) {
                        continue;
                    }

                    var targetXml = (targetInstance.Location.File == project.FullPath) ?
                        project.Xml :
                        // TryOpen will only return targets that were already
                        // loaded in the current collection; otherwise, null.
                        ProjectRootElement.TryOpen(targetInstance.Location.File, project.ProjectCollection);

                    if (targetXml == null) {
                        continue;
                    }

                    var target = targetXml.Targets.FirstOrDefault(t => name.Equals(t.Name, StringComparison.OrdinalIgnoreCase));
                    if (target != null) {
                        yield return new CustomCommand(projectNode, target.Name, target.Label);
                    }
                }
            }
        }
开发者ID:smallwave,项目名称:PTVS,代码行数:29,代码来源:CustomCommand.cs

示例6: GetBoolProperty

 static bool? GetBoolProperty(Microsoft.Build.Evaluation.Project p, string propertyName)
 {
     string val = p.GetPropertyValue(propertyName);
     bool result;
     if (bool.TryParse(val, out result))
         return result;
     else
         return null;
 }
开发者ID:artifexor,项目名称:NRefactory,代码行数:9,代码来源:CSharpProject.cs

示例7: GetEvaluatedProperty

 public static String GetEvaluatedProperty(Microsoft.Build.Evaluation.Project project, String name)
 {
     return project.GetPropertyValue(name);
 }
开发者ID:alux-xu,项目名称:ice-builder-visualstudio,代码行数:4,代码来源:MSBuildUtils.cs


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