本文整理汇总了C#中Context.getStyle方法的典型用法代码示例。如果您正苦于以下问题:C# Context.getStyle方法的具体用法?C# Context.getStyle怎么用?C# Context.getStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context.getStyle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CompositeMap
/// <summary>
/// Constructor for the <c>CompositeMap</c> object. This will
/// create a converter that is capable of writing map objects to
/// and from XML. The resulting XML is configured by an annotation
/// such that key values can attributes and values can be inline.
/// </summary>
/// <param name="context">
/// this is the root context for the serialization
/// </param>
/// <param name="entry">
/// this provides configuration for the resulting XML
/// </param>
/// <param name="type">
/// this is the map type that is to be converted
/// </param>
public CompositeMap(Context context, Entry entry, Type type) {
this.factory = new MapFactory(context, type);
this.value = entry.GetValue(context);
this.key = entry.GetKey(context);
this.style = context.getStyle();
this.entry = entry;
}
示例2: GetEntry
/// <summary>
/// This is used to either provide the entry value provided within
/// the annotation or compute a entry value. If the entry string
/// is not provided the the entry value is calculated as the type
/// of primitive the object is as a simplified class name.
/// </summary>
/// <param name="context">
/// this is the context used to style the entry
/// </param>
/// <returns>
/// this returns the name of the XML entry element used
/// </returns>
public String GetEntry(Context context) {
Style style = context.getStyle();
String entry = GetEntry();
return style.getElement(entry);
}
示例3: GetName
/// <summary>
/// This is used to acquire the name of the element or attribute
/// that is used by the class schema. The name is determined by
/// checking for an override within the annotation. If it contains
/// a name then that is used, if however the annotation does not
/// specify a name the the field or method name is used instead.
/// </summary>
/// <param name="context">
/// this is the context used to style the name
/// </param>
/// <returns>
/// returns the name that is used for the XML property
/// </returns>
public String GetName(Context context) {
Style style = context.getStyle();
String name = detail.GetName();
return style.getElement(name);
}
示例4: GetName
/// <summary>
/// This is used to acquire the name of the element or attribute
/// that is used by the class schema. The name is determined by
/// checking for an override within the annotation. If it contains
/// a name then that is used, if however the annotation does not
/// specify a name the the field or method name is used instead.
/// </summary>
/// <param name="context">
/// this is the context used to style the name
/// </param>
/// <returns>
/// returns the name that is used for the XML property
/// </returns>
public String GetName(Context context) {
Style style = context.getStyle();
String name = entry.Entry;
if(!label.inline()) {
name = detail.GetName();
}
return style.getElement(name);
}