예제 #1
0
        /// <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);
        }
예제 #2
0
 /// <summary>
 /// Define a prompt based on a <see cref="TemplateAttribute"/>.
 /// </summary>
 /// <param name="pattern">Template to use.</param>
 public PromptAttribute(TemplateAttribute pattern)
     : base(pattern)
 {
 }
예제 #3
0
 /// <summary>   Initialize from another template. </summary>
 /// <param name="other">    The other template. </param>
 #endregion
 public TemplateAttribute(TemplateAttribute other)
     : base(other)
 {
     Usage = other.Usage;
 }
예제 #4
0
 /// <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;
 }