示例#1
0
		private static Control AddEditorAndInit(DecoratedItem item, EditableItemAttribute editable, Page page, ItemEditor enclosingEditor)
		{
			page.Controls.Add(enclosingEditor);
			enclosingEditor.Page = page;
			enclosingEditor.CurrentItem = item;
			var editor = editable.AddTo(enclosingEditor);
			page.InitRecursive();
			return editor;
		}
示例#2
0
		public void ValidatorsAreAddedToPage()
		{
			var p = new Page();
			Assert.AreEqual(0, p.Validators.Count);
			editManager.AddEditors(definitions.GetDefinition(typeof(ItemWithRequiredProperty)), new ItemWithRequiredProperty(), p, CreatePrincipal("someone"));
			p.InitRecursive();
			Assert.AreEqual(2, p.Validators.Count);
		}