當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。