/// <summary> /// Look up a particular template. /// </summary> /// <param name="usage">Desired template.</param> /// <returns>Matching template.</returns> public TemplateAttribute Template(TemplateUsage usage) { TemplateAttribute result = null; foreach (var template in Templates) { if (template.Usage == usage) { result = template; break; } } Debug.Assert(result != null); return(result); }
/// <summary> /// Define a prompt based on a <see cref="TemplateAttribute"/>. /// </summary> /// <param name="pattern">Template to use.</param> public PromptAttribute(TemplateAttribute pattern) : base(pattern) { }
/// <summary> Initialize from another template. </summary> /// <param name="other"> The other template. </param> #endregion public TemplateAttribute(TemplateAttribute other) : base(other) { Usage = other.Usage; }
/// <summary> /// Define a prompt based on a <see cref="TemplateAttribute"/>. /// </summary> /// <param name="pattern">Template to use.</param> public PromptAttribute(TemplateAttribute pattern) : base(pattern) { IsLocalizable = false; }