C# Class Alba.Jaml.XamlGeneration.XamlGenerator

Datei anzeigen Open project: Athari/Alba.Jaml Class Usage Examples

Public Properties

Property Type Description
Ns XNamespace
NsMy XNamespace
NsX XNamespace
WpfNameSpaces string[]

Public Methods

Method Description
GenerateXaml ( ) : string
IsComplexProperty ( JProperty prop ) : bool
IsProperty ( JProperty prop ) : bool
IsScalarContentProperty ( JProperty prop ) : bool
IsScalarProperty ( JProperty prop ) : bool
XamlGenerator ( Newtonsoft.Json.Linq.JObject data, string nameSpace, string className ) : System

Private Methods

Method Description
AddComplexBindingConverter ( MatchCollection mSubs, string strBinding, int termPos ) : ConverterInfo
AddPositionalParams ( XamlNodeStackItem obj, List posParams ) : void
AssignPropertyTypeInfos ( Newtonsoft.Json.Linq.JObject jobj, ObjectContext ctx ) : void

Assign real type information for object properties.

AssignSetterTypes ( Newtonsoft.Json.Linq.JObject jstyle, Type targetType ) : void
EnsureConverterNameUnique ( ConverterInfo conv ) : void
FindPrefixByNamespace ( string ns ) : string
FormatComplexPropertyName ( JProperty prop ) : string
FormatGeneratedConverterReference ( string name ) : string
FormatJObjectAsMarkupExt ( Newtonsoft.Json.Linq.JObject jobj ) : string
FormatScalarPropertyName ( JProperty prop ) : string
FormatScalarPropertyValue ( JToken value ) : string
FormatSimpleBindingValue ( string value ) : string
GetComplexBindingTermPos ( string strBinding, Group groupSubLast ) : int
GetGenericInterface ( Type type, Type it ) : Type
GetJObjectFromMarkupExt ( string strMarkup ) : Newtonsoft.Json.Linq.JObject
GetJObjectMultiBinding ( ConverterInfo conv, string afterExpr ) : JToken
GetJObjectSetter ( JProperty prop ) : Newtonsoft.Json.Linq.JObject

Convert JProperty to JObject style setter: <Setter TargetName="targetName" Property="propName" Value="prop.Value"/>.

GetJObjectTrigger ( JProperty prop, Type targetType ) : Newtonsoft.Json.Linq.JObject
GetJTokenComplexBinding ( string value ) : JToken
GetJTokenComplexBindingFromConverter ( ConverterInfo conv, string strBinding, int termPos ) : JToken
GetMarkupExtParser ( ) : MePullParser
GetObjectImplicitKeyPropName ( TokenTypeInfo objInfo ) : string

Get implicit key property name: TargetType for Style, DataType for DataTemplate etc.

GetObjectOrEnum ( JToken jcontent ) : IEnumerable
GetPropertyItemType ( Type objType, string propName ) : Type

Get types of objects contained in property: type of property for simple property, T for IEnumerable, TValue for IDictionary.

GetPropertyType ( Type objType, string propName ) : Type

Get property type by object type and property name. Supports simple, dependency and attached properties.

GetStringBetweenCaptures ( Capture current, Capture next, string str, int termPos ) : string
GetTypeByName ( string typeName ) : Type
GetTypeInfo ( JToken token ) : TokenTypeInfo
GetWpfTypeByName ( Assembly assembly, string typeName ) : Type
GetXAttrObjectVisibility ( Newtonsoft.Json.Linq.JObject jobj, string visibility ) : XAttribute

Get XAttribute for visibility modifier: x:ClassModifier/x:FieldModifier="visibility".

GetXAttrScalarProperty ( JProperty prop ) : object

Get XAttribute for scalar property: attribute="scalarValue" (can also return object if value is multi-binding).

GetXAttrsObjectIds ( string objId, TokenTypeInfo objInfo ) : IEnumerable

Get XAttributes for object identifiers: x:Name/x:Key="objIdExplicit" ImplicitKey="objKeyImplicit".

GetXAttrsShortProps ( Newtonsoft.Json.Linq.JObject jobj, List allProps ) : List

Get XAttributes returned by implementations of IPropertyShortcut.

GetXElementComplexProperty ( JProperty prop ) : XElement

Get XElement for complex properties: <attribute><complexValue/></attribute>.

GetXObject ( Newtonsoft.Json.Linq.JObject jobj ) : XElement
GetXTextScalarPropertyContent ( JProperty prop ) : XText

Get XText for scalar properties: <attribute>scalarValue</attribute>.

IsTypeDictionary ( Type type ) : bool
ParseDollarField ( string dollar, string &visibility, string &typeName, string &objId ) : void
ProcessBindingPropertyValue ( JProperty prop ) : void
ProcessStyleObject ( ObjectContext ctx ) : void
ProcessTemplateObject ( ObjectContext ctx ) : void

Method Details

GenerateXaml() public method

public GenerateXaml ( ) : string
return string

IsComplexProperty() public static method

public static IsComplexProperty ( JProperty prop ) : bool
prop Newtonsoft.Json.Linq.JProperty
return bool

IsProperty() public static method

public static IsProperty ( JProperty prop ) : bool
prop Newtonsoft.Json.Linq.JProperty
return bool

IsScalarContentProperty() public static method

public static IsScalarContentProperty ( JProperty prop ) : bool
prop Newtonsoft.Json.Linq.JProperty
return bool

IsScalarProperty() public static method

public static IsScalarProperty ( JProperty prop ) : bool
prop Newtonsoft.Json.Linq.JProperty
return bool

XamlGenerator() public method

public XamlGenerator ( Newtonsoft.Json.Linq.JObject data, string nameSpace, string className ) : System
data Newtonsoft.Json.Linq.JObject
nameSpace string
className string
return System

Property Details

Ns public_oe property

public XNamespace Ns
return XNamespace

NsMy public_oe property

public XNamespace NsMy
return XNamespace

NsX public_oe property

public XNamespace NsX
return XNamespace

WpfNameSpaces public_oe static_oe property

public static string[] WpfNameSpaces
return string[]