예제 #1
12
 public MobileListViewItemBase()
 {
     HtmlAttributes = new RouteValueDictionary();
     Content        = new HtmlTemplate();
 }
예제 #2
0
        public Grid(ViewContext viewContext,
                    IJavaScriptInitializer initializer,
                    IUrlGenerator urlGenerator,
                    IGridHtmlBuilderFactory htmlBuilderFactory) : base(viewContext, initializer)
        {
            this.htmlBuilderFactory = htmlBuilderFactory;

            UrlGenerator = urlGenerator;

            PrefixUrlParameters = true;
            RowTemplate         = new HtmlTemplate <T>();
            DetailTemplate      = new HtmlTemplate <T>();
            Columns             = new List <GridColumnBase <T> >();
            DataKeys            = new List <IDataKey>();

            Pageable    = new PageableSettings();
            Sortable    = new GridSortableSettings();
            Scrollable  = new GridScrollableSettings();
            Navigatable = new GridNavigatableSettings(this);
            Filterable  = new GridFilterableSettings();
            ColumnMenu  = new GridColumnMenuSettings();

            Editable = new GridEditableSettings <T>(this)
            {
                PopUp = new Window(viewContext, Initializer)
                {
                    Modal     = true,
                    Draggable = true
                }
            };

            Grouping    = new GridGroupableSettings();
            Resizable   = new GridResizableSettings();
            Reorderable = new GridReorderableSettings();

            TableHtmlAttributes = new RouteValueDictionary();

            IsEmpty = true;

            Selectable = new GridSelectableSettings();

            ToolBar           = new GridToolBarSettings <T>(this);
            NoRecordsTemplate = new HtmlTemplate();

            ValidationMetadata = new Dictionary <string, object>();

            AutoGenerateColumns = true;

            DataSource = new DataSource()
            {
                Type             = DataSourceType.Server,
                ServerAggregates = true,
                ServerFiltering  = true,
                ServerGrouping   = true,
                ServerPaging     = true,
                ServerSorting    = true
            };

            DataSource.ModelType(typeof(T));
        }
예제 #3
0
        public Editor(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
            : base(viewContext, initializer)
        {
            UrlGenerator = urlGenerator;

            DefaultToolGroup = new EditorToolGroup(this);

            Template             = new HtmlTemplate();
            Messages             = new EditorMessages();
            SerializationOptions = new EditorSerializationOptions();
            StyleSheets          = new List <string>();

            new EditorToolFactory(DefaultToolGroup)
            .Formatting()
            .Bold().Italic().Underline()
            .JustifyLeft().JustifyCenter().JustifyRight()
            .InsertUnorderedList().InsertOrderedList()
            .Outdent().Indent()
            .CreateLink().Unlink()
            .InsertImage()
            .TableEditing();

            TagName = "textarea";

            ImageBrowserSettings = new EditorImageBrowserSettings(Messages.ImageBrowserMessages);
        }
예제 #4
0
파일: Editor.cs 프로젝트: Zedfa/Core
        public Editor(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
            : base(viewContext, initializer)
        {
            UrlGenerator = urlGenerator;

            DefaultToolGroup = new EditorToolGroup(this);

            Template    = new HtmlTemplate();
            Messages    = new EditorMessages();
            StyleSheets = new List <string>();

            new EditorToolFactory(DefaultToolGroup)
            .Bold().Italic().Underline().Strikethrough()
            .FontName()
            .FontSize()
            .FontColor().BackColor()
            .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
            .InsertUnorderedList().InsertOrderedList()
            .Outdent().Indent()
            .FormatBlock()
            .CreateLink().Unlink()
            .InsertImage();

            ImageBrowserSettings = new EditorImageBrowserSettings(Messages.ImageBrowserMessages);
        }
예제 #5
0
파일: Button.cs 프로젝트: akhuang/Zing
 public Button(ViewContext viewContext, IJavaScriptInitializer initializer)
     : base(viewContext, initializer)
 {
     Enable   = true;
     Tag      = "button";
     Template = new HtmlTemplate();
 }
예제 #6
0
 protected GridColumnBase(Grid <T> grid)
 {
     Grid           = grid;
     Settings       = new GridColumnSettings();
     Visible        = true;
     HeaderTemplate = new HtmlTemplate();
     FooterTemplate = new HtmlTemplate <GridAggregateResult>();
 }
예제 #7
0
        public SplitterPane()
        {
            Scrollable = true;
            Resizable  = true;

            HtmlAttributes = new RouteValueDictionary();

            Template = new HtmlTemplate();
        }
예제 #8
0
        public MobileNavBar(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
            : base(viewContext, initializer)
        {
            this.urlGenerator = urlGenerator;

            Content = new HtmlTemplate();
//>> Initialization

            //<< Initialization
        }
예제 #9
0
        public GridCell(GridColumnBase <T> column, T dataItem)
        {
            Column   = column;
            Grid     = column.Grid;
            DataItem = dataItem;
            Template = new HtmlTemplate <T>();

            HtmlAttributes = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase);
            HtmlAttributes.Merge(column.HtmlAttributes);
        }
예제 #10
0
 private Action <object, IHtmlNode> MapDetailTemplate(HtmlTemplate <T> detailTemplate)
 {
     return((dataItem, container) =>
     {
         if (detailTemplate != null && detailTemplate.HasValue())
         {
             detailTemplate.Apply((T)dataItem, container);
         }
     });
 }
예제 #11
0
 protected NavigationItem()
 {
     Template              = new HtmlTemplate();
     HtmlAttributes        = new RouteValueDictionary();
     ImageHtmlAttributes   = new RouteValueDictionary();
     LinkHtmlAttributes    = new RouteValueDictionary();
     RouteValues           = new RouteValueDictionary();
     ContentHtmlAttributes = new RouteValueDictionary();
     Visible = true;
     Enabled = true;
     Encoded = true;
 }
예제 #12
0
        public MobileLayout(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
            : base(viewContext, initializer)
        {
            this.urlGenerator    = urlGenerator;
            Header               = new HtmlTemplate();
            Footer               = new HtmlTemplate();
            HeaderHtmlAttributes = new RouteValueDictionary();
            FooterHtmlAttributes = new RouteValueDictionary();
            //>> Initialization

            //<< Initialization
        }
예제 #13
0
        public MobileModalView(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
            : base(viewContext, initializer)
        {
            this.urlGenerator = urlGenerator;
            Header            = new HtmlTemplate();
            Content           = new HtmlTemplate();
            Footer            = new HtmlTemplate();
            Modal             = true;
//>> Initialization

            //<< Initialization
        }
예제 #14
0
        public MobileSplitViewPane()
        {
            //>> Initialization

            //<< Initialization


            HtmlAttributes = new RouteValueDictionary();

            Content = new HtmlTemplate();

            Events = new Dictionary <string, object>();
        }
예제 #15
0
        public MobilePopOver(ViewContext viewContext, IJavaScriptInitializer initializer, IUrlGenerator urlGenerator)
            : base(viewContext, initializer)
        {
            this.urlGenerator = urlGenerator;

            Content = new HtmlTemplate();
//>> Initialization

            Pane = new MobilePopOverPaneSettings();

            Popup = new MobilePopOverPopupSettings();

            //<< Initialization
        }
예제 #16
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GridBoundColumn{TModel, TValue}"/> class.
        /// </summary>
        /// <param name="grid"></param>
        /// <param name="expression"></param>
        public GridBoundColumn(Grid <TModel> grid, Expression <Func <TModel, TValue> > expression)
            : base(grid)
        {
            if (typeof(TModel).IsPlainType() && !expression.IsBindable())
            {
                throw new InvalidOperationException(Exceptions.MemberExpressionRequired);
            }

            Expression = expression;
            Member     = expression.MemberWithoutInstance();
            MemberType = expression.ToMemberExpression().Type();

            Func <TModel, TValue> value;
            var key = expression.ToString();

            using (syncLock.ReadAndWrite())
            {
                if (!expressionCache.TryGetValue(key, out value))
                {
                    using (syncLock.Write())
                    {
                        if (!expressionCache.TryGetValue(key, out value))
                        {
                            expressionCache[key] = value = expression.Compile();
                        }
                    }
                }
            }

            Value = value;
            GroupFooterTemplate = new HtmlTemplate <GridAggregateResult>();
            GroupHeaderTemplate = new HtmlTemplate <GridGroupAggregateResult>();

            if (typeof(TModel).IsPlainType())
            {
                Metadata   = ModelMetadata.FromLambdaExpression(expression, new ViewDataDictionary <TModel>());
                MemberType = Metadata.ModelType;
                Title      = Metadata.DisplayName;
                Format     = Metadata.DisplayFormatString;
                Visible    = Metadata.ShowForDisplay;
            }

            if (string.IsNullOrEmpty(Title))
            {
                Title = Member.AsTitle();
            }

            FilterableSettings = new GridBoundColumnFilterableSettings();
        }
예제 #17
0
        public Window(ViewContext viewContext, IJavaScriptInitializer initializer)
            : base(viewContext, initializer)
        {
            Template = new HtmlTemplate();

            ResizingSettings = new WindowResizingSettings();

            Actions = new WindowButtons();
            defaultButtons.Each(button => Actions.Container.Add(button));

            Animation = new PopupAnimation();

            ContentHtmlAttributes = new RouteValueDictionary();

            Scrollable = true;

            Visible = true;
        }
예제 #18
0
        protected virtual IGridDataCellBuilder CreateDisplayBuilderCore(IGridHtmlHelper htmlHelper)
        {
            var template = new HtmlTemplate <T>();

            if (Template != null)
            {
                template.CodeBlockTemplate = Template;
            }

            if (InlineTemplate != null)
            {
                template.InlineTemplate = InlineTemplate;
            }

            var builder = new GridTemplateCellBuilder <T>(template);

            builder.HtmlAttributes.Merge(HtmlAttributes);
            return(builder);
        }
예제 #19
0
        public MobileScrollViewItem()
        {
            HtmlAttributes = new RouteValueDictionary();

            Content = new HtmlTemplate();
        }
예제 #20
0
 public GridToolBarSettings(Grid <T> grid)
 {
     Commands = new List <GridActionCommandBase>();
     Grid     = grid;
     Template = new HtmlTemplate();
 }
예제 #21
-4
 public GridDetailTemplate()
 {
     Template = new HtmlTemplate <TModel>();
 }