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


C# ApplicationData.ContainsKey方法代码示例

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


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

示例1: SaveNonExistantField

        public void SaveNonExistantField()
        {
            const string formId = "10";
            const string userId = "007";
            ControlList controls = this.GetControlList(formId);
            List<ControlAccess> controlsAccess = this.GetControlAccess(formId, userId);

            ApplicationData input = new ApplicationData();
            input["bad-field"] = "my legal value";

            ApplicationDataVerifier verifier = new ApplicationDataVerifier(controls, controlsAccess);
            ApplicationData output = verifier.VerifyApplicationData(input, null);

            Assert.IsTrue(input.ContainsKey("bad-field"));
            Assert.IsNotNull(input.GetValue<string>("bad-field"));

            Assert.IsFalse(output.ContainsKey("bad-field"));
        }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:18,代码来源:ApplicationDataVerifierTests.cs

示例2: SaveNonExistantRepeaterData

        public void SaveNonExistantRepeaterData()
        {
            const string formId = "11";
            const string userId = "007";
            ControlList controls = this.GetControlList(formId);
            List<ControlAccess> controlsAccess = this.GetControlAccess(formId, userId);

            ApplicationData input = new ApplicationData();
            input["bad-repeater"] = new object[0];

            ApplicationData previousAppData = new ApplicationData();
            previousAppData["bad-repeater"] = new object[0];

            ApplicationDataVerifier verifier = new ApplicationDataVerifier(controls, controlsAccess);
            ApplicationData output = verifier.VerifyApplicationData(input, previousAppData);

            Assert.IsTrue(input.ContainsKey("bad-repeater"));
            Assert.IsFalse(output.ContainsKey("bad-repeater"));
        }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:19,代码来源:ApplicationDataVerifierTests.cs

示例3: Unknown

            public void Unknown()
            {
                ApplicationData target = new ApplicationData();
                target["field1"] = "leave me alone!";
                ApplicationData source = new ApplicationData();
                source["field2"] = "you've been overwritten!";
                source["field3"] = "I am the unknown control!";

                target.UpdateFrom(source);
                Assert.IsFalse(target.ContainsKey("field3"));
            }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:11,代码来源:ApplicationDataTests.cs

示例4: SaveNonExistantRepeaterChild

        public void SaveNonExistantRepeaterChild()
        {
            const string formId = "11";
            const string userId = "007";
            ControlList controls = this.GetControlList(formId);
            List<ControlAccess> controlsAccess = this.GetControlAccess(formId, userId);

            ApplicationData input = new ApplicationData();
            Dictionary<string, object>[] repeater = new Dictionary<string, object>[1];
            input["write-repeater"] = repeater;
            repeater[0] = new Dictionary<string, object>();
            repeater[0]["bad-field"] = "this field is writeable!";

            ApplicationDataVerifier verifier = new ApplicationDataVerifier(controls, controlsAccess);
            ApplicationData output = verifier.VerifyApplicationData(input, null);

            Assert.IsTrue(input.ContainsKey("write-repeater"));
            Assert.IsNotNull(input.GetValue<string>("write-repeater[0].bad-field"));

            Assert.IsTrue(output.ContainsKey("write-repeater"));
            Assert.IsNull(output.GetValue<string>("write-repeater[0].bad-field"));
        }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:22,代码来源:ApplicationDataVerifierTests.cs

示例5: ControlWithNoDefaultValueIsNotAdded

 public void ControlWithNoDefaultValueIsNotAdded()
 {
     ApplicationData applicationData = new ApplicationData();
     this.initialiser.Initialise(applicationData);
     Assert.IsFalse(applicationData.ContainsKey("ControlWithNoDefaultValue"));
 }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:6,代码来源:ApplicationDataInitialiserTests.cs


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