示例#1
0
        public override Widget build(BuildContext context)
        {
            var    followers = this.widget.viewModel.followers;
            Widget content;

            if (this.widget.viewModel.followerLoading && followers.isEmpty())
            {
                content = new GlobalLoading();
            }
            else if (followers.Count <= 0)
            {
                content = new BlankView(
                    $"暂无{this._title}用户",
                    "image/default-following",
                    true,
                    () => {
                    this.widget.actionModel.startFetchFollower();
                    this.widget.actionModel.fetchFollower(0);
                }
                    );
            }
            else
            {
                content = new CustomScrollbar(
                    new SmartRefresher(
                        controller: this._refreshController,
                        enablePullDown: true,
                        enablePullUp: this.widget.viewModel.followersHasMore,
                        onRefresh: this._onRefresh,
                        child: ListView.builder(
                            physics: new AlwaysScrollableScrollPhysics(),
                            itemCount: followers.Count,
                            itemBuilder: this._buildUserCard
                            )
                        )
                    );
            }

            return(new Container(
                       color: CColors.White,
                       child: new CustomSafeArea(
                           bottom: false,
                           child: new Container(
                               color: CColors.Background,
                               child: new Column(
                                   children: new List <Widget> {
                this._buildNavigationBar(context: context),
                new Expanded(
                    child: content
                    )
            }
                                   )
                               )
                           )
                       ));
        }
示例#2
0
        public ModScrollBar()
        {
            gameObject          = new GameObject("Base Scroll Area");
            rectTransform       = gameObject.AddComponent <RectTransform>();
            sbVerticalObject    = new GameObject("Vertical Scrollbar");
            handleAreaObject    = new GameObject("Handle Area");
            handleObject        = new GameObject("Handle");
            handleOutlineObject = new GameObject("Handle Outline");
            viewportObject      = new GameObject("Viewport");

            sbVerticalObject.transform.SetParent(gameObject.transform);
            handleAreaObject.transform.SetParent(sbVerticalObject.transform);
            handleObject.transform.SetParent(handleAreaObject.transform);
            handleOutlineObject.transform.SetParent(handleObject.transform);
            viewportObject.transform.SetParent(gameObject.transform);

            scrollRect = gameObject.AddComponent <ScrollRect>();
            gameObject.AddComponent <Image>();
            handleAreaObject.AddComponent <Image>();
            viewportObject.AddComponent <Image>();

            Image         handleImage        = handleObject.AddComponent <Image>();
            Image         handleOutlineImage = handleOutlineObject.AddComponent <Image>();
            RectTransform handleOutlineRect  = handleOutlineObject.GetComponent <RectTransform>();
            Mask          mask           = viewportObject.AddComponent <Mask>();
            RectTransform handleAreaRect = handleAreaObject.GetComponent <RectTransform>();
            RectTransform handleRect     = handleObject.GetComponent <RectTransform>();


            handleOutlineRect.sizeDelta = new Vector2(0, 0);


            handleAreaRect.pivot     = new Vector2(0, 1);
            handleAreaRect.anchorMin = new Vector2(0, 1);
            handleAreaRect.anchorMax = new Vector2(0, 1);

            customScrollbar = sbVerticalObject.AddComponent <CustomScrollbar>();
            customScrollbar.imageOnHover         = handleOutlineImage;
            customScrollbar.allowAllEventSystems = true;
            customScrollbar.handleRect           = handleObject.GetComponent <RectTransform>();
            customScrollbar.targetGraphic        = handleImage;
            customScrollbar.GetComponent <MPEventSystemLocator>().SetProperyValue("eventSystemProvider", GameObject.Find("MainMenu").GetComponent <MPEventSystemProvider>());

            scrollRect.viewport          = viewportObject.GetComponent <RectTransform>();
            scrollRect.verticalScrollbar = customScrollbar;
            scrollRect.scrollSensitivity = 50f;

            mask.showMaskGraphic = false;
        }
示例#3
0
        public override Widget build(BuildContext context)
        {
            Widget content;
            var    followingTeams = this.widget.viewModel.followingTeams;

            if (this.widget.viewModel.followingTeamLoading && followingTeams.isEmpty())
            {
                content = new GlobalLoading();
            }
            else if (followingTeams.Count <= 0)
            {
                content = new BlankView(
                    "没有关注的公司,去首页看看吧",
                    "image/default-following"
                    );
            }
            else
            {
                var enablePullUp = this.widget.viewModel.followingTeamsHasMore;
                var itemCount    = enablePullUp ? followingTeams.Count + 1 : followingTeams.Count + 2;
                content = new CustomScrollbar(
                    new SmartRefresher(
                        controller: this._refreshController,
                        enablePullDown: true,
                        enablePullUp: enablePullUp,
                        onRefresh: this._onRefresh,
                        child: ListView.builder(
                            physics: new AlwaysScrollableScrollPhysics(),
                            itemCount: itemCount,
                            itemBuilder: this._buildTeamCard
                            )
                        )
                    );
            }
            return(new Container(
                       color: CColors.Background,
                       child: content
                       ));
        }
        public override Widget build(BuildContext context)
        {
            var    collectionIds = this.widget.viewModel.collectionIds;
            Widget content;

            if (this.widget.viewModel.collectionLoading && collectionIds.isEmpty())
            {
                content = new GlobalLoading(
                    color: CColors.Transparent,
                    loadingColor: LoadingColor.white
                    );
            }
            else if (collectionIds.Count <= 0)
            {
                content = new CustomScrollbar(
                    new CustomScrollView(
                        new PageStorageKey <string>("合辑"),
                        slivers: new List <Widget> {
                    new SliverToBoxAdapter(
                        child: new Container(height: 16)
                        ),
                    new SliverFillRemaining(
                        child: new BlankView(
                            "暂无合辑",
                            "image/default-article",
                            true,
                            () => {
                        this.widget.actionModel.startFetchCollection();
                        this.widget.actionModel.fetchCollection(arg: firstPageNumber);
                    },
                            new BoxDecoration(
                                color: CColors.White,
                                borderRadius: BorderRadius.only(12, 12)
                                )
                            )
                        )
                }
                        )
                    );
            }
            else
            {
                var    enablePullUp = this.widget.viewModel.collectionHasMore;
                Widget endView;
                if (!enablePullUp)
                {
                    endView = new EndView();
                }
                else
                {
                    endView = new Visibility(
                        visible: this._isLoading,
                        child: new Container(
                            padding: EdgeInsets.symmetric(16),
                            child: new CustomActivityIndicator(
                                loadingColor: LoadingColor.white,
                                animating: this._isLoading ? AnimatingType.repeat : AnimatingType.reset
                                )
                            )
                        );
                }

                content = new NotificationListener <ScrollNotification>(
                    onNotification: this._onNotification,
                    child: new CustomScrollbar(
                        new CustomScrollView(
                            new PageStorageKey <string>("合辑"),
                            physics: new AlwaysScrollableScrollPhysics(),
                            slivers: new List <Widget> {
                    new SliverToBoxAdapter(
                        child: new Container(
                            child: new Column(
                                children: new List <Widget> {
                        new SizedBox(height: 16),
                        new LeaderBoardUpdateTip(),
                        new CustomDivider(height: 1, color: CColors.Separator2)
                    }
                                )
                            )
                        ),
                    new SliverFixedExtentList(
                        del: new SliverChildBuilderDelegate(
                            builder: this._buildCollectionCard,
                            childCount: collectionIds.Count
                            ),
                        itemExtent: 112
                        ),
                    new SliverToBoxAdapter(
                        child: endView
                        )
                }
                            )
                        )
                    );
            }

            return(new Container(
                       child: content
                       ));
        }
示例#5
0
        private void init_Control()
        {
            this.Padding         = App.FormBorder;
            this.BackColor       = App.ColorBorder;
            this.FormBorderStyle = FormBorderStyle.None;
            this.ClientSize      = new Size(App.Width, 555);

            ////////////////////////////////////////////////////

            #region [ === MENU === ]

            MenuStrip menu = new MenuStrip()
            {
                Dock = DockStyle.Top, BackColor = App.ColorBg
            };
            //ToolStripTextBox mn_DbSearch = new ToolStripTextBox() { Width = left_Width, BorderStyle = BorderStyle.FixedSingle, BackColor = Color.LightGray };
            lbl_Title = new ToolStripLabel()
            {
                Text = "// ... ", ForeColor = Color.White,
            };
            ToolStripMenuItem mn = new ToolStripMenuItem()
            {
                Text = "MODEL", ForeColor = Color.White, Alignment = ToolStripItemAlignment.Right,
            };
            var mn_ModelAdd = new ToolStripMenuItem()
            {
                Text = "Model Add"
            };
            mn_ModelAdd.Click += (se, ev) => model_Add();
            var mn_ModelConfig = new ToolStripMenuItem()
            {
                Text = "Model Config"
            };
            mn_ModelConfig.Click += (se, ev) => model_Config();
            var mn_ModelEdit = new ToolStripMenuItem()
            {
                Text = "Model Edit"
            };
            mn_ModelEdit.Click += (se, ev) => model_Edit();
            var mn_ModelRemove = new ToolStripMenuItem()
            {
                Text = "Model Remove"
            };
            mn_ModelRemove.Click += (se, ev) => model_Remove();
            var mn_ItemAdd = new ToolStripMenuItem()
            {
                Text = "Item Add"
            };
            mn_ItemAdd.Click += (se, ev) => item_Add();
            mn.DropDownItems.AddRange(new ToolStripItem[] { mn_ModelAdd, mn_ModelConfig, mn_ModelEdit, mn_ModelRemove, mn_ItemAdd });
            ToolStripItem mn_Hide = new ToolStripMenuItem()
            {
                Text = "HIDE", ForeColor = Color.White, Alignment = ToolStripItemAlignment.Right
            };
            ToolStripItem mn_Exit = new ToolStripMenuItem()
            {
                Text = "EXIT", ForeColor = Color.White, Alignment = ToolStripItemAlignment.Right,
            };
            mn_Hide.Click += (se, ev) => { this.Hide(); };
            mn_Exit.Click += (se, ev) => { if (OnExit != null)
                                           {
                                               OnExit();
                                           }
            };
            menu.Items.AddRange(new ToolStripItem[] { lbl_Title, mn_Exit, mn_Hide, mn, });
            menu.MouseDown += Label_MouseDown;
            this.Controls.Add(menu);

            #endregion

            ////////////////////////////////////////////////////

            #region [ === FORM - BOX LEFT === ]

            Panel box_Left = new Panel()
            {
                Dock = DockStyle.Left, Width = App.col_Left_Width, BackColor = Color.White, Margin = new Padding(0), Padding = new Padding(0),
            };
            TextBox txt_Search = new TextBox()
            {
                Dock = DockStyle.Top, BackColor = App.ColorControl, Width = 100, Height = 20, Margin = new Padding(10, 10, 0, 0), Text = "", BorderStyle = BorderStyle.FixedSingle
            };

            CustomScrollbar scrollbar1 = new CustomScrollbar()
            {
                Dock = DockStyle.Left,

                ActiveBackColor = Color.White,
                BackColor       = Color.White,

                LargeChange = 10,
                Location    = new Point(306, 12),
                Maximum     = 99,
                Minimum     = 0,
                Size        = new Size(13, 303),
                SmallChange = 1,
                TabIndex    = 1,
                ThumbStyle  = CustomScrollbar.ThumbStyleEnum.Auto,
                Value       = 0,
                Margin      = new Padding(0),
                Padding     = new Padding(0),
            };
            //ScrollbarStyleHelper.ApplyStyle(scrollbar1, ScrollbarStyleHelper.StyleTypeEnum.Blue);
            ScrollbarStyleHelper.ApplyStyle(scrollbar1, ScrollbarStyleHelper.StyleTypeEnum.Black);

            listDB = new CustomListView(true)
            {
                Dock        = DockStyle.Fill,
                BorderStyle = BorderStyle.None,
                BackColor   = Color.WhiteSmoke,

                HeaderStyle   = ColumnHeaderStyle.None,
                FullRowSelect = true,
                //HideSelection = false,
                //Location = new Point(12, 12),
                MultiSelect = false,
                //Size = new Size(288, 303),
                UseCompatibleStateImageBehavior = false,
                View       = View.Details,
                VScrollbar = new ScrollbarCollector(scrollbar1),
            };
            listDB.Columns.AddRange(new ColumnHeader[] { new ColumnHeader()
                                                         {
                                                             Text = "", Width = App.col_Left_Width
                                                         } });

            box_Left.Controls.AddRange(new Control[] {
                txt_Search,
                listDB,
                scrollbar1,
            });

            listDB.BeginUpdate();
            for (int x = 0; x < dbName.Length; x++)
            {
                listDB.Items.Add(dbName[x]);
            }
            //for (int x = dbName.Length; x < 999; x++) listDB.Items.Add("Auto test " + x.ToString());
            listDB.EndUpdate();

            this.Controls.Add(box_Left);
            scrollbar1.BringToFront();

            #endregion

            ////////////////////////////////////////////////////

            #region [ === FORM - BOX RIGHT === ]

            Splitter splitter = new Splitter()
            {
                Dock = DockStyle.Left, BackColor = App.ColorBg, Width = App.col_Splitter_Width
            };

            Panel box_Right = new Panel()
            {
                Dock = DockStyle.Fill, BackColor = Color.White,
            };
            tab = new TabControlCustom()
            {
                Dock = DockStyle.Fill
            };

            Panel box_Footer = new Panel()
            {
                Dock = DockStyle.Bottom, Height = 20, Padding = new Padding(1, 1, 1, 0), BackColor = App.ColorBg
            };
            box_Footer.MouseDown += Label_MouseDown;

            ButtonCustom btn_ModelAdd = new ButtonCustom()
            {
                Text = "Tab Add", Dock = DockStyle.Left, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = App.ColorBg, ForeColor = Color.White,
            };
            ButtonCustom btn_ModelEdit = new ButtonCustom()
            {
                Text = "Tab Edit", Dock = DockStyle.Left, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = App.ColorBg, ForeColor = Color.White,
            };
            ButtonCustom btn_ModelRemove = new ButtonCustom()
            {
                Text = "Tab Remove", Dock = DockStyle.Left, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = App.ColorBg, ForeColor = Color.White,
            };

            ButtonCustom btn_ItemAdd = new ButtonCustom()
            {
                Text = "Item Add", Dock = DockStyle.Left, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = App.ColorBg, ForeColor = Color.White,
            };
            ButtonCustom btn_ItemEdit = new ButtonCustom()
            {
                Text = "Item Edit", Dock = DockStyle.Left, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = App.ColorBg, ForeColor = Color.White,
            };
            ButtonCustom btn_ItemRemove = new ButtonCustom()
            {
                Text = "Item Remove", Dock = DockStyle.Left, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = App.ColorBg, ForeColor = Color.White,
            };

            box_Footer.Controls.AddRange(new Control[] {
                btn_ItemRemove,
                btn_ItemEdit,
                btn_ItemAdd,

                btn_ModelRemove,
                btn_ModelEdit,
                btn_ModelAdd,
            });

            box_Right.Controls.AddRange(new Control[] {
                tab,
                //box_Footer,
            });

            #endregion

            ////////////////////////////////////////////////////
            // LOAD CONTROL

            this.Controls.Add(box_Left);
            this.Controls.Add(splitter);
            this.Controls.Add(box_Right);
            box_Left.BringToFront();
            listDB.BringToFront();
            splitter.BringToFront();
            box_Right.BringToFront();

            ////////////////////////////////////////////////////

            listDB_Init();
        }
        public override Widget build(BuildContext context)
        {
            var    bloggerIds = this.widget.viewModel.bloggerIds;
            Widget content;

            if (this.widget.viewModel.bloggerLoading && bloggerIds.isEmpty())
            {
                content = new GlobalLoading(
                    color: CColors.Transparent,
                    loadingColor: LoadingColor.white
                    );
            }
            else if (bloggerIds.Count <= 0)
            {
                content = new CustomScrollbar(
                    new CustomScrollView(
                        new PageStorageKey <string>("博主"),
                        physics: new AlwaysScrollableScrollPhysics(),
                        slivers: new List <Widget> {
                    new SliverToBoxAdapter(
                        child: new Container(height: 16)
                        ),
                    new SliverFillRemaining(
                        child: new BlankView(
                            "暂无博主",
                            "image/default-following",
                            true,
                            () => {
                        this.widget.actionModel.startFetchBlogger();
                        this.widget.actionModel.fetchBlogger(arg: firstPageNumber);
                    },
                            new BoxDecoration(
                                color: CColors.White,
                                borderRadius: BorderRadius.only(12, 12)
                                )
                            )
                        )
                }
                        )
                    );
            }
            else
            {
                var    enablePullUp = this.widget.viewModel.bloggerHasMore;
                Widget endView;
                if (!enablePullUp)
                {
                    endView = new EndView();
                }
                else
                {
                    endView = new Visibility(
                        visible: this._isLoading,
                        child: new Container(
                            color: CColors.Background,
                            padding: EdgeInsets.symmetric(16),
                            child: new CustomActivityIndicator(
                                loadingColor: LoadingColor.black,
                                animating: this._isLoading ? AnimatingType.repeat : AnimatingType.reset
                                )
                            )
                        );
                }
                content = new NotificationListener <ScrollNotification>(
                    onNotification: this._onNotification,
                    child: new CustomScrollbar(
                        new CustomScrollView(
                            new PageStorageKey <string>("博主"),
                            physics: new AlwaysScrollableScrollPhysics(),
                            slivers: new List <Widget> {
                    new SliverToBoxAdapter(
                        child: new Container(
                            child: new Column(
                                children: new List <Widget> {
                        new LeaderBoardBloggerHeader(
                            bloggerIds: bloggerIds,
                            userDict: this.widget.viewModel.userDict,
                            userId => this.widget.actionModel.pushToUserDetail(obj: userId)
                            ),
                        new LeaderBoardUpdateTip(),
                        new CustomDivider(height: 1, color: CColors.Separator2)
                    }
                                )
                            )
                        ),
                    new SliverList(
                        del: new SliverChildBuilderDelegate(
                            builder: this._buildBloggerCard,
                            childCount: bloggerIds.Count
                            )
                        ),
                    new SliverToBoxAdapter(
                        child: endView
                        )
                }
                            )
                        )
                    );
            }
            return(new Container(
                       child: content
                       ));
        }
示例#7
0
        public override Widget build(BuildContext context)
        {
            Widget content;

            if (this.widget.viewModel.searchFollowingUserLoading)
            {
                content = new GlobalLoading();
            }
            else if (this.widget.viewModel.searchFollowingKeyword.Length > 0)
            {
                if (this.widget.viewModel.searchFollowingUsers.Count > 0)
                {
                    content = new Container(
                        color: CColors.Background,
                        child: new CustomScrollbar(
                            new SmartRefresher(
                                controller: this._refreshController,
                                enablePullDown: false,
                                enablePullUp: this.widget.viewModel.searchFollowingUserHasMore,
                                onRefresh: this._onRefreshSearchFollowing,
                                child: ListView.builder(
                                    physics: new AlwaysScrollableScrollPhysics(),
                                    itemCount: this.widget.viewModel.searchFollowingUsers.Count,
                                    itemBuilder: (cxt, index) => {
                        var searchUser = this.widget.viewModel.searchFollowingUsers[index: index];
                        return(new UserCard(
                                   user: searchUser,
                                   () => this.widget.actionModel.pushToUserDetail(obj: searchUser.id),
                                   key: new ObjectKey(value: searchUser.id)
                                   ));
                    }
                                    )
                                )
                            )
                        );
                }
                else
                {
                    content = new BlankView(
                        "哎呀,换个关键词试试吧",
                        "image/default-search"
                        );
                }
            }
            else if (this.widget.viewModel.followingUserLoading && this.widget.viewModel.followingUsers.isEmpty())
            {
                content = new GlobalLoading();
            }
            else if (this.widget.viewModel.followingUsers.Count <= 0)
            {
                content = new BlankView(
                    "没有关注的人,去首页看看吧",
                    "image/default-following"
                    );
            }
            else
            {
                var followingUsers = this.widget.viewModel.followingUsers;
                var enablePullUp   = this.widget.viewModel.followingUsersHasMore;
                var itemCount      = enablePullUp ? followingUsers.Count + 1 : followingUsers.Count + 2;
                content = new CustomScrollbar(
                    new SmartRefresher(
                        controller: this._refreshController,
                        enablePullDown: true,
                        enablePullUp: enablePullUp,
                        onRefresh: this._onRefreshFollowing,
                        child: ListView.builder(
                            physics: new AlwaysScrollableScrollPhysics(),
                            itemCount: itemCount,
                            itemBuilder: (cxt, index) => {
                    if (index == 0)
                    {
                        return(new CustomDivider(color: CColors.White));
                    }

                    if (index == followingUsers.Count + 1)
                    {
                        return(new EndView());
                    }

                    var followingUser = followingUsers[index - 1];
                    UserType userType = UserType.unFollow;
                    if (!this.widget.viewModel.isLoggedIn)
                    {
                        userType = UserType.unFollow;
                    }
                    else
                    {
                        var followUserLoading = false;
                        if (this.widget.viewModel.userDict.ContainsKey(key: followingUser.id))
                        {
                            var user          = this.widget.viewModel.userDict[key: followingUser.id];
                            followUserLoading = user.followUserLoading ?? false;
                        }

                        if (this.widget.viewModel.currentUserId == followingUser.id)
                        {
                            userType = UserType.me;
                        }
                        else if (followUserLoading)
                        {
                            userType = UserType.loading;
                        }
                        else if (this.widget.viewModel.followMap.ContainsKey(key: followingUser.id))
                        {
                            userType = UserType.follow;
                        }
                    }

                    return(new UserCard(
                               user: followingUser,
                               () => this.widget.actionModel.pushToUserDetail(obj: followingUser.id),
                               userType: userType,
                               () => this._onFollow(userType: userType, userId: followingUser.id),
                               new ObjectKey(value: followingUser.id)
                               ));
                }
                            )
                        )
                    );
            }

            return(new Container(
                       color: CColors.Background,
                       child: content
                       ));
        }
示例#8
0
        public FormLookupItem(IDataFile db)
            : base("LOOKUP ITEM", true)
        {
            FormBorderStyle   = FormBorderStyle.None;
            AutoScaleBaseSize = new Size(5, 13);
            ClientSize        = new Size(800, 400);

            string dbNameCurrent = "Test";
            int    selectTop     = 100;

            string[] OpString = "Equals,NotEquals,Contains,StartsWith,EndsWith".Split(',');
            string[] OpNumber = "Equals,NotEquals,Contains,GreaterThan,LessThan,GreaterThanOrEqual,LessThanOrEqual".Split(',');

            var info = db.GetInfoSelectTop(dbNameCurrent, selectTop);

            if (info != null)
            {
                #region [ === CREATE NEW TAB PAGE === ]

                PanelCustom page = new PanelCustom(info.Fields)
                {
                    Dock = DockStyle.Fill, BackColor = Color.White,
                };

                int hi = (((info.Fields.Length / 3) + 1) * 25);
                if (info.Fields.Length < 4)
                {
                    hi = 50;
                }
                FlowLayoutPanel boi_Filter = new FlowLayoutPanel()
                {
                    Dock = DockStyle.Top, Height = hi, AutoScroll = false, Padding = new Padding(0), BackColor = App.ColorBg
                };
                boi_Filter.FlowDirection = FlowDirection.LeftToRight;
                boi_Filter.MouseDown    += FormMove_MouseDown;

                Label lbl_Keyword = new Label()
                {
                    Width = 60, AutoSize = false, Text = "Search ", ForeColor = Color.White, TextAlign = ContentAlignment.MiddleRight
                };
                TextBox txt_Keyword = new TextBox()
                {
                    Width = 166, BorderStyle = BorderStyle.FixedSingle
                };
                Label sp0 = new Label()
                {
                    Text = "", AutoSize = false, Width = App.Width, Height = 1,
                };
                boi_Filter.Controls.AddRange(new Control[] {
                    lbl_Keyword,
                    txt_Keyword,
                    sp0
                });

                StringBuilder wh_Contain = new StringBuilder();
                for (int k = 0; k < info.Fields.Length; k++)
                {
                    var dp = info.Fields[k];
                    wh_Contain.Append(dp.NAME + (dp.Type.Name == "String" ? string.Empty : ".ToString()") + ".Contains(@0) ");
                    if (k < info.Fields.Length - 1)
                    {
                        wh_Contain.Append(" || ");
                    }

                    Label lbl = new Label()
                    {
                        Name = "lbl" + k.ToString(), Text = dp.NAME, AutoSize = false, Width = 60, ForeColor = Color.White, TextAlign = ContentAlignment.MiddleRight
                    };
                    ComboBox cbo = new ComboBox()
                    {
                        Name = "cbo" + k.ToString(), Width = 80, DropDownStyle = ComboBoxStyle.DropDownList,
                    };
                    if (dp.Type.Name == "String")
                    {
                        for (int ki = 0; ki < OpString.Length; ki++)
                        {
                            cbo.Items.Add(OpString[ki]);
                        }
                    }
                    else
                    {
                        for (int ki = 0; ki < OpNumber.Length; ki++)
                        {
                            cbo.Items.Add(OpNumber[ki]);
                        }
                    }
                    TextBox txt = new TextBox()
                    {
                        Name = "txt" + k.ToString(), Width = 80, BorderStyle = BorderStyle.FixedSingle
                    };
                    boi_Filter.Controls.AddRange(new Control[] {
                        lbl,
                        cbo,
                        txt,
                    });

                    if (k != 0 && k % 3 == 0)
                    {
                        Label sp = new Label()
                        {
                            Text = "", AutoSize = false, Width = App.Width, Height = 1,
                        };
                        boi_Filter.Controls.Add(sp);
                    }
                }//end for fields

                Panel boi_Action = new Panel()
                {
                    Dock = DockStyle.Top, Height = 27, AutoScroll = false, Padding = new Padding(0, 5, 10, 3), BackColor = App.ColorBg
                };
                boi_Action.MouseDown += FormMove_MouseDown;

                Label lbl_TotalRecord = new Label()
                {
                    Dock = DockStyle.Left, Text = "Records: " + info.DataSelectTop.Count.ToString() + " / " + info.TotalRecord.ToString() + " ", AutoSize = false, Width = 199, Padding = new Padding(0), Font = new Font(new FontFamily("Arial"), 8F, FontStyle.Regular), ForeColor = Color.WhiteSmoke, TextAlign = ContentAlignment.BottomLeft
                };
                Label lbl_Port = new Label()
                {
                    Dock = DockStyle.Left, Text = "Port HTTP: " + info.PortHTTP.ToString(), AutoSize = false, Width = 110, Padding = new Padding(4, 0, 0, 0), Font = new Font(new FontFamily("Arial"), 8F, FontStyle.Regular), ForeColor = Color.WhiteSmoke, TextAlign = ContentAlignment.BottomLeft
                };
                ButtonCustom btn_Search = new ButtonCustom()
                {
                    Text = "search", Dock = DockStyle.Right, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = Color.Gray, ForeColor = Color.White,
                };
                ButtonCustom btn_PagePrev = new ButtonCustom()
                {
                    Text = "<<<", Dock = DockStyle.Right, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = App.ColorBg, ForeColor = Color.White,
                };
                ButtonCustom btn_PageNext = new ButtonCustom()
                {
                    Text = ">>>", Dock = DockStyle.Right, FlatStyle = System.Windows.Forms.FlatStyle.Flat, Width = 80, TextAlign = System.Drawing.ContentAlignment.MiddleCenter, BackColor = App.ColorBg, ForeColor = Color.White,
                };
                Label spa = new Label()
                {
                    Text = "", AutoSize = false, Width = App.Width, Height = 1,
                };
                Label lbl_PageCurrent = new Label()
                {
                    Text = "1", Dock = DockStyle.Right, AutoSize = false, Width = 30, ForeColor = Color.White, TextAlign = ContentAlignment.MiddleCenter
                };
                Label lbl_PageSP = new Label()
                {
                    Text = " | ", Dock = DockStyle.Right, AutoSize = false, Width = 30, ForeColor = Color.White, TextAlign = ContentAlignment.MiddleCenter
                };
                Label lbl_PageTotal = new Label()
                {
                    Text = "1", Dock = DockStyle.Right, AutoSize = false, Width = 30, ForeColor = Color.White, TextAlign = ContentAlignment.MiddleCenter
                };
                lbl_PageTotal.Text = ((int)(info.TotalRecord / selectTop) + (info.TotalRecord % selectTop == 0 ? 0 : 1)).ToString();

                boi_Action.Controls.AddRange(new Control[] {
                    lbl_TotalRecord,
                    lbl_Port,
                    btn_PagePrev,
                    lbl_PageCurrent,
                    lbl_PageSP,
                    lbl_PageTotal,
                    btn_PageNext,
                    btn_Search,
                    spa,
                });

                Panel boi_Data = new Panel()
                {
                    Dock = DockStyle.Fill
                };

                CustomScrollbar scrollGrig = new CustomScrollbar()
                {
                    Dock = DockStyle.Right,

                    ActiveBackColor = Color.White,
                    BackColor       = Color.White,

                    LargeChange = 10,
                    Location    = new Point(306, 12),
                    Maximum     = 99,
                    Minimum     = 0,
                    Size        = new Size(13, 303),
                    SmallChange = 1,
                    TabIndex    = 1,
                    ThumbStyle  = CustomScrollbar.ThumbStyleEnum.Auto,
                    Value       = 0,
                    Margin      = new Padding(0),
                    Padding     = new Padding(0),
                };
                //ScrollbarStyleHelper.ApplyStyle(scrollGrig, ScrollbarStyleHelper.StyleTypeEnum.Blue);
                //ScrollbarStyleHelper.ApplyStyle(scrollGrig, ScrollbarStyleHelper.StyleTypeEnum.Black);

                CustomListView grid = new CustomListView()
                {
                    VScrollbar = new ScrollbarCollector(scrollGrig),

                    Dock        = DockStyle.Fill,
                    BackColor   = Color.White,
                    BorderStyle = BorderStyle.None,
                    // Set the view to show details.
                    View = View.Details,
                    // Allow the user to edit item text.
                    //LabelEdit = true,
                    // Allow the user to rearrange columns.
                    //AllowColumnReorder = true,
                    // Select the item and subitems when selection is made.
                    FullRowSelect = true,
                    // Display grid lines.
                    GridLines = true,
                    // Sort the items in the list in ascending order.
                    //Sorting = SortOrder.Ascending,


                    //HeaderStyle = ColumnHeaderStyle.None,
                    //FullRowSelect = true,
                    //HideSelection = false,
                    Location    = new Point(12, 12),
                    MultiSelect = false,
                    Size        = new Size(288, 303),
                    UseCompatibleStateImageBehavior = false,
                    //View = View.Details,
                    HeaderStyle = ColumnHeaderStyle.Nonclickable,
                };;
                grid.SetDataBinding(info.Fields, info.DataSelectTop);

                boi_Data.Controls.AddRange(new Control[] {
                    grid,
                    scrollGrig,
                });

                page.Controls.AddRange(new Control[] {
                    boi_Filter,
                    boi_Action,
                    boi_Data,
                });

                this.Controls.Add(page);
                boi_Filter.BringToFront();
                boi_Action.BringToFront();
                //grid.BringToFront();
                boi_Data.BringToFront();

                PanelHeader_SendToBack();

                #endregion

                //////////////////////////////////////////////////

                #region [ === PREV - NEXT === ]

                btn_PageNext.Click += (se, ev) =>
                {
                    SearchRequest sr = page.SearchRequest;
                    SearchResult  rs = page.SearchResult;
                    if (sr == null)
                    {
                        int PageNumber = page.PageCurrent + 1;
                        if (PageNumber > int.Parse(lbl_PageTotal.Text))
                        {
                            return;
                        }

                        page.PageCurrent     = PageNumber;
                        lbl_PageCurrent.Text = page.PageCurrent.ToString();
                        grid.SetDataBinding(info.Fields, db.GetSelectPage(dbNameCurrent, PageNumber, selectTop));
                    }
                    else
                    {
                        sr.PageNumber = sr.PageNumber + 1;
                        if (sr.PageNumber > int.Parse(lbl_PageTotal.Text))
                        {
                            return;
                        }

                        rs = db.Search(dbNameCurrent, sr);

                        page.SearchRequest = sr;
                        page.SearchResult  = rs;

                        if (rs != null)
                        {
                            page.PageCurrent     = rs.PageNumber;
                            lbl_PageCurrent.Text = page.PageCurrent.ToString();
                            lbl_TotalRecord.Text = "Records: " + rs.IDs.Length.ToString() + " / " + info.TotalRecord.ToString() + " ";
                            grid.SetDataBinding(info.Fields, (IList)rs.Message);
                        }
                    }
                };

                btn_PagePrev.Click += (se, ev) =>
                {
                    SearchRequest sr = page.SearchRequest;
                    SearchResult  rs = page.SearchResult;
                    if (sr == null)
                    {
                        int PageNumber = page.PageCurrent - 1;
                        if (PageNumber == 0)
                        {
                            return;
                        }

                        page.PageCurrent     = PageNumber;
                        lbl_PageCurrent.Text = page.PageCurrent.ToString();
                        grid.SetDataBinding(info.Fields, db.GetSelectPage(dbNameCurrent, PageNumber, selectTop));
                    }
                    else
                    {
                        sr.PageNumber = rs.PageNumber - 1;
                        if (sr.PageNumber == 0)
                        {
                            return;
                        }

                        rs = db.Search(dbNameCurrent, sr);

                        page.SearchRequest = sr;
                        page.SearchResult  = rs;

                        if (rs != null)
                        {
                            page.PageCurrent     = rs.PageNumber;
                            lbl_PageCurrent.Text = page.PageCurrent.ToString();
                            lbl_TotalRecord.Text = "Records: " + rs.IDs.Length.ToString() + " / " + info.TotalRecord.ToString() + " ";
                            grid.SetDataBinding(info.Fields, (IList)rs.Message);
                        }
                    }
                };

                #endregion

                //////////////////////////////////////////////////

                #region [ === SEARCH === ]

                txt_Keyword.KeyDown += (se, ev) =>
                {
                    if (ev.KeyCode == Keys.Enter)
                    {
                        //grid.DataSource = null;

                        string predicate = "", kw = txt_Keyword.Text;
                        if (string.IsNullOrEmpty(kw))
                        {
                            page.SearchRequest = null;
                            page.SearchResult  = null;

                            page.PageCurrent     = 1;
                            lbl_PageCurrent.Text = page.PageCurrent.ToString();
                            int countPage = (int)(info.TotalRecord / selectTop) + (info.TotalRecord % selectTop == 0 ? 0 : 1);
                            lbl_PageTotal.Text   = countPage.ToString();
                            lbl_TotalRecord.Text = "Records: " + info.DataSelectTop.Count.ToString() + " / " + info.TotalRecord.ToString() + " ";
                            grid.SetDataBinding(info.Fields, info.DataSelectTop);
                        }
                        else
                        {
                            List <object> lp = new List <object>();
                            predicate = wh_Contain.ToString();
                            lp.Add(kw);

                            SearchRequest sr = new SearchRequest(selectTop, 1, predicate, lp.Count == 0 ? null : lp.ToArray());
                            SearchResult  rs = db.Search(dbNameCurrent, sr);

                            page.SearchRequest = sr;
                            page.SearchResult  = rs;

                            if (rs != null)
                            {
                                page.PageCurrent     = rs.PageNumber;
                                lbl_PageCurrent.Text = page.PageCurrent.ToString();
                                int countPage = (int)(rs.Total / selectTop) + (rs.Total % selectTop == 0 ? 0 : 1);
                                lbl_PageTotal.Text   = countPage.ToString();
                                lbl_TotalRecord.Text = "Records: " + rs.IDs.Length.ToString() + " / " + info.TotalRecord.ToString() + " ";
                                grid.SetDataBinding(info.Fields, (IList)rs.Message);
                            }
                        }
                    }
                };

                btn_Search.Click += (se, ev) =>
                {
                    //grid.DataSource = null;

                    string predicate = "", kw = txt_Keyword.Text;
                    if (string.IsNullOrEmpty(kw))
                    {
                        page.SearchRequest = null;
                        page.SearchResult  = null;

                        page.PageCurrent     = 1;
                        lbl_PageCurrent.Text = page.PageCurrent.ToString();
                        int countPage = (int)(info.TotalRecord / selectTop) + (info.TotalRecord % selectTop == 0 ? 0 : 1);
                        lbl_PageTotal.Text   = countPage.ToString();
                        lbl_TotalRecord.Text = "Records: " + info.DataSelectTop.Count.ToString() + " / " + info.TotalRecord.ToString() + " ";
                        grid.SetDataBinding(info.Fields, info.DataSelectTop);
                    }
                    else
                    {
                        List <object> lp = new List <object>();
                        predicate = wh_Contain.ToString();
                        lp.Add(kw);

                        SearchRequest sr = new SearchRequest(selectTop, 1, predicate, lp.Count == 0 ? null : lp.ToArray());
                        SearchResult  rs = db.Search(dbNameCurrent, sr);

                        page.SearchRequest = sr;
                        page.SearchResult  = rs;

                        if (rs != null)
                        {
                            page.PageCurrent     = rs.PageNumber;
                            lbl_PageCurrent.Text = page.PageCurrent.ToString();
                            int countPage = (int)(rs.Total / selectTop) + (rs.Total % selectTop == 0 ? 0 : 1);
                            lbl_PageTotal.Text   = countPage.ToString();
                            lbl_TotalRecord.Text = "Records: " + rs.IDs.Length.ToString() + " / " + info.TotalRecord.ToString() + " ";
                            grid.SetDataBinding(info.Fields, (IList)rs.Message);
                        }
                    }
                };

                #endregion
            }//end bind info Model
        }