Provides a mechanism for combining multiple IBindableTemplate definitions into a single instance.
Adapted from an article written by James Crowley, which can be found at: http://www.developerfusion.co.uk/show/4721/
Наследование: IBindableTemplate
Пример #1
0
        /// <summary>
        /// Initializes the template for the MultiFormView control
        /// represented by the specified TemplateType.
        /// </summary>
        /// <param name="type">A TemplateType enum value representing the type of template.</param>
        protected void InitTemplate(TemplateType type)
        {
            if (_paths != null && _paths.ContainsKey(type))
            {
                IList    typePaths = _paths[type];
                String[] paths     = new String[typePaths.Count];

                for (int i = 0; i < typePaths.Count; i++)
                {
                    paths[i] = ((TemplatePath)typePaths[i]).Path;
                }

                MultiBindableTemplate template = new MultiBindableTemplate(this.Page, paths);

                switch (type)
                {
                case TemplateType.EditItemTemplate:
                    EditItemTemplate = template;
                    break;

                case TemplateType.EmptyDataTemplate:
                    EmptyDataTemplate = template;
                    break;

                case TemplateType.FooterTemplate:
                    FooterTemplate = template;
                    break;

                case TemplateType.HeaderTemplate:
                    HeaderTemplate = template;
                    break;

                case TemplateType.InsertItemTemplate:
                    InsertItemTemplate = template;
                    break;

                case TemplateType.PagerTemplate:
                    PagerTemplate = template;
                    break;

                default:
                    ItemTemplate = template;
                    break;
                }
            }
        }
Пример #2
0
		/// <summary>
		/// Initializes the template for the MultiFormView control
		/// represented by the specified TemplateType.
		/// </summary>
		/// <param name="type">A TemplateType enum value representing the type of template.</param>
		protected void InitTemplate(TemplateType type)
		{
			if ( _paths != null && _paths.ContainsKey(type) )
			{
				IList typePaths = _paths[type];
				String[] paths = new String[typePaths.Count];

				for ( int i = 0; i < typePaths.Count; i++ )
				{
					paths[i] = ( (TemplatePath) typePaths[i] ).Path;
				}

				MultiBindableTemplate template = new MultiBindableTemplate(this.Page, paths);

				switch ( type )
				{
					case TemplateType.EditItemTemplate:
						EditItemTemplate = template;
						break;
					case TemplateType.EmptyDataTemplate:
						EmptyDataTemplate = template;
						break;
					case TemplateType.FooterTemplate:
						FooterTemplate = template;
						break;
					case TemplateType.HeaderTemplate:
						HeaderTemplate = template;
						break;
					case TemplateType.InsertItemTemplate:
						InsertItemTemplate = template;
						break;
					case TemplateType.PagerTemplate:
						PagerTemplate = template;
						break;
					default:
						ItemTemplate = template;
						break;
				}
			}
		}