예제 #1
0
        public MainPage()
        {
            Page mePage, gamePage, scorePage, charPage, invPage, monsterPage,
                 gameitemsPage, battlePage = null;

            switch (Device.RuntimePlatform)
            {
            case Device.iOS:
                mePage = new NavigationPage(new MePage())
                {
                    Title = "Information"
                };
                gamePage = new NavigationPage(new GamePage())
                {
                    Title = "Game"
                };
                scorePage = new NavigationPage(new ScorePage())
                {
                    Title = "Score"
                };
                charPage = new NavigationPage(new CharacterPage())
                {
                    Title = "Character"
                };

                invPage = new NavigationPage(new InventoryPage())
                {
                    Title = "Inventory"
                };
                monsterPage = new NavigationPage(new MonstersPage())
                {
                    Title = "Monsters"
                };
                gameitemsPage = new NavigationPage(new GameItemsPage())
                {
                    Title = "Items"
                };
                battlePage = new NavigationPage(new BattlePage())
                {
                    Title = "Battle"
                };

                mePage.Icon        = "tab_about.png";
                gamePage.Icon      = "tab_feed.png";
                scorePage.Icon     = "tab_feed.png";
                charPage.Icon      = "tab_about.png";
                invPage.Icon       = "tab_about.png";
                monsterPage.Icon   = "tab_about.png";
                gameitemsPage.Icon = "tab_about.png";
                battlePage.Icon    = "tab_about.png";
                //itemsPage.Icon = "tab_feed.png";
                //aboutPage.Icon = "tab_about.png";
                break;

            default:
                mePage = new MePage()
                {
                    Title = "Me"
                };
                gamePage = new GamePage()
                {
                    Title = "Game"
                };
                scorePage = new ScorePage()
                {
                    Title = "Score"
                };
                charPage = new CharacterPage()
                {
                    Title = "Character"
                };
                invPage = new InventoryPage()
                {
                    Title = "Inventory"
                };
                monsterPage = new MonstersPage()
                {
                    Title = "Monsters"
                };
                gameitemsPage = new GameItemsPage()
                {
                    Title = "Items"
                };
                battlePage = new BattlePage()
                {
                    Title = "Battle"
                };


                break;
            }
            Children.Add(mePage);
            Children.Add(gamePage);
            Children.Add(scorePage);
            Children.Add(charPage);
            Children.Add(invPage);
            Children.Add(monsterPage);
            Children.Add(gameitemsPage);
            Children.Add(battlePage);

            Title = Children[0].Title;
        }
예제 #2
0
        protected override void OnLoadRecord()
        {
            Database db = LogicContext.GetDatabase();
            DataSet  ds = db.OpenDataSet(this.BuildTopHSQL());

            foreach (string item in this.ColumnSwitchToName)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    ds.Tables[0].Rows[i][item] = base.GetWfUsersName(ds.Tables[0].Rows[i][item].ToString());
                }
            }
            for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
            {
                int           openAmid      = ds.Tables[0].Rows[j]["OPENAMID"].ToString().ToInt();
                MePage        mePage        = MePageUtils.GetMePage(openAmid);
                PageParameter pageParameter = new PageParameter();
                bool          flag          = mePage != null;
                if (flag)
                {
                    pageParameter.UrlPath = this.Page.ResolveUrl(mePage.PageUrl);
                    bool flag2 = mePage.Type == ModuleType.W;
                    if (flag2)
                    {
                        pageParameter.AddString("WFID", ds.Tables[0].Rows[j]["WFID"].ToString().Trim());
                        pageParameter.AddString("WFRUNID", ds.Tables[0].Rows[j]["WFRUNID"].ToString().Trim());
                    }
                    else
                    {
                        bool flag3 = mePage.Type == ModuleType.N;
                        if (flag3)
                        {
                            string keyWhere = ds.Tables[0].Rows[j]["KEYWHERE"].ToString().Trim();
                            pageParameter.AddNameValueString(new NameValueString
                            {
                                NaviteText = keyWhere
                            });
                        }
                    }
                    ds.Tables[0].Rows[j]["PAGEURL"] = pageParameter.CombineUrl();
                }
            }
            IsoDateTimeConverter iso = new IsoDateTimeConverter();

            iso.DateTimeFormat = "yyyy-MM-dd";
            string jsonData = JsonConvert.SerializeObject(ds.Tables[0], new JsonConverter[]
            {
                new DataTableConverter(),
                iso
            });
            StringBuilder sb = new StringBuilder();

            sb.Append("var $maingrid;");
            sb.Append("$(function () {");
            sb.Append("$maingrid = $('#templetGridPanel').ligerGrid({");
            sb.Append("columns: [");
            foreach (TimBoundField item2 in this.Columns)
            {
                sb.Append(string.Concat(new string[]
                {
                    "{ display: '",
                    item2.HeaderText,
                    "', name: '",
                    item2.DataField,
                    "', align: 'left', width: ",
                    item2.ItemStyle.Width.Value.ToString(),
                    " },"
                }));
            }
            sb.Append("{ display: '', name: 'PAGEURL', align: 'left', width: 1, hide: true }");
            sb.Append("],");
            sb.Append("data:{ Rows:" + jsonData + "},");
            sb.Append("height:'99%',");
            sb.Append("rowHeight:22,");
            sb.Append("headerRowHeight:23,");
            sb.Append("enabledSort: false,");
            sb.Append("allowAdjustColWidth:false,");
            sb.Append("frozenCheckbox:true,");
            sb.Append("usePager: false,");
            sb.Append("onDblClickRow: function (data, rowindex, rowobj) {");
            sb.Append("OpenPage('VIEW',data.PAGEURL);");
            sb.Append("}");
            sb.Append("});");
            sb.Append("});");
            base.RegisterScript("disGridPanel", sb.ToString());
            base.RegisterScript("PortalPanelRefresh", "function panelRefresh(){window.location.href = window.location.href;}; window.setTimeout('panelRefresh()',600000);");
        }