示例#1
0
        private void FillBattle(Ruler ruler, ItemsTable table, string tableTitle, Chronos.Battle.BattleType type)
        {
            table.Title         = tableTitle;
            table.TitleCssClass = "planetInfoZoneTitle";
            table.TableCssClass = "planetFrame";

            CreateTitle(table);

            if (ruler == null)
            {
                NoBattle(table, 6);
                return;
            }

            ICollection collection = ruler.GetAllBattles(type);

            if (collection.Count == 0)
            {
                NoBattle(table, 6);
                return;
            }

            IEnumerator iter = collection.GetEnumerator( );

            while (iter.MoveNext( ))
            {
                ItemsTableLine line = new ItemsTableLine();

                SimpleBattleInfo bInfo = (SimpleBattleInfo)iter.Current;

                ItemsTableText id    = new ItemsTableText(bInfo.BattleId.ToString(), "resource");
                ItemsTableText enemy = new ItemsTableText(OrionGlobals.getLink(bInfo.Enemy), "resource");

                ItemsTableLink link = new ItemsTableLink(
                    info.getContent("battleAdminUser_viewBattle"),
                    OrionGlobals.calculatePath(string.Format("battle.aspx?id={0}&rulerid={1}", bInfo.BattleId, ruler.Id)),
                    "resource"
                    );

                ItemsTableLinkButton linkButton1 = new ItemsTableLinkButton(bInfo.Owner.Name);
                linkButton1.Click += new EventHandler(linkButton1_Click);

                ItemsTableLinkButton linkButton2 = new ItemsTableLinkButton(bInfo.Enemy.Name);
                linkButton2.Click += new EventHandler(linkButton2_Click);

                ItemsTableImageButton remove = new ItemsTableImageButton(OrionGlobals.getCommonImagePath("remove.gif"), "battle_" + bInfo.BattleId);
                remove.Click += new ImageClickEventHandler(remove_Click);

                line.add(id);
                line.add(enemy);
                line.add(link);
                line.add(linkButton1);
                line.add(linkButton2);
                line.add(remove);

                table.addLine(line);
            }

            this.Controls.Add(table);
        }
示例#2
0
        private void CreateUnits()
        {
            itemsTable.Title         = info.getContent("cancelBattle_acceptReject");
            itemsTable.TitleCssClass = "planetInfoZoneTitle";
            itemsTable.TableCssClass = "planetFrame";

            createTitle(itemsTable);

            ICollection battles = _ruler.GetAllBattles(BattleType.FRIENDLY);

            foreach (SimpleBattleInfo battleInfo in battles)
            {
                if (battleInfo.Accepted)
                {
                    continue;
                }

                ItemsTableLine line = new ItemsTableLine();

                ItemsTableText id    = new ItemsTableText(battleInfo.BattleId.ToString(), "resource");
                ItemsTableText ruler = new ItemsTableText(OrionGlobals.getLink(battleInfo.Enemy), "resource");

                ItemsTableLink view = new ItemsTableLink(
                    info.getContent("currentBattle_viewBattle"),
                    OrionGlobals.calculatePath("battle.aspx?id=" + battleInfo.BattleId),
                    "resource"
                    );

                ItemsTableImageButton accept = new ItemsTableImageButton(OrionGlobals.getCommonImagePath("ok.gif"), "accept_" + battleInfo.BattleId);
                accept.Click += new ImageClickEventHandler(Accept_Click);

                ItemsTableImageButton reject = new ItemsTableImageButton(OrionGlobals.getCommonImagePath("remove.gif"), "reject_" + battleInfo.BattleId);
                reject.Click += new ImageClickEventHandler(Reject_Click);

                line.add(id);
                line.add(ruler);
                line.add(view);
                line.add(accept);
                line.add(reject);

                itemsTable.addLine(line);
            }
        }
示例#3
0
        private void CreateUnits()
        {
            itemsTable.Title = info.getContent("cancelBattle_acceptReject");
            itemsTable.TitleCssClass = "planetInfoZoneTitle";
            itemsTable.TableCssClass = "planetFrame";

            createTitle( itemsTable );

            ICollection battles = _ruler.GetAllBattles(BattleType.FRIENDLY);

            foreach( SimpleBattleInfo battleInfo in battles ) {
                if( battleInfo.Accepted ) {
                    continue;
                }

                ItemsTableLine line = new ItemsTableLine();

                ItemsTableText id = new ItemsTableText( battleInfo.BattleId.ToString(), "resource" );
                ItemsTableText ruler = new ItemsTableText( OrionGlobals.getLink( battleInfo.Enemy ), "resource" );

                ItemsTableLink view = new ItemsTableLink(
                    info.getContent("currentBattle_viewBattle"),
                    OrionGlobals.calculatePath( "battle.aspx?id=" + battleInfo.BattleId ),
                    "resource"
                    );

                ItemsTableImageButton accept = new ItemsTableImageButton( OrionGlobals.getCommonImagePath( "ok.gif"), "accept_" + battleInfo.BattleId );
                accept.Click += new ImageClickEventHandler( Accept_Click );

                ItemsTableImageButton reject = new ItemsTableImageButton( OrionGlobals.getCommonImagePath( "remove.gif"), "reject_" + battleInfo.BattleId );
                reject.Click += new ImageClickEventHandler( Reject_Click );

                line.add( id );
                line.add( ruler );
                line.add( view );
                line.add( accept );
                line.add( reject );

                itemsTable.addLine( line );
            }
        }
示例#4
0
        private void FillBattle( Ruler ruler, ItemsTable table, string tableTitle, Chronos.Battle.BattleType type )
        {
            table.Title = tableTitle;
            table.TitleCssClass = "planetInfoZoneTitle";
            table.TableCssClass = "planetFrame";

            CreateTitle(table);

            if( ruler == null ) {
                NoBattle( table, 6 );
                return;
            }

            ICollection collection = ruler.GetAllBattles( type );

            if( collection.Count == 0 ) {
                NoBattle( table, 6 );
                return;
            }

            IEnumerator iter = collection.GetEnumerator( );

            while( iter.MoveNext( ) ) {
                ItemsTableLine line = new ItemsTableLine();

                SimpleBattleInfo bInfo = (SimpleBattleInfo)iter.Current;

                ItemsTableText id = new ItemsTableText( bInfo.BattleId.ToString(), "resource" );
                ItemsTableText enemy = new ItemsTableText( OrionGlobals.getLink( bInfo.Enemy ), "resource" );

                ItemsTableLink link = new ItemsTableLink(
                        info.getContent( "battleAdminUser_viewBattle" ),
                        OrionGlobals.calculatePath( string.Format("battle.aspx?id={0}&rulerid={1}",bInfo.BattleId,ruler.Id) ),
                        "resource"
                );

                ItemsTableLinkButton linkButton1 = new ItemsTableLinkButton( bInfo.Owner.Name );
                linkButton1.Click += new EventHandler(linkButton1_Click);

                ItemsTableLinkButton linkButton2 = new ItemsTableLinkButton( bInfo.Enemy.Name );
                linkButton2.Click += new EventHandler(linkButton2_Click);

                ItemsTableImageButton remove = new ItemsTableImageButton( OrionGlobals.getCommonImagePath( "remove.gif" ), "battle_" + bInfo.BattleId );
                remove.Click += new ImageClickEventHandler(remove_Click);

                line.add( id );
                line.add( enemy );
                line.add( link );
                line.add( linkButton1 );
                line.add( linkButton2 );
                line.add( remove );

                table.addLine( line );
            }

            this.Controls.Add( table );
        }