コード例 #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>   Initialize from another template. </summary>
 /// <param name="other">    The other template. </param>
 #endregion
 public TemplateAttribute(TemplateAttribute other)
     : base(other)
 {
     Usage = other.Usage;
 }
コード例 #3
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;
 }