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


C# ComplexContainersItem.GetContentType方法代码示例

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


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

示例1: CanUpdateEditors

        public void CanUpdateEditors()
        {
            ComplexContainersItem item = new ComplexContainersItem();
            IDictionary<string, Control> added = AddEditors(item);

            TextBox tbp0 = added["MyProperty0"] as TextBox;
            TextBox tbp1 = added["MyProperty1"] as TextBox;
            TextBox tbp2 = added["MyProperty2"] as TextBox;
            FreeTextArea ftap3 = added["MyProperty3"] as FreeTextArea;
            CheckBox cbp4 = added["MyProperty4"] as CheckBox;

            Assert.IsEmpty(tbp0.Text);
            Assert.IsEmpty(tbp1.Text);
            Assert.IsEmpty(tbp2.Text);
            Assert.IsEmpty(ftap3.Text);
            Assert.IsFalse(cbp4.Checked);

            item.MyProperty0 = "one";
            item.MyProperty1 = "two";
            item.MyProperty2 = "three";
            item.MyProperty3 = "rock";
            item.MyProperty4 = true;

			editManager.UpdateEditors(definitions.GetDefinition(item.GetContentType()), item, added, CreatePrincipal("someone"));

            Assert.AreEqual("one", tbp0.Text);
            Assert.AreEqual("two", tbp1.Text);
            Assert.AreEqual("three", tbp2.Text);
            Assert.AreEqual("rock", ftap3.Text);
            Assert.IsTrue(cbp4.Checked);
        }
开发者ID:rohancragg,项目名称:n2cms,代码行数:31,代码来源:WhileEditingContentData.cs

示例2: AddEditors

 protected IDictionary<string, Control> AddEditors(ComplexContainersItem item)
 {
     Type itemType = item.GetContentType();
     Control editorContainer = new Control();
     IDictionary<string, Control> added = editManager.AddEditors(definitions.GetDefinition(itemType), item, editorContainer, CreatePrincipal("someone"));
     return added;
 }
开发者ID:JohnsonYuan,项目名称:n2cms,代码行数:7,代码来源:EditManagerTests.cs

示例3: UpdateItem_WithNoChanges_ReturnsFalse

        public void UpdateItem_WithNoChanges_ReturnsFalse()
        {
            ComplexContainersItem item = new ComplexContainersItem();
            Type itemType = item.GetContentType();
            Control editorContainer = new Control();
            IDictionary<string, Control> added = editManager.AddEditors(definitions.GetDefinition(itemType), item, editorContainer, CreatePrincipal("someone"));

            item.MyProperty0 = "one";
            item.MyProperty1 = "two";
            item.MyProperty2 = "three";
            item.MyProperty3 = "rock";
            item.MyProperty4 = true;
            editManager.UpdateEditors(definitions.GetDefinition(item.GetContentType()), item, added, CreatePrincipal("someone"));

            var result = editManager.UpdateItem(definitions.GetDefinition(item.GetContentType()), item, added, null);

            Assert.IsFalse(result.Length > 0, "UpdateItem didn't return false even though the editors were unchanged.");
        }
开发者ID:joshuaanderson,项目名称:n2cms,代码行数:18,代码来源:WhileEditingContentData.cs

示例4: UpdateItem_WithChanges_ReturnsTrue

        public void UpdateItem_WithChanges_ReturnsTrue()
        {
            ComplexContainersItem item = new ComplexContainersItem();
            IDictionary<string, Control> added = AddEditors(item);

            TextBox tbp0 = added["MyProperty0"] as TextBox;
            TextBox tbp1 = added["MyProperty1"] as TextBox;
            TextBox tbp2 = added["MyProperty2"] as TextBox;
            FreeTextArea ftap3 = added["MyProperty3"] as FreeTextArea;
            CheckBox cbp4 = added["MyProperty4"] as CheckBox;

            tbp0.Text = "one";
            tbp1.Text = "two";
            tbp2.Text = "three";
            ftap3.Text = "rock";
            cbp4.Checked = true;

            var result = editManager.UpdateItem(definitions.GetDefinition(item.GetContentType()), item, added, CreatePrincipal("someone"));

            Assert.That(result.Length, Is.GreaterThan(0), "UpdateItem didn't return true even though the editors were changed.");
        }
开发者ID:joshuaanderson,项目名称:n2cms,代码行数:21,代码来源:WhileEditingContentData.cs

示例5: CanUpdateItem

		public void CanUpdateItem()
		{
			ComplexContainersItem item = new ComplexContainersItem();
			IDictionary<string, Control> added = AddEditors(item);

			var tbp0 = added["MyProperty0"] as TextBox;
			var tbp1 = added["MyProperty1"] as TextBox;
			var tbp2 = added["MyProperty2"] as TextBox;
			var ftap3 = added["MyProperty3"] as FreeTextArea;
			var cbp4 = added["MyProperty4"] as CheckBox;

			Assert.That(tbp0 != null);
			Assert.That(tbp1 != null);
			Assert.That(tbp2 != null);
			Assert.That(ftap3 != null);
			Assert.That(cbp4 != null);

			Assert.IsEmpty(item.MyProperty0);
			Assert.IsEmpty(item.MyProperty1);
			Assert.IsEmpty(item.MyProperty2);
			Assert.IsEmpty(item.MyProperty3);
			Assert.IsFalse(item.MyProperty4);

			tbp0.Text = "one";
			tbp1.Text = "two";
			tbp2.Text = "three";
			ftap3.Text = "rock";
			cbp4.Checked = true;

			editManager.UpdateItem(definitions.GetDefinition(item.GetContentType()), item, added, CreatePrincipal("someone"));

			Assert.AreEqual("one", item.MyProperty0);
			Assert.AreEqual("two", item.MyProperty1);
			Assert.AreEqual("three", item.MyProperty2);
			Assert.AreEqual("rock", item.MyProperty3);
			Assert.IsTrue(item.MyProperty4);
		}
开发者ID:meixger,项目名称:n2cms,代码行数:37,代码来源:WhileEditingContentData.cs

示例6: UpdateItemWithChangesReturnsTrue

		public void UpdateItemWithChangesReturnsTrue()
		{
			var item = new ComplexContainersItem();
			var added = AddEditors(item);

			var tbp0 = added["MyProperty0"] as TextBox;
			var tbp1 = added["MyProperty1"] as TextBox;
			var tbp2 = added["MyProperty2"] as TextBox;
			var ftap3 = added["MyProperty3"] as FreeTextArea;
			var cbp4 = added["MyProperty4"] as CheckBox;

			Assert.That(tbp0 != null, "tbp0 != null");
			Assert.That(tbp1 != null, "tbp1 != null");
			Assert.That(tbp2 != null, "tbp2 != null");
			Assert.That(ftap3 != null, "ftap3 != null");
			Assert.That(cbp4 != null, "cbp4 != null");
			tbp0.Text = "one";
			tbp1.Text = "two";
			tbp2.Text = "three";
			ftap3.Text = "rock";
			cbp4.Checked = true;

			var result = editManager.UpdateItem(definitions.GetDefinition(item.GetContentType()), item, added, CreatePrincipal("someone"));

			Assert.That(result.Length, Is.GreaterThan(0), "UpdateItem didn't return true even though the editors were changed.");
		}
开发者ID:meixger,项目名称:n2cms,代码行数:26,代码来源:WhileEditingContentData.cs

示例7: AddEditors

 protected IDictionary<string, Control> AddEditors(ComplexContainersItem item)
 {
     Type itemType = item.GetContentType();
     Control editorContainer = new Control();
     IDictionary<string, Control> added = editManager.AddEditors(itemType, editorContainer, null);
     return added;
 }
开发者ID:spmason,项目名称:n2cms,代码行数:7,代码来源:EditManagerTests.cs


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