public override DisplayContext GetContext(DisplayContextType type) { DisplayContext result; switch (type) { case DisplayContextType.DialectHandling: result = (dialectHandling == DialectHandling.STANDARD_NAMES) ? DisplayContext.StandardNames : DisplayContext.DialectNames; break; case DisplayContextType.Capitalization: result = capitalization; break; case DisplayContextType.DisplayLength: result = nameLength; break; case DisplayContextType.SubstituteHandling: result = substituteHandling; break; default: result = DisplayContext.StandardNames; // hmm, we should do something else here break; } return(result); }
public override DisplayContext GetContext(DisplayContextType type) { DisplayContext result = DisplayContext.StandardNames; // final fallback foreach (DisplayContext context in contexts) { if (context.Type() == type) { result = context; break; } } return(result); }
public DisplayContextImpl(DisplayContextType type, int value) { this.type = type; this.value = value; }
/// <summary> /// Returns the current value for a specified <see cref="DisplayContextType"/>. /// </summary> /// <param name="type">The <see cref="DisplayContextType"/> whose value to return.</param> /// <returns>The current DisplayContext setting for the specified type.</returns> /// <stable>ICU 51</stable> public abstract DisplayContext GetContext(DisplayContextType type);