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


C# ApplicationData.UpdateFrom方法代码示例

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


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

示例1: UnknownRepeater

            public void UnknownRepeater()
            {
                ApplicationData target = new ApplicationData();

                Dictionary<string, object>[] repeater = new Dictionary<string, object>[2];
                repeater[0] = new Dictionary<string, object>();
                repeater[1] = new Dictionary<string, object>();
                target["repeater1"] = repeater;

                repeater[0]["field1"] = "leave me alone!";
                repeater[0]["field2"] = "leave me alone too!";
                repeater[1]["field1"] = "leave me alone!";
                repeater[1]["field2"] = "i'm incorrect anyway - update me!";

                ApplicationData source = new ApplicationData();
                Dictionary<string, object>[] sourceRepeater = new Dictionary<string, object>[2];
                sourceRepeater[0] = new Dictionary<string, object>();
                sourceRepeater[1] = new Dictionary<string, object>();
                source["repeater1"] = sourceRepeater;

                sourceRepeater[1]["field2"] = "you've been overwritten!";
                sourceRepeater[1]["field3"] = "I am the unknown control!";

                target.UpdateFrom(source);
                Assert.IsNull(target.GetValue<string>("repeater1[1].field3"));
            }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:26,代码来源:ApplicationDataTests.cs

示例2: 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

示例3: Retain

            public void Retain()
            {
                ApplicationData target = new ApplicationData();
                target["field1"] = "leave me alone!";
                ApplicationData source = new ApplicationData();
                source["field2"] = "you've been overwritten!";

                target.UpdateFrom(source);
                Assert.AreEqual("leave me alone!", target["field1"]);
            }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:10,代码来源:ApplicationDataTests.cs

示例4: RetainRepeater

            public void RetainRepeater()
            {
                ApplicationData target = new ApplicationData();

                Dictionary<string, object>[] repeater = new Dictionary<string, object>[2];
                repeater[0] = new Dictionary<string, object>();
                repeater[1] = new Dictionary<string, object>();
                target["repeater1"] = repeater;

                repeater[0]["field1"] = "leave me alone!";
                repeater[0]["field2"] = "leave me alone too!";
                repeater[1]["field1"] = "leave me alone!";
                repeater[1]["field2"] = "i'm incorrect anyway - update me!";

                ApplicationData source = new ApplicationData();
                Dictionary<string, object>[] sourceRepeater = new Dictionary<string, object>[2];
                sourceRepeater[0] = new Dictionary<string, object>();
                sourceRepeater[1] = new Dictionary<string, object>();
                source["repeater1"] = sourceRepeater;

                sourceRepeater[1]["field2"] = "you've been overwritten!";

                target.UpdateFrom(source);
                Assert.AreEqual("leave me alone too!", target.GetValue<string>("repeater1[0].field2"));
            }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:25,代码来源:ApplicationDataTests.cs

示例5: Overwrite

            public void Overwrite()
            {
                ApplicationData target = new ApplicationData();
                target["field1"] = "leave me alone!";
                target["field2"] = "i'm incorrect anyway - update me!";
                ApplicationData source = new ApplicationData();
                source["field2"] = "you've been overwritten!";

                target.UpdateFrom(source);
                Assert.AreEqual("you've been overwritten!", target["field2"]);
            }
开发者ID:cgavieta,项目名称:WORKPAC2016-poc,代码行数:11,代码来源:ApplicationDataTests.cs


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