コード例 #1
0
        public void getSystemNamesTest()
        {
            SystemNameReader read = new SystemNameReader(@"C:\Dokumente und Einstellungen\JG\Eigene Dateien\Visual Studio 2008\Projects\BloxVarReader\BloxVarReader\bin\Debug\TestCase");

            string[] systems = read.getAvailableSystems();

            for(int i = 0; i < systems.Length; i++) {
                Assert.AreEqual(expectedSystems[i],systems[i]);
            }
        }
コード例 #2
0
        public void invalidTradingBloxDirectoryTest()
        {
            SystemNameReader read = new SystemNameReader(@"C:\");

            string[] systems = read.getAvailableSystems();
        }
コード例 #3
0
        public void invalidDirectoryTest()
        {
            SystemNameReader read = new SystemNameReader("das ist doch kein Verzeichnis");

            string[] systems = read.getAvailableSystems();
        }
コード例 #4
0
ファイル: frmMain.cs プロジェクト: stino14/BloxVarReader
        private void createSystemCheckBoxes()
        {
            int xValue = CHECKBOX_LEFT_START;
            int yValue = CHECKBOX_TOP_START;
            int controlsInRow = 0;
            int controlsPerRow = (pSystems.Size.Width - CHECKBOX_LEFT_START) / (CHECKBOX_WIDTH + CHECKBOX_HORIZONTAL_SPACING);
            string[] systemNames;
            SystemNameReader sysReader = new SystemNameReader(tbBloxDir.Text);
            lblSystems.Text = "Systems:";
            try {
                systemNames = sysReader.getAvailableSystems();
            } catch (DirectoryNotFoundException de) {
                MessageBox.Show("Directory not a valid TradingBlox Directory", "Incorrect Information",
                    MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            systemCheckBoxes = new CheckBox[systemNames.Length];

            for (int i = 0; i < systemNames.Length; i++) {
                systemCheckBoxes[i] = new CheckBox();
                systemCheckBoxes[i].Text = systemNames[i];
                systemCheckBoxes[i].Size = new Size(CHECKBOX_WIDTH, CHECKBOX_HEIGHT);
                systemCheckBoxes[i].Checked = true;

                //Position der checkBoxes
                systemCheckBoxes[i].Location = new Point(xValue, yValue);
                xValue += systemCheckBoxes[i].Size.Width + CHECKBOX_HORIZONTAL_SPACING;

                controlsInRow++;
                if (controlsInRow == controlsPerRow) {
                    xValue = CHECKBOX_LEFT_START;
                    yValue += systemCheckBoxes[i].Size.Height + CHECKBOX_VERTICAL_SPACING;
                    controlsInRow = 0;
                }
            }
            pSystems.Controls.Clear();
            pSystems.Controls.AddRange(systemCheckBoxes);
        }