C# Класс Alba.Jaml.XamlGeneration.XamlGenerator

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
Ns XNamespace
NsMy XNamespace
NsX XNamespace
WpfNameSpaces string[]

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

GenerateXaml() публичный метод

public GenerateXaml ( ) : string
Результат string

IsComplexProperty() публичный статический метод

public static IsComplexProperty ( JProperty prop ) : bool
prop Newtonsoft.Json.Linq.JProperty
Результат bool

IsProperty() публичный статический метод

public static IsProperty ( JProperty prop ) : bool
prop Newtonsoft.Json.Linq.JProperty
Результат bool

IsScalarContentProperty() публичный статический метод

public static IsScalarContentProperty ( JProperty prop ) : bool
prop Newtonsoft.Json.Linq.JProperty
Результат bool

IsScalarProperty() публичный статический метод

public static IsScalarProperty ( JProperty prop ) : bool
prop Newtonsoft.Json.Linq.JProperty
Результат bool

XamlGenerator() публичный метод

public XamlGenerator ( Newtonsoft.Json.Linq.JObject data, string nameSpace, string className ) : System
data Newtonsoft.Json.Linq.JObject
nameSpace string
className string
Результат System

Описание свойств

Ns публичное свойство

public XNamespace Ns
Результат XNamespace

NsMy публичное свойство

public XNamespace NsMy
Результат XNamespace

NsX публичное свойство

public XNamespace NsX
Результат XNamespace

WpfNameSpaces публичное статическое свойство

public static string[] WpfNameSpaces
Результат string[]