예제 #1
0
		protected override void BeforeAutoCreateEditors()
		{
			base.BeforeAutoCreateEditors();
			FontPreviewPropertyEditor preview = new FontPreviewPropertyEditor();
			preview.EditedType = this.EditedType;
			preview.Getter = this.GetValue;
			this.ParentGrid.ConfigureEditor(preview);
			this.AddPropertyEditor(preview);
			FontContentPropertyEditor content = new FontContentPropertyEditor();
			content.EditedType = this.EditedType;
			content.Getter = this.GetValue;
			content.Setter = this.SetValues;
			content.Hints = HintFlags.None;
			content.HeaderHeight = 0;
			content.HeaderValueText = null;
			content.PreventFocus = true;
			this.ParentGrid.ConfigureEditor(content);
			this.AddPropertyEditor(content);
			content.Expanded = true;
		}
예제 #2
0
		protected override void BeforeAutoCreateEditors()
		{
			base.BeforeAutoCreateEditors();
			FontPreviewPropertyEditor preview = new FontPreviewPropertyEditor();
			preview.EditedType = this.EditedType;
			preview.Getter = this.GetValue;
			this.ParentGrid.ConfigureEditor(preview);
			this.AddPropertyEditor(preview);
			FontContentPropertyEditor content = new FontContentPropertyEditor();
			content.EditedType = this.EditedType;
			content.Getter = this.GetValue;
			content.Hints = HintFlags.None;
			content.HeaderHeight = 0;
			content.HeaderValueText = null;
			content.PreventFocus = true;
			content.CanRenderFontChanged += (sender, e) => 
			{
				// Switch readonly mode on an off, depending on whether we can re-render this Font dynamically.
				content.Setter = content.CanRenderFont ? this.SetValues : (Action<IEnumerable<object>>)null;
			};
			this.ParentGrid.ConfigureEditor(content);
			this.AddPropertyEditor(content);
			content.Expanded = true;
		}