private void AddPursuitUnits()
 {
     list_unit.Clear();
     list_unit.AddRow("Local Patrol Unit");
     list_unit.AddRow("State Patrol Unit");
     list_unit.AddRow("Local SWAT Team");
     list_unit.AddRow("NOOSE SWAT Team");
     list_unit.AddRow("Local Air Support Unit");
     list_unit.AddRow("NOOSE Air Support Unit");
     list_unit.AddRow("FIB Air Support Unit");
 }
Beispiel #2
0
        private void AddPursuitUnits()
        {
            list_unit.Clear();

            list_unit.AddRow("Local Patrol Unit", "localPatrol", EBackupUnitType.LocalUnit);
            list_unit.AddRow("State Patrol Unit", "statePatrol", EBackupUnitType.StateUnit);
            list_unit.AddRow("Local SWAT Team", "localSwat", EBackupUnitType.SwatTeam);
            list_unit.AddRow("NOOSE SWAT Team", "nooseSwat", EBackupUnitType.NooseTeam);
            list_unit.AddRow("Local Air Support Unit", "localAir", EBackupUnitType.AirUnit);
            list_unit.AddRow("NOOSE Air Support Unit", "nooseAir", EBackupUnitType.NooseAirUnit);
            list_unit.SelectRow(0);
        }
        public void PopulateManualSearchPedsList()
        {
            ComputerPedController controller = ComputerPedController.Instance;

            list_collected_ids.Clear();
            var results = controller.GetRecentSearches()
                          .Where(x => x.Validate()).ToList();

            //@TODO choose if we want to remove null items from the list -- may cause user confusion
            if (results != null && results.Count > 0)
            {
                results.ForEach(x => list_manual_results.AddPed(x));
            }
        }
Beispiel #4
0
        protected override void enable()
        {
            groupsList.Clear();
            groupsList.Lock();
            foreach (var groupEntry in level.GroupedEntities)
            {
                addGroup(groupEntry.Key, groupEntry.Value);
            }
            groupsList.Unlock();

            entitiesList.Clear();

            listsPanel.Visible = true;
        }
Beispiel #5
0
        static public void RenewProjects()
        {
            ProjectList.Clear();
            string[] filelist;
            string   workspace = MainClass.GetConfig("WORKSPACE");

            if (workspace == "")
            {
                QuickGTK.Error("I don't know where to look for projects! Please use the command GLOBALCONFIG WORKSPACE=/home/username/MyWorkSpace/ or something like that");
                return;
            }
            try
            {
                filelist = FileList.GetDir(workspace + "/Projects", 0, true, false);
            }
            catch
            {
                QuickGTK.Error("Reading the project folder failed! Has it been properly configured?");
                return;
            }
            foreach (string f in filelist)
            {
                if (qstr.Suffixed(f, ".prj"))
                {
                    ProjectList.AddItem(qstr.Left(f, f.Length - 4));
                }
            }
        }
        private void PopulateAllyList()
        {
            m_AllyListBox.Clear();

            // Populate ally list
            for (int i = 0; i < m_Allies.Count; ++i)
            {
                ListBoxItem item = ListBoxItem.Create(m_AllyListPrefab, "Player " + (m_Allies[i] + 1));
                item.userData = i;
                m_AllyListBox.AddItem(item);
            }

            // Fill ally dropdown with unallied players
            List <string> unalliedPlayers = new List <string>();

            foreach (PlayerData player in UserData.current.selectedVariant.players)
            {
                if (m_Allies.Contains(player.id))
                {
                    continue;
                }
                if (m_SelectedPlayer.id == player.id)
                {
                    continue;
                }

                unalliedPlayers.Add("Player " + (player.id + 1).ToString());
            }

            m_DropdownAlly.ClearOptions();
            m_DropdownAlly.AddOptions(unalliedPlayers);
            m_DropdownAlly.interactable = m_DropdownAlly.options.Count > 0;

            m_BtnAddAlly.interactable = m_DropdownAlly.options.Count > 0;
        }
        private void PopulateCompletedTechList()
        {
            m_CompletedTechListBox.Clear();

            // Populate completed tech list
            for (int i = 0; i < m_CompletedTech.Count; ++i)
            {
                ListBoxItem item = ListBoxItem.Create(m_CompletedTechListPrefab, m_CompletedTech[i] + " - " + m_TechNames[m_CompletedTech[i]]);
                item.userData = i;
                m_CompletedTechListBox.AddItem(item);
            }

            // Fill completed tech dropdown with incomplete tech
            List <string> incompleteTech = new List <string>();

            for (int i = 0; i < m_TechIds.Count; ++i)
            {
                if (m_CompletedTech.Contains(m_TechIds[i]))
                {
                    continue;
                }

                incompleteTech.Add(m_TechIds[i] + " - " + m_TechNames[m_TechIds[i]]);
            }

            m_DropdownCompletedTech.ClearOptions();
            m_DropdownCompletedTech.AddOptions(incompleteTech);
            m_DropdownCompletedTech.interactable = m_DropdownCompletedTech.options.Count > 0;

            m_BtnAddCompletedTech.interactable = m_DropdownCompletedTech.options.Count > 0;
        }
        public void UpdateList()
        {
            //Clear previous instances if already existing
            if (mFriends != null)
            {
                mFriends.Clear();
            }

            foreach (var f in Globals.Me.Friends)
            {
                var row = f.Online ? mFriends.AddRow(f.Name + " - " + f.Map) : mFriends.AddRow(f.Name);
                row.UserData      = f.Name;
                row.Clicked      += friends_Clicked;
                row.RightClicked += friends_RightClicked;

                //Row Render color (red = offline, green = online)
                if (f.Online == true)
                {
                    row.SetTextColor(Color.Green);
                }
                else
                {
                    row.SetTextColor(Color.Red);
                }

                row.RenderColor = new Color(50, 255, 255, 255);
            }
        }
Beispiel #9
0
 private void RecentTextChangedHandler()
 {
     list_recent.Clear();
     foreach (string r in EntryPoint.recent_text.Reverse <String>())
     {
         list_recent.AddRow(r);
     }
 }
Beispiel #10
0
        public void SingleSelect_ModifySelectedItems()
        {
            var items = new ListBox().SelectedItems;

            Assert.Throws <InvalidOperationException> (() => items.Add(1), "#1");
            Assert.Throws <InvalidOperationException> (() => items.Clear(), "#2");
            Assert.Throws <InvalidOperationException> (() => items.Insert(0, 15), "#3");
        }
 private void AddChargesFromReport()
 {
     if (lb_charges == null)
     {
         return;
     }
     lb_charges.Clear();
     Report.Charges.ForEach(AddChargeToListBox);
 }
 internal void ChangeReport(ArrestReport report)
 {
     Report = report;
     if (this.Exists())
     {
         lb_charges.UnselectAll();
         lb_charges.Clear();
         chargesTree.UnselectAll();
         tb_notes.Component.SetText(String.Empty);
         AddReportCharges();
     }
 }
Beispiel #13
0
        public void MultiSelect_ModifySelectedItems_InvalidItems()
        {
            var items = new ListBox {
                SelectionMode = SelectionMode.Multiple
            }.SelectedItems;

            items.Add(1);
            Assert.AreEqual(1, items.Count, "#1");
            items.Clear();
            Assert.AreEqual(0, items.Count, "#2");
            items.Insert(0, 15);
            Assert.AreEqual(1, items.Count, "#3");
        }
Beispiel #14
0
        private void LoadScores()
        {
            _ScoresListBox.Clear();

            // Add scores to list box
            foreach (ColonyGameScoreRecord record in ColonyGameScores.GetScores())
            {
                string scoreText = record.MissionDescription + ", " + GetDifficultyString(record.Difficulty) + ", " + record.GameTime.ToString("D7");
                scoreText += ", " + record.PlayerName + ", " + record.WinDate.ToString("M-d-yyyy");

                _ScoresListBox.AddItem(scoreText);
            }
        }
Beispiel #15
0
        public void SingleSelect_ModifySelectedItems_ChangedAnyway()
        {
            var items = new ListBox().SelectedItems;

            Assert.Throws <InvalidOperationException> (() => items.Add(1), "#1");
            Assert.AreEqual(1, items.Count, "#2");

            Assert.Throws <InvalidOperationException> (() => items.Clear(), "#3");
            Assert.AreEqual(0, items.Count, "#4");

            Assert.Throws <InvalidOperationException> (() => items.Insert(0, 15), "#5");
            Assert.AreEqual(1, items.Count, "#6");
        }
Beispiel #16
0
 static public void UpdateTags()
 {
     TagList.Clear();
     if (CurrentProject == null)
     {
         return;
     }
     CurrentProject.Data.List("Tags").Sort();
     foreach (string tag in CurrentProject.Data.List("Tags"))
     {
         if (tag.Trim() != "")
         {
             TagList.AddItem(tag.Trim());
         }
     }
 }
        private void PluginSelected(PluginListBoxItem pluginListBoxItem)
        {
            foreach (var plugin in PluginsListBox.Select(lbi => (PluginListBoxItem)lbi))
            {
                plugin.HideDescription();
            }

            _selectedPlugin = pluginListBoxItem;
            _selectedPlugin.ShowDescription();
            SettingsGenerator.Generate(_selectedPlugin.Plugin.Settings);

            HistoryListBox.Clear();
            foreach (var settings in _selectedPlugin.Plugin.SettingsHistory.Recent)
            {
                var item = (RecentSettingsListBoxItem)HistoryListBox.Add();
                item.Data = settings;
            }
        }
Beispiel #18
0
        private void UpdateCamerasListBox()
        {
            camerasListBox.Clear();

            camerasListBox.AddRow("Gameplay camera", "gameplayCam", null);

            foreach (var(cameraValue, index) in Scenario.CameraSettings.Cameras.WithIndex())
            {
                string rowLabel = $"Camera {index}";
                string rowName  = $"camera{index}";
                camerasListBox.AddRow(rowLabel, rowName, cameraValue);
            }

            if (camerasListBox.RowCount == 0)
            {
                deleteCameraButton.Disable();
                viewCameraButton.Disable();
            }
        }
Beispiel #19
0
 public void PopulateStoppedPedsList()
 {
     try
     {
         ComputerPedController controller = ComputerPedController.Instance;
         var peds = controller.PedsCurrentlyStoppedByPlayer;
         list_collected_ids.Clear();
         foreach (var entity in peds.Select(x => controller.LookupPersona(x)))
         {
             if (entity != null)
             {
                 list_collected_ids.AddPed(entity);
                 ComputerReportsController.generateRandomHistory(entity);
             }
         }
     }
     catch (Exception e)
     {
         Function.Log(e.ToString());
     }
 }
        private void PopulatePlayerList()
        {
            int selectedIndex = m_PlayerListBox.selectedIndex;

            m_PlayerListBox.Clear();

            for (int i = 0; i < UserData.current.selectedVariant.players.Count; ++i)
            {
                ListBoxItem item = ListBoxItem.Create(m_PlayerListPrefab, "Player " + (i + 1));
                item.userData = UserData.current.selectedVariant.players[i];
                m_PlayerListBox.AddItem(item);
            }

            m_PlayerListBox.selectedIndex = selectedIndex;

            // Can't have more than 6 players in the game
            if (UserData.current.selectedVariant.players.Count >= 6)
            {
                m_BtnAddPlayer.interactable = false;
            }
        }
Beispiel #21
0
 private void PopulateListBoxFromReport()
 {
     if (Report == null || Report.AdditionalParties == null)
     {
         return;
     }
     else if (lb_additional_parties == null)
     {
         Function.Log("Cannot populate lb that is null");
     }
     else
     {
         lb_additional_parties.Clear();
         var parties = Report.AdditionalParties.ToArray();
         if (parties.Length > 0)
         {
             AddAdditionalPartyToListBox(parties);
             lb_additional_parties.SelectRow(0, true);
             PopulateFieldsFromParty(parties[0]);
         }
     }
 }
Beispiel #22
0
        public void UpdateList()
        {
            //Clear previous instances if already existing
            if (mGuildMembers != null)
            {
                mGuildMembers.Clear();
            }

            foreach (var f in Globals.Me.GuildMembers)
            {
                var str = f.Online ? Strings.Guilds.OnlineListEntry : Strings.Guilds.OfflineListEntry;
                var row = mGuildMembers.AddRow(str.ToString(Options.Instance.Guild.Ranks[f.Rank].Title, f.Name, f.Map));
                row.Name = "GuildMemberRow";
                row.LoadJsonUi(GameContentManager.UI.InGame, Graphics.Renderer.GetResolutionString());
                row.SetToolTipText(Strings.Guilds.Tooltip.ToString(f.Level, f.Class));
                row.UserData      = f;
                row.Clicked      += member_Clicked;
                row.RightClicked += member_RightClicked;

                //Row Render color (red = offline, green = online)
                if (f.Online == true)
                {
                    row.SetTextColor(Color.Green);
                }
                else
                {
                    row.SetTextColor(Color.Red);
                }

                row.RenderColor = new Color(50, 255, 255, 255);
            }

            //Determine if we can invite
            mAddButton.IsHidden        = Globals.Me == null || Globals.Me.GuildRank == null || !Globals.Me.GuildRank.Permissions.Invite || !mAddButtonUsed;
            mTextboxContainer.IsHidden = Globals.Me == null || Globals.Me.GuildRank == null || !Globals.Me.GuildRank.Permissions.Invite || !mAddButtonUsed;
            mAddPopupButton.IsHidden   = Globals.Me == null || Globals.Me.GuildRank == null || !Globals.Me.GuildRank.Permissions.Invite || !mAddPopupButtonUsed;
            mLeave.IsHidden            = Globals.Me != null && Globals.Me.Rank == 0;
        }
Beispiel #23
0
        private void UpdateItemList()
        {
            m_Items.Clear();

            IOrderedEnumerable <IFileSystemDirectoryInfo> directories;
            IOrderedEnumerable <IFileSystemFileInfo>      files = null;

            try
            {
                directories = GetDirectories(m_CurrentFolder).OrderBy(di => di.Name);
                if (!m_FoldersOnly)
                {
                    files = GetFiles(m_CurrentFolder, m_CurrentFilter).OrderBy(fi => fi.Name);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(View, ex.Message, Title, MessageBoxButtons.OK);
                return;
            }

            foreach (IFileSystemDirectoryInfo di in directories)
            {
                ListBoxRow row = m_Items.AddRow(di.Name, null, di.FullName);
                row.SetCellText(1, "<dir>");
                row.SetCellText(2, di.FormattedLastWriteTime);
            }

            if (!m_FoldersOnly)
            {
                foreach (IFileSystemFileInfo fi in files)
                {
                    ListBoxRow row = m_Items.AddRow(fi.Name, null, fi.FullName);
                    row.SetCellText(1, fi.FormattedFileLength);
                    row.SetCellText(2, fi.FormattedFileLength);
                }
            }
        }
Beispiel #24
0
        ///////////////////////////////////////////////
        ///Memory and closing functions.
        ///////////////////////////////////////////////

        /// <summary>
        /// Releases input file and calls garbage collector.
        /// </summary>
        private void Cleanup()
        {
            FilterStartButton.Enabled = false;
            try
            {
                //Garbage collector.
                GC.Collect();
                GC.WaitForPendingFinalizers();

                //Original file cleanup
                Marshal.ReleaseComObject(input.fullRange);
                Marshal.ReleaseComObject(input.currentSheet);
                input.currentWorkbook.Close();
                Marshal.ReleaseComObject(input.currentWorkbook);
                DataTextBox.Clear();
                ListBox.Clear();
                IsFileLoaded = false;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: No hay documento para cerrar.");
            }
        }
        private void AddReportsToList(bool clearPrevious = true, bool selectFirstElementInList = false)
        {
            if (Reports == null)
            {
                return;
            }
            if (clearPrevious)
            {
                list.Clear();
            }

            foreach (var report in Reports)
            {
                try
                {
                    var row = list.AddRow(String.Empty, report.Id(), report);
                    OnRenderRowText(report, row);
                    if (ListClickStyle == ListItemClickType.DOUBLE)
                    {
                        row.DoubleClicked += RowClicked;
                    }
                    else
                    {
                        row.Clicked += RowClicked;
                    }
                }
                catch (Exception e)
                {
                    Function.Log(e.ToString());
                    throw e;
                }
            }
            if (selectFirstElementInList)
            {
                list.SelectRow(0, true);
            }
        }
        private void UpdatePedsInListBox()
        {
            lb_allParties.Clear();
            if (Report == null)
            {
                return;
            }

            var filter  = (ArrestReportAdditionalParty.PartyTypes) this.RightDock.TabControl.CurrentButton.UserData;
            var parties = filter == ArrestReportAdditionalParty.PartyTypes.UNKNOWN ? Report.AdditionalParties.ToArray() : Report.AdditionalParties.Where(x => x.PartyType == filter).ToArray();

            if (filter == ArrestReportAdditionalParty.PartyTypes.UNKNOWN)
            {
                //Add the Arrestee to the "All" list
                if (!String.IsNullOrWhiteSpace(Report.FullName))
                {
                    lb_allParties.AddRow(Report.FullName, Report.Id(), Report);
                }
            }
            foreach (var party in parties)
            {
                lb_allParties.AddRow(party.FullName, party.Id(), party);
            }
        }
Beispiel #27
0
        private void LoadMissions()
        {
            _MissionListBox.Clear();

            // Read missions in "ColonyGames" directory
            if (!Directory.Exists("ColonyGames"))
            {
                return;
            }

            // Add missions to list box
            foreach (string file in Directory.EnumerateFiles("ColonyGames", "*.opm", SearchOption.AllDirectories))
            {
                try
                {
                    MissionRoot mission = MissionReader.GetMissionData(file);
                    _MissionListBox.AddItem(mission.levelDetails.description, new ListBoxItemContents(file, mission));
                }
                catch (System.Exception ex)
                {
                    Debug.LogException(ex);
                }
            }
        }
Beispiel #28
0
 public void Clear()
 {
     ListBox.Clear();
 }
Beispiel #29
0
 public void ClearSpellFoundList()
 {
     SpellListFoundBox.Clear();
 }
Beispiel #30
0
 public void ClearSpellList()
 {
     SpellListBox.Clear();
 }