public void InsertAt(int index, ResearchTeam team)
        {
            if (index <= 0 || index > _list.Count())
            {
                _list.Add(team);
            }
            else
            {
                _list.Add(team);
                for (int i = 1; i < _list.Count() - 1 - index; ++i)
                {
                    _list[_list.Count() - i] = _list[_list.Count() - 1 - i];
                }
                _list[index] = team;
                TeamListHandlerEventArgs argss = new TeamListHandlerEventArgs();
                argss.Name  = "Inserted";
                argss.Info  = "ResearchTeam inserted";
                argss.Index = index;
                if (ResearchTeamInserted != null)
                {
                    ResearchTeamInserted(this, argss);
                }
            }

            TeamListHandlerEventArgs args = new TeamListHandlerEventArgs();

            args.Name  = "Inserted";
            args.Info  = "ResearchTeam added";
            args.Index = index;
            if (ResearchTeamAdded != null)
            {
                ResearchTeamAdded(this, args);
            }
        }
Пример #2
0
        public void Handler(object source, TeamListHandlerEventArgs args)
        {
            TeamsJournalEntry e = new TeamsJournalEntry();

            e.CollectionName = args.Info;
            e.EventName      = args.Name;
            e.Number         = args.Index;
            _list.Add(e);
        }
        public void AddDefaults()
        {
            if (_list != null)
            {
                _list.Add(new ResearchTeam());
            }
            else
            {
                _list = new System.Collections.Generic.List <ResearchTeam>(4);
                _list.Add(new ResearchTeam());
            }
            TeamListHandlerEventArgs args = new TeamListHandlerEventArgs();

            args.Name  = "AddDef";
            args.Info  = "ResearchTeam addDef";
            args.Index = 0;
            if (ResearchTeamAdded != null)
            {
                ResearchTeamAdded(this, args);
            }
        }
        public void AddResearchTeams(params ResearchTeam[] teams)
        {
            TeamListHandlerEventArgs args = new TeamListHandlerEventArgs();

            args.Name  = "Added range";
            args.Info  = "ResearchTeam addedTeams";
            args.Index = _list.Count();
            if (ResearchTeamAdded != null)
            {
                ResearchTeamAdded(this, args);
            }

            if (_list != null)
            {
                _list.AddRange(teams);
            }
            else
            {
                _list = new System.Collections.Generic.List <ResearchTeam>(4);
                _list.AddRange(teams);
            }
        }