Ejemplo n.º 1
0
        /// <summary>
        /// Gets the column.
        /// </summary>
        /// <param name="pageInstance">The page instance.</param>
        /// <param name="field">The field.</param>
        /// <param name="placeName">Name of the place.</param>
        /// <returns></returns>
        public DataControlField GetColumn(Page pageInstance, MetaField field, string placeName)
        {
            if (pageInstance == null)
            {
                throw new ArgumentNullException("pageInstance");
            }
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }

            TemplateField retVal = new TemplateField();

            string className = field.Owner.Name;

            if (ListManager.MetaClassIsList(className))
            {
                className = "List_@";
            }

            ResolvedPath resPath = ControlPathResolver.Current.Resolve(CHelper.GetMetaTypeName(field), "GridEntity", className, field.Name, placeName);

            if (resPath != null)
            {
                retVal.ItemTemplate = pageInstance.LoadTemplate(resPath.Path);
            }

            return(retVal);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the column.
        /// </summary>
        /// <param name="pageInstance">The page instance.</param>
        /// <param name="field">The field.</param>
        /// <param name="placeName">Name of the place.</param>
        /// <returns></returns>
        public DataControlField GetColumn(Page pageInstance, MetaField field, string placeName)
        {
            if (pageInstance == null)
            {
                throw new ArgumentNullException("pageInstance");
            }
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }

            if (ControlPathResolver.Current == null)
            {
                throw new ArgumentNullException("ControlPathResolver");
            }

            if (pageInstance == null)
            {
                throw new ArgumentNullException("pageInstance");
            }

            TemplateField retVal = new TemplateField();

            ResolvedPath resPath = ControlPathResolver.Current.Resolve(CHelper.GetMetaTypeName(field), "Grid", field.Owner.Name, field.Name, placeName);

            if (resPath != null)
            {
                retVal.ItemTemplate = pageInstance.LoadTemplate(resPath.Path);
            }

            return(retVal);
        }
Ejemplo n.º 3
0
        public DataControlField GetColumn(Page PageInstance, MetaField Field, bool IsPrimaryKey)
        {
            if (PageInstance == null)
            {
                throw new ArgumentNullException("pageInstance");
            }
            if (Field == null)
            {
                throw new ArgumentNullException("field");
            }

            TemplateField retVal = new TemplateField();

            if (!IsPrimaryKey)
            {
                string className = Field.Owner.Name;
                if (ListManager.MetaClassIsList(className))
                {
                    className = "List_@";
                }
                ResolvedPath resPath = ControlPathResolver.Current.Resolve(CHelper.GetMetaTypeName(Field), "GridEntity", className, Field.Name, viewName);

                if (resPath != null)
                {
                    retVal.ItemTemplate = PageInstance.LoadTemplate(resPath.Path);
                }
            }
            else
            {
                retVal.ItemTemplate = PageInstance.LoadTemplate("~/Apps/MetaUIEntity/Primitives/Text.GridEntity.@[email protected]");
            }

            return(retVal);
        }
Ejemplo n.º 4
0
        public DataControlField GetColumn(Page pageInstance, MetaField field, bool isPrimaryKey)
        {
            if (pageInstance == null)
            {
                throw new ArgumentNullException("pageInstance");
            }
            if (field == null)
            {
                throw new ArgumentNullException("field");
            }

            if (ControlPathResolver.Current == null)
            {
                throw new ArgumentNullException("ControlPathResolver");
            }

            TemplateField retVal = new TemplateField();

            if (!isPrimaryKey)
            {
                ResolvedPath resPath = ControlPathResolver.Current.Resolve(CHelper.GetMetaTypeName(field), "Grid", field.Owner.Name, field.Name, viewName);

                //retVal.ItemTemplate = PageInstance.LoadTemplate(MetaFieldControlPathResolver.Resolve(CHelper.GetMetaTypeName(Field)/*Field.TypeName*/, "Grid", Field.Owner.Name, Field.Name, viewName, string.Empty));
                if (resPath != null)
                {
                    retVal.ItemTemplate = pageInstance.LoadTemplate(resPath.Path);
                }
            }
            else
            {
                retVal.ItemTemplate = pageInstance.LoadTemplate("~/Apps/MetaUI/Primitives/Text.Grid.@[email protected]");
            }

            return(retVal);
        }