Example #1
0
 private void LoadOraclePackage(object obj)
 {
     if (obj is RepositoryObject repositoryObject)
     {
         var repositoryPackage = new RepositoryPackage(repositoryObject);
         pw = new ParserWindow(repositoryPackage);
         pw.Show();
     }
 }
Example #2
0
        public PlayerInfoDlg(ParserWindow parentWin)
        {
            InitializeComponent();

            parentWindow = parentWin;

            // Load information from the database and work with it
            // in a disconnected state.

            if (DatabaseManager.Instance.IsDatabaseOpen == false)
            {
                throw new InvalidOperationException();
            }

            databaseFilename = DatabaseManager.Instance.DatabaseFilename;

            using (AccessToTheDatabase db = new AccessToTheDatabase("PlayerInfo"))
            {
                if (db.Database.Combatants.Count > 0)
                {
                    var playerData = from com in db.Database.Combatants
                                     where ((EntityType)com.CombatantType == EntityType.Player ||
                                            (EntityType)com.CombatantType == EntityType.Pet ||
                                            (EntityType)com.CombatantType == EntityType.Fellow ||
                                            (EntityType)com.CombatantType == EntityType.CharmedMob)
                                     orderby com.CombatantName
                                     select new PlayerInfo
                    {
                        Name          = com.CombatantName,
                        CombatantType = (EntityType)com.CombatantType,
                        Info          = com.PlayerInfo
                    };

                    // Put the acquired data in the listbox

                    playerDataList = playerData.ToArray();

                    combatantListBox.Items.Clear();
                    foreach (var player in playerDataList)
                    {
                        combatantListBox.Items.Add(player.Name);
                    }

                    combatantListBox.SelectedIndex = 0;
                }
            }
        }