예제 #1
0
        //--------------------------------------------------------------------
        // Purpose:
        //     Cnstructor of the orchestra
        //
        // Notes:
        //     This class does not save anything to the config file, so
        //     it does not need the main config file
        //--------------------------------------------------------------------
        public FullOrch()
        {
            mFileName = mConfig.getFullOrchFile();
            StreamReader file = File.OpenText(mFileName);

            mMD5 = file.GetHashCode().ToString();

            string line = file.ReadLine();

            char[] delimiterChars = { ',' };

            string[] items = line.Split(delimiterChars);
            mVersion  = items[1];
            mFileDate = File.GetLastWriteTime(mFileName).ToString();

            //Read header Line
            line = file.ReadLine();

            line = file.ReadLine();

            while (!file.EndOfStream)
            {
                OrchPlayer newPlayer = new OrchPlayer(line);
                mPlayers.Add(newPlayer);
                line = file.ReadLine();
            }
            file.Close();
        }
예제 #2
0
        //--------------------------------------------------------------------
        // Purpose:
        //     Loads the form
        //
        // Notes:
        //     None.
        //--------------------------------------------------------------------
        private void Selection_Load(object sender, EventArgs e)
        {
            lMovement.Text = mConfig.getMovementName(mMovement);

            // Draw the tree veiw for the movement
            tvOrch.BeginUpdate();
            tvOrch.Nodes.Clear();
            TreeNode allNodes = tvOrch.Nodes.Add("All");

            for (int i = 0; i < mFullOrch.getNumPlayers(); i++)
            {
                OrchPlayer curPlayer = mFullOrch.getPlayerFromID(i);
                if (0 != curPlayer.inMovement(mMovement))
                {
                    string type = curPlayer.getType();
                    string inst = curPlayer.getInst();

                    TreeNode childNode = findNode(allNodes, type);
                    if (null == childNode)
                    {
                        childNode = allNodes.Nodes.Add(allNodes.Text, type);
                    }

                    TreeNode instNode = findNode(childNode, inst);
                    if (null == instNode)
                    {
                        childNode.Nodes.Add(childNode.Text, inst);
                    }
                }
            }

            // Fill in the text boxes with what is saved from the config file
            tbEnd.Text       = mConfig.getEndFrame().ToString();
            tbStart.Text     = mConfig.getStartFrame().ToString();
            tbSelection.Text = mConfig.getSelection();

            tvOrch.EndUpdate();
        }