• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PropertyDictionary类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PropertyDictionary的典型用法代码示例。如果您正苦于以下问题:C# PropertyDictionary类的具体用法?C# PropertyDictionary怎么用?C# PropertyDictionary使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PropertyDictionary类属于命名空间,在下文中一共展示了PropertyDictionary类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ExpressionOptions

		internal ExpressionOptions(ExpressionContext owner)
		{
			MyOwner = owner;
			MyProperties = new PropertyDictionary();

			this.InitializeProperties();
		}
开发者ID:netgrim,项目名称:FleeSharp,代码行数:7,代码来源:ExpressionOptions.cs


示例2: ToolsetConfigurationReader

 /// <summary>
 /// Constructor taking a delegate for unit test purposes only
 /// </summary>
 internal ToolsetConfigurationReader(PropertyDictionary<ProjectPropertyInstance> environmentProperties, PropertyDictionary<ProjectPropertyInstance> globalProperties, Func<Configuration> readApplicationConfiguration)
     : base(environmentProperties, globalProperties)
 {
     ErrorUtilities.VerifyThrowArgumentNull(readApplicationConfiguration, "readApplicationConfiguration");
     _readApplicationConfiguration = readApplicationConfiguration;
     _projectImportSearchPathsCache = new Dictionary<string, Dictionary<string, List<string>>>(StringComparer.OrdinalIgnoreCase);
 }
开发者ID:nikson,项目名称:msbuild,代码行数:10,代码来源:ToolsetConfigurationReader.cs


示例3: TranslateProjectPropertyInstanceDictionary

        /// <summary>
        /// Translates a PropertyDictionary of ProjectPropertyInstances.
        /// </summary>
        /// <param name="translator">The tranlator doing the translating</param>
        /// <param name="value">The dictionary to translate.</param>
        public static void TranslateProjectPropertyInstanceDictionary(this INodePacketTranslator translator, ref PropertyDictionary<ProjectPropertyInstance> value)
        {
            if (!translator.TranslateNullable(value))
            {
                return;
            }

            if (translator.Mode == TranslationDirection.ReadFromStream)
            {
                int count = 0;
                translator.Translate(ref count);

                value = new PropertyDictionary<ProjectPropertyInstance>(count);
                for (int i = 0; i < count; i++)
                {
                    ProjectPropertyInstance instance = null;
                    translator.Translate(ref instance, ProjectPropertyInstance.FactoryForDeserialization);
                    value[instance.Name] = instance;
                }
            }
            else // TranslationDirection.WriteToStream
            {
                int count = value.Count;
                translator.Translate(ref count);

                foreach (ProjectPropertyInstance instance in value)
                {
                    ProjectPropertyInstance instanceForSerialization = instance;
                    translator.Translate(ref instanceForSerialization, ProjectPropertyInstance.FactoryForDeserialization);
                }
            }
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:37,代码来源:NodePacketTranslatorExtensions.cs


示例4: ToolsetRegistryReader

        /// <summary>
        /// Constructor overload accepting a registry wrapper for unit testing purposes only
        /// </summary>
        internal ToolsetRegistryReader(PropertyDictionary<ProjectPropertyInstance> environmentProperties, PropertyDictionary<ProjectPropertyInstance> globalProperties, RegistryKeyWrapper msbuildRegistryWrapper)
            : base(environmentProperties, globalProperties)
        {
            error.VerifyThrowArgumentNull(msbuildRegistryWrapper, "msbuildRegistryWrapper");

            _msbuildRegistryWrapper = msbuildRegistryWrapper;
        }
开发者ID:cdmihai,项目名称:msbuild,代码行数:10,代码来源:ToolsetRegistryReader.cs


示例5: ExpandAllIntoTaskItems3

        public void ExpandAllIntoTaskItems3()
        {
            ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance();
            PropertyDictionary<ProjectPropertyInstance> pg = new PropertyDictionary<ProjectPropertyInstance>();

            List<ProjectItemInstance> ig = new List<ProjectItemInstance>();
            ig.Add(new ProjectItemInstance(project, "Compile", "foo.cs", project.FullPath));
            ig.Add(new ProjectItemInstance(project, "Compile", "bar.cs", project.FullPath));

            List<ProjectItemInstance> ig2 = new List<ProjectItemInstance>();
            ig2.Add(new ProjectItemInstance(project, "Resource", "bing.resx", project.FullPath));

            ItemDictionary<ProjectItemInstance> itemsByType = new ItemDictionary<ProjectItemInstance>();
            itemsByType.ImportItems(ig);
            itemsByType.ImportItems(ig2);

            Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(pg, itemsByType);

            IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo;bar;@(compile);@(resource)", ExpanderOptions.ExpandPropertiesAndItems, MockElementLocation.Instance);

            ObjectModelHelpers.AssertItemsMatch(@"
                foo
                bar
                foo.cs
                bar.cs
                bing.resx
                ", GetTaskArrayFromItemList(itemsOut));
        }
开发者ID:akrisiun,项目名称:msbuild,代码行数:28,代码来源:Expander_Tests.cs


示例6: SubToolset

        /// <summary>
        /// Constructor that associates a set of properties with a sub-toolset version.  
        /// </summary>
        internal SubToolset(string subToolsetVersion, PropertyDictionary<ProjectPropertyInstance> properties)
        {
            ErrorUtilities.VerifyThrowArgumentLength(subToolsetVersion, "subToolsetVersion");

            _subToolsetVersion = subToolsetVersion;
            _properties = properties;
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:10,代码来源:SubToolset.cs


示例7: ValidateToolsetTranslation

        public void ValidateToolsetTranslation()
        {
            PropertyDictionary<ProjectPropertyInstance> buildProperties = new PropertyDictionary<ProjectPropertyInstance>();
            buildProperties.Set(ProjectPropertyInstance.Create("a", "a1"));

            PropertyDictionary<ProjectPropertyInstance> environmentProperties = new PropertyDictionary<ProjectPropertyInstance>();
            environmentProperties.Set(ProjectPropertyInstance.Create("b", "b1"));

            PropertyDictionary<ProjectPropertyInstance> globalProperties = new PropertyDictionary<ProjectPropertyInstance>();
            globalProperties.Set(ProjectPropertyInstance.Create("c", "c1"));

            PropertyDictionary<ProjectPropertyInstance> subToolsetProperties = new PropertyDictionary<ProjectPropertyInstance>();
            subToolsetProperties.Set(ProjectPropertyInstance.Create("d", "d1"));

            Dictionary<string, SubToolset> subToolsets = new Dictionary<string, SubToolset>(StringComparer.OrdinalIgnoreCase);
            subToolsets.Add("dogfood", new SubToolset("dogfood", subToolsetProperties));

            Toolset t = new Toolset("4.0", "c:\\bar", buildProperties, environmentProperties, globalProperties, subToolsets, "c:\\foo", "4.0");

            ((INodePacketTranslatable)t).Translate(TranslationHelpers.GetWriteTranslator());
            Toolset t2 = Toolset.FactoryForDeserialization(TranslationHelpers.GetReadTranslator());

            Assert.Equal(t.ToolsVersion, t2.ToolsVersion);
            Assert.Equal(t.ToolsPath, t2.ToolsPath);
            Assert.Equal(t.OverrideTasksPath, t2.OverrideTasksPath);
            Assert.Equal(t.Properties.Count, t2.Properties.Count);

            foreach (string key in t.Properties.Keys)
            {
                Assert.Equal(t.Properties[key].Name, t2.Properties[key].Name);
                Assert.Equal(t.Properties[key].EvaluatedValue, t2.Properties[key].EvaluatedValue);
            }

            Assert.Equal(t.SubToolsets.Count, t2.SubToolsets.Count);

            foreach (string key in t.SubToolsets.Keys)
            {
                SubToolset subToolset1 = t.SubToolsets[key];
                SubToolset subToolset2 = null;

                if (t2.SubToolsets.TryGetValue(key, out subToolset2))
                {
                    Assert.Equal(subToolset1.SubToolsetVersion, subToolset2.SubToolsetVersion);
                    Assert.Equal(subToolset1.Properties.Count, subToolset2.Properties.Count);

                    foreach (string subToolsetPropertyKey in subToolset1.Properties.Keys)
                    {
                        Assert.Equal(subToolset1.Properties[subToolsetPropertyKey].Name, subToolset2.Properties[subToolsetPropertyKey].Name);
                        Assert.Equal(subToolset1.Properties[subToolsetPropertyKey].EvaluatedValue, subToolset2.Properties[subToolsetPropertyKey].EvaluatedValue);
                    }
                }
                else
                {
                    Assert.True(false, string.Format("Sub-toolset {0} was lost in translation.", key));
                }
            }

            Assert.Equal(t.DefaultOverrideToolsVersion, t2.DefaultOverrideToolsVersion);
        }
开发者ID:cameron314,项目名称:msbuild,代码行数:59,代码来源:Toolset_Tests.cs


示例8: ExpressionParserOptions

		internal ExpressionParserOptions(ExpressionContext owner)
		{
			MyOwner = owner;
			MyProperties = new PropertyDictionary();
			MyParseCulture = CultureInfo.InvariantCulture;

			this.InitializeProperties();
		}
开发者ID:netgrim,项目名称:FleeSharp,代码行数:8,代码来源:ExpressionParserOptions.cs


示例9: ExpandAllIntoTaskItems1

        public void ExpandAllIntoTaskItems1()
        {
            PropertyDictionary<ProjectPropertyInstance> pg = new PropertyDictionary<ProjectPropertyInstance>();
            Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(pg);

            IList<TaskItem> itemsOut = expander.ExpandIntoTaskItemsLeaveEscaped("foo", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);

            ObjectModelHelpers.AssertItemsMatch(@"foo", GetTaskArrayFromItemList(itemsOut));
        }
开发者ID:akrisiun,项目名称:msbuild,代码行数:9,代码来源:Expander_Tests.cs


示例10: PropertyDefinition

    public PropertyDefinition(String systemName, String humanName, Type type, PropertyDictionary owner)
    {
      SystemName = systemName;
      HumanName = humanName;
      ValueType = type;
      Owner = owner;

      Rules = new List<Rule>();

    }
开发者ID:TLevitt,项目名称:DryLogic,代码行数:10,代码来源:PropertyDefinition.cs


示例11: ElementNode

        public ElementNode(ElementNode parent, int openAngleBracketPosition, NameToken nameToken, int maxEnd) {
            Parent = parent;

            if (nameToken.HasColon)
                StartTag = new TagNodeWithPrefix(this, openAngleBracketPosition, nameToken, maxEnd);
            else
                StartTag = new TagNode(this, openAngleBracketPosition, nameToken, maxEnd);

            VirtualEnd = maxEnd;
            Properties = new PropertyDictionary();
        }
开发者ID:Microsoft,项目名称:RTVS,代码行数:11,代码来源:ElementNode.cs


示例12: PropertyGroupEmpty

        public void PropertyGroupEmpty()
        {
            string content = ObjectModelHelpers.CleanupFileContents(@"
            <Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'>
            <Target Name='t' >
                <PropertyGroup/>
            </Target>
            </Project>");
            IntrinsicTask task = CreateIntrinsicTask(content);
            PropertyDictionary<ProjectPropertyInstance> properties = new PropertyDictionary<ProjectPropertyInstance>();
            ExecuteTask(task, LookupHelpers.CreateLookup(properties));

            Assert.AreEqual(0, properties.Count);
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:14,代码来源:IntrinsicTask_Tests.cs


示例13: AppendSwitchUnquotedIfNotNull

 /// <summary>
 /// Set a boolean switch only if its value exists.
 /// </summary>
 internal void AppendPlusOrMinusSwitch
     (
     string switchName,
     PropertyDictionary bag,
     string parameterName
     )
 {
     object obj = bag[parameterName];
     // If the switch isn't set, don't add it to the command line.
     if (obj != null)
     {
         bool value = (bool)obj;
         // Do not quote - or + as they are part of the switch
         AppendSwitchUnquotedIfNotNull(switchName, (value ? "+" : "-"));
     }
 }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:19,代码来源:CommandLineBuilderExtension.cs


示例14: PropertyGroupWithComments

        public void PropertyGroupWithComments()
        {
            string content = ObjectModelHelpers.CleanupFileContents(@"
            <Project ToolsVersion='msbuilddefaulttoolsversion' xmlns='msbuildnamespace'>
            <Target Name='t' >
                <PropertyGroup><!-- c -->
                    <p1>v1</p1><!-- c -->
                </PropertyGroup>
            </Target>
            </Project>");
            IntrinsicTask task = CreateIntrinsicTask(content);
            PropertyDictionary<ProjectPropertyInstance> properties = new PropertyDictionary<ProjectPropertyInstance>();
            ExecuteTask(task, LookupHelpers.CreateLookup(properties));

            Assert.AreEqual(1, properties.Count);
            Assert.AreEqual("v1", properties["p1"].EvaluatedValue);
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:17,代码来源:IntrinsicTask_Tests.cs


示例15: AppendSwitch

        /// <summary>
        /// Set a boolean switch iff its value exists and its value is 'true'.
        /// </summary>
        internal void AppendWhenTrue
            (
            string switchName,
            PropertyDictionary bag,
            string parameterName
            )
        {
            object obj = bag[parameterName];
            // If the switch isn't set, don't add it to the command line.
            if (obj != null)
            {
                bool value = (bool)obj;

                if (value)
                {
                    AppendSwitch(switchName);
                }
            }
        }
开发者ID:ehsansajjad465,项目名称:roslyn,代码行数:22,代码来源:CommandLineBuilderExtension.cs


示例16: MatchProperty

        public void MatchProperty()
        {
            PropertyDictionary<ProjectPropertyInstance> dictionary = new PropertyDictionary<ProjectPropertyInstance>();

            ProjectPropertyInstance p = ProjectPropertyInstance.Create("foo", "bar");

            dictionary.Set(p);

            string s = "$(foo)";
            ProjectPropertyInstance value = MSBuildNameIgnoreCaseComparer.Mutable.GetValueWithConstraints<ProjectPropertyInstance>(dictionary, s, 2, 4);

            Assert.IsTrue(Object.ReferenceEquals(p, value), "Should have returned the same object as was inserted");

            try
            {
                MSBuildNameIgnoreCaseComparer.Mutable.SetConstraintsForUnitTestingOnly(s, 2, 4);
                Assert.AreEqual(MSBuildNameIgnoreCaseComparer.Default.GetHashCode("foo"), MSBuildNameIgnoreCaseComparer.Mutable.GetHashCode(s));
            }
            finally
            {
                MSBuildNameIgnoreCaseComparer.Mutable.RemoveConstraintsForUnitTestingOnly();
            }
        }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:23,代码来源:MSBuildNameIgnoreCaseComparer_Tests.cs


示例17: NotImplementedException

 /// <summary>
 /// Empty impl
 /// </summary>
 Task<BuildResult[]> IRequestBuilderCallback.BuildProjects(string[] projectFiles, PropertyDictionary<ProjectPropertyInstance>[] properties, string[] toolsVersions, string[] targets, bool waitForResults)
 {
     throw new NotImplementedException();
 }
开发者ID:JamesLinus,项目名称:msbuild,代码行数:7,代码来源:TaskBuilder_Tests.cs


示例18: CreateExpander

        /// <summary>
        /// Creates an expander populated with some ProjectPropertyInstances and ProjectPropertyItems.
        /// </summary>
        /// <returns></returns>
        private Expander<ProjectPropertyInstance, ProjectItemInstance> CreateExpander()
        {
            ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance();
            PropertyDictionary<ProjectPropertyInstance> pg = new PropertyDictionary<ProjectPropertyInstance>();
            pg.Set(ProjectPropertyInstance.Create("p", "v0"));
            pg.Set(ProjectPropertyInstance.Create("p", "v1"));

            ItemDictionary<ProjectItemInstance> ig = new ItemDictionary<ProjectItemInstance>();
            ProjectItemInstance i0 = new ProjectItemInstance(project, "i", "i0", project.FullPath);
            ProjectItemInstance i1 = new ProjectItemInstance(project, "i", "i1", project.FullPath);
            ig.Add(i0);
            ig.Add(i1);

            Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(pg, ig);

            return expander;
        }
开发者ID:akrisiun,项目名称:msbuild,代码行数:21,代码来源:Expander_Tests.cs


示例19: CreateItemFunctionExpander

        /// <summary>
        /// Creates an expander populated with some ProjectPropertyInstances and ProjectPropertyItems.
        /// </summary>
        /// <returns></returns>
        private Expander<ProjectPropertyInstance, ProjectItemInstance> CreateItemFunctionExpander()
        {
            ProjectInstance project = ProjectHelpers.CreateEmptyProjectInstance();
            PropertyDictionary<ProjectPropertyInstance> pg = new PropertyDictionary<ProjectPropertyInstance>();
            pg.Set(ProjectPropertyInstance.Create("p", "v0"));
            pg.Set(ProjectPropertyInstance.Create("p", "v1"));
            pg.Set(ProjectPropertyInstance.Create("Val", "2"));
            pg.Set(ProjectPropertyInstance.Create("a", "filename"));

            ItemDictionary<ProjectItemInstance> ig = new ItemDictionary<ProjectItemInstance>();

            for (int n = 0; n < 10; n++)
            {
                ProjectItemInstance pi = new ProjectItemInstance(project, "i", "i" + n.ToString(), project.FullPath);
                for (int m = 0; m < 5; m++)
                {
                    pi.SetMetadata("Meta" + m.ToString(), @"c:\firstdirectory\seconddirectory\file" + m.ToString() + ".ext");
                }
                pi.SetMetadata("Meta9", @"seconddirectory\file.ext");
                pi.SetMetadata("Meta10", @";someo%3bherplace\foo.txt;secondd%3brectory\file.ext;");
                pi.SetMetadata("MetaBlank", @"");

                if (n % 2 > 0)
                {
                    pi.SetMetadata("Even", "true");
                    pi.SetMetadata("Odd", "false");
                }
                else
                {
                    pi.SetMetadata("Even", "false");
                    pi.SetMetadata("Odd", "true");
                }
                ig.Add(pi);
            }

            Dictionary<string, string> itemMetadataTable = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
            itemMetadataTable["Culture"] = "abc%253bdef;$(Gee_Aych_Ayee)";
            itemMetadataTable["Language"] = "english";
            IMetadataTable itemMetadata = new StringMetadataTable(itemMetadataTable);

            Expander<ProjectPropertyInstance, ProjectItemInstance> expander = new Expander<ProjectPropertyInstance, ProjectItemInstance>(pg, ig, itemMetadata);

            return expander;
        }
开发者ID:akrisiun,项目名称:msbuild,代码行数:48,代码来源:Expander_Tests.cs


示例20: PkgConfigFunctions

 /// <summary>
 /// Initializes a new instance of the <see cref="PkgConfigFunctions"/> class.
 /// </summary>
 /// <param name="project">The current project.</param>
 /// <param name="properties">The projects properties.</param>
 public PkgConfigFunctions(Project project, PropertyDictionary properties) : base(project, properties) {
 }
开发者ID:RoastBoy,项目名称:nant,代码行数:7,代码来源:PkgConfigFunctions.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PropertyEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# PropertyDescriptor类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap