コード例 #1
0
        protected override void InitializeComponent()
        {
            properties.AddRow("Image file:", textureFile = new SelectFileButton(SelectImageDialog("Select an image file to import")));

            if (!string.IsNullOrWhiteSpace(Data.file))
            {
                textureFile.File = editor.GetResourceFile(Data.file);
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: Capas0/CourseWork
 private void SendRadioButton_CheckedChanged(object sender, EventArgs e)
 {
     if (SendRadioButton.Checked)
     {
         SendButton.Show();
         TakeButton.Hide();
         SelectFileButton.Hide();
         SelectedFileTextBox.Hide();
     }
     SelectedFileTextBox.Clear();
 }
コード例 #3
0
        protected override void InitializeComponent()
        {
            properties.AddRow("Level file:", levelFile = new SelectFileButton(SelectBytesFileDialog("Select a level file to import")));

            if (!string.IsNullOrWhiteSpace(Data.file))
            {
                levelFile.File = editor.GetResourceFile(Data.file);
            }

            properties.AddRow("Thumbnail file:", thumbnailFile = new SelectFileButton(SelectImageDialog("Select a thumbnail image to import")));

            if (!string.IsNullOrWhiteSpace(Data.thumbnail))
            {
                thumbnailFile.File = editor.GetResourceFile(Data.thumbnail);
            }
        }
コード例 #4
0
ファイル: Form1.cs プロジェクト: modulexcite/LogParserPlusApp
 private void QueryButton_Click(object sender, EventArgs e)
 {
     // Validate we have at least a SELECT and a FROM.
     if (SelectText.Text.Trim() == String.Empty)
     {
         SelectText.Text = "*";
     }
     if (FromText.Text.Trim() == String.Empty)
     {
         SelectFileButton.PerformClick();
         if (FromText.Text.Trim() == String.Empty)
         {
             MessageBox.Show("You must have a FROM statement to continue." + Environment.NewLine + "Please select a file or enter the FROM manually.", "Query cancelled");
             return;
         }
     }
     PerformSQLQuery();
 }
コード例 #5
0
ファイル: Form1.cs プロジェクト: modulexcite/LogParserPlusApp
        private void PerformRecordCount_Click(object sender, EventArgs e)
        {
            toolStripStatusLabelDataInfo.Text = "";
            if (FromText.Text.Trim() == String.Empty)
            {
                SelectFileButton.PerformClick();
                if (FromText.Text.Trim() == String.Empty)
                {
                    MessageBox.Show("You must have a FROM statement to continue." + Environment.NewLine + "Please select a file or enter the FROM manually.", "Query cancelled");
                    return;
                }
            }

            PerformRecordCount.Enabled = false;

            ICOMIISW3CInputContext input = new COMIISW3CInputContextClassClass();

            toolStripStatusLabelDataInfo.Text = "There are " + GetRecordCount(FromText.Text, input).ToString() + " records to parse.";

            PerformRecordCount.Enabled = true;
        }
コード例 #6
0
ファイル: Form1.cs プロジェクト: modulexcite/LogParserPlusApp
        private void PopulateSelectListButton_Click(object sender, EventArgs e)
        {
            if (SelectedFileText.Text.Trim() == String.Empty)
            {
                SelectFileButton.PerformClick();
                if (FromText.Text.Trim() == String.Empty)
                {
                    MessageBox.Show("You must have a FROM statement to continue." + Environment.NewLine + "Please select a file or enter the FROM manually.", "Query cancelled");
                    return;
                }
            }

            // Use Log Parser to get a list of valid fields. Grab the top 5, as 1 might do strange things.
            ILogRecordset rs;

            if (FileFormatsComboBox.SelectedItem.ToString() == "W3C Extended Log File Format")
            {
                rs = GetRecordSet("SELECT TOP 5 * FROM " + FromText.Text, new COMIISW3CInputContextClassClass());
            }
            else
            {
                rs = GetRecordSet("SELECT TOP 5 * FROM " + FromText.Text, null);
            }

            //MessageBox.Show(rs.getColumnCount().ToString());

            SelectListBox.Items.Clear();
            for (int i = 0; i < rs.getColumnCount(); i++)
            {
                SelectListBox.Items.Add(rs.getColumnName(i));
            }

            if (FileFormatsComboBox.SelectedItem.ToString() == "W3C Extended Log File Format")
            {
                SelectListBox.Items.Add("TO_LOCALTIME(TO_TIMESTAMP(date, time)) AS LocalTime");
            }
        }
コード例 #7
0
        public override void Update(float dt)
        {
            if (_difficultyPrompt.IsVisible)
            {
                Difficulty?result = _difficultyPrompt.Update(dt);
                if (result == null)
                {
                    return;
                }
                SMH.SaveManager.CurrentSave.Difficulty = result.Value;
            }

            if (State == MenuState.EnteringScreen)
            {
                SetWindowPosition(_windowX, _windowY + 1800f * dt);
                if (_windowY > 138f)
                {
                    EnterState(MenuState.InScreen);
                    SetWindowPosition(_windowX, 138f);
                }
            }
            else if (State == MenuState.ExitingScreen)
            {
                SetWindowPosition(_windowX, _windowY - 1800f * dt);
                if (_windowY <= -512f)
                {
                    //Done exiting screen - perform action based on what button was clicked.
                    switch (_clickedButton)
                    {
                    case SelectFileButton.Back:
                        MainMenu.ShowScreen <TitleScreen>();
                        break;

                    case SelectFileButton.Start:
                        if (SMH.SaveManager.CurrentSave.IsEmpty)
                        {
                            SMH.Environment.LoadLevelAsynch(Level.FOUNTAIN_AREA);
                            MainMenu.ShowScreen <CinematicScreen>();
                        }
                        else
                        {
                            SMH.StartGame(false);
                        }
                        break;
                    }
                }
            }

            //Set "start" button text based on whether or not an empty file is selected.
            _buttons[SelectFileButton.Start].Text = SMH.SaveManager.Saves[_selectedSlot].IsEmpty ? "Start" : "Continue";

            //Update buttons
            foreach (KeyValuePair <SelectFileButton, Button> kvp in _buttons)
            {
                kvp.Value.Update(dt);
                if (kvp.Value.IsClicked() && kvp.Key != SelectFileButton.Delete)
                {
                    _clickedButton = kvp.Key;
                    SMH.SaveManager.CurrentSave = SMH.SaveManager.Saves[_selectedSlot];
                    EnterState(MenuState.ExitingScreen);
                    if (kvp.Key == SelectFileButton.Start && SMH.SaveManager.Saves[_selectedSlot].IsEmpty)
                    {
                        _difficultyPrompt.IsVisible = true;
                    }
                }
            }

            //Click delete button
            if (_buttons[SelectFileButton.Delete].IsClicked())
            {
                if (!SMH.SaveManager.Saves[_selectedSlot].IsEmpty)
                {
                    _deletePromptActive = true;
                }
            }

            //Update save box selections
            if (!_deletePromptActive)
            {
                foreach (KeyValuePair <SaveSlot, SaveBox> kvp in _saveBoxes)
                {
                    if (SMH.Input.IsDown(Input.Attack) && kvp.Value.CollisionBox.Contains(SMH.Input.Cursor))
                    {
                        _selectedSlot = kvp.Key;
                    }
                }
            }

            //Listen for response to delete prompt
            if (_deletePromptActive)
            {
                SaveBox box = _saveBoxes[_selectedSlot];
                _yesDeleteBox = new Rect(box.X + 100f, box.Y + 60f, 50f, 35f);
                _noDeleteBox  = new Rect(box.X + 180f, box.Y + 60f, 50f, 35f);

                _mouseOverYes = _yesDeleteBox.Contains(SMH.Input.Cursor);
                _mouseOverNo  = _noDeleteBox.Contains(SMH.Input.Cursor);

                if (SMH.Input.IsDown(Input.Attack))
                {
                    if (_mouseOverYes)
                    {
                        SMH.SaveManager.Delete(_selectedSlot);
                        _deletePromptActive = false;
                    }
                    else if (_mouseOverNo)
                    {
                        _deletePromptActive = false;
                    }
                }
            }

            //Move the Smiley selector towards the selected file.
            if (_smileyY > _saveBoxes[_selectedSlot].Y + 45f)
            {
                _smileyY -= 750f * dt;
                if (_smileyY < _saveBoxes[_selectedSlot].Y + 45f)
                {
                    _smileyY = _saveBoxes[_selectedSlot].Y + 45f;
                }
            }
            else if (_smileyY < _saveBoxes[_selectedSlot].Y + 45f)
            {
                _smileyY += 750f * dt;
                if (_smileyY > _saveBoxes[_selectedSlot].Y + 45f)
                {
                    _smileyY = _saveBoxes[_selectedSlot].Y + 45f;
                }
            }
        }