public RichEditWinPropertyEditor(Type objectType, IModelMemberViewItem model) : base(objectType, model) { if (model is IModelColumn) { return; } _modelRichEditEx = model.GetNode(ViewItemService.PropertyEditorControlMapName).Nodes().OfType <IModelRichEditEx>().First(); ControlBindingProperty = _modelRichEditEx.ControlBindingProperty; }
private static object GetValue(IModelRichEditEx modelRichEdit, Func <RichEditPropertyEditorAttribute, object> func) { if (modelRichEdit.Parent is IModelMemberViewItem richEdit) { var editorType = richEdit.PropertyEditorType; if (typeof(RichEditWinPropertyEditor).IsAssignableFrom(editorType)) { var editorAttribute = editorType.GetCustomAttributes(typeof(RichEditPropertyEditorAttribute), false) .Cast <RichEditPropertyEditorAttribute>().First(); return(func(editorAttribute)); } return("rtf"); } return(null); }
public static string Get_HighLightExtension(IModelRichEditEx modelRichEdit) { return(GetValue(modelRichEdit, attribute => attribute.HighLightExtension) as string); }
public static bool Get_PrintXML(IModelRichEditEx modelRichEdit) { var value = GetValue(modelRichEdit, attribute => attribute.PrintXML); return(value != null && (bool)value); }
public static bool Get_ShowToolBars(IModelRichEditEx modelRichEdit) { var value = GetValue(modelRichEdit, attribute => attribute.ShowToolBars); return(value != null && (bool)value); }
public static string Get_ControlBindingProperty(IModelRichEditEx modelRichEdit) { return(GetValue(modelRichEdit, attribute => attribute.ControlBindingProperty) as string); }
public RichEditWinPropertyEditor(Type objectType, IModelMemberViewItem model) : base(objectType, model) { _modelRichEditEx = ((IModelRichEditEx)model.GetNode(XpandSystemWindowsFormsModule.RichEditMapName)); ControlBindingProperty = _modelRichEditEx.ControlBindingProperty; }