예제 #1
0
        private void mnuImportFromLivesplit_Click(object sender, EventArgs e)
        {
            String         fileName       = "";
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog              = new OpenFileDialog();
            openFileDialog.DefaultExt   = ".lss";
            openFileDialog.Filter       = "LiveSplit split file (*.lss)|*.lss";
            openFileDialog.AddExtension = true;

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                fileName = openFileDialog.FileName;
                LiveSplitXMLReader liveSplitXmlReader = new LiveSplitXMLReader();
                this.split = liveSplitXmlReader.ReadSplit(fileName);
                this.ResetDataGridView();
                if (this.split != null)
                {
                    this.txtRunTitle.Text      = this.split.RunTitle;
                    this.txtAttemptsCount.Text = this.split.AttemptsCount.ToString();
                    FillSegmentRows();
                    FillSegmentTimeAfterImportFromLiveSplit();
                }
                else
                {
                    MessageBox.Show("The import from livesplit has failed.");
                }
            }
        }
예제 #2
0
        private void menuItemImportLiveSplit_Click(object sender, EventArgs e)
        {
            Split split = null;

            if (this.openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                using (FileStream stream = File.OpenRead(this.openFileDialog.FileName))
                {
                    this.xmlReader = new LiveSplitXMLReader();
                    split          = this.xmlReader.ReadSplit(this.openFileDialog.FileName);
                }
            }
            if (split != null)
            {
                this.titleBox.Text    = split.RunTitle;
                this.txtGoal.Text     = split.RunGoal;
                this.attemptsBox.Text = split.AttemptsCount.ToString();
                this.populateList(split.segments);
                this.startDelay = split.StartDelay;
            }
            else
            {
                MessageBox.Show("The import from livesplit has failed.");
            }
        }
예제 #3
0
        public RunEditorDialog(Split splits)
        {
            this.xmlReader = new LiveSplitXMLReader();
            this.InitializeComponent();
            this.cellHeight = this.runView.RowTemplate.Height;
            this.windowHeight = (base.Height - (this.runView.Height - this.cellHeight)) - 2;
            this.MaximumSize = new Size(500, (15 * this.cellHeight) + this.windowHeight);

            foreach (Segment segment in splits.segments)
                this.editList.Add(segment);

            this.populateList(this.editList);
            this.runView.EditingControlShowing += this.runView_EditingControlShowing;
        }
예제 #4
0
        public int startDelay; //Temporary until I refactor the whole application...

        public RunEditorDialog(Split splits)
        {
            this.xmlReader = new LiveSplitXMLReader();
            this.InitializeComponent();
            this.cellHeight   = this.runView.RowTemplate.Height;
            this.windowHeight = (base.Height - (this.runView.Height - this.cellHeight)) - 2;
            this.MaximumSize  = new Size(500, (15 * this.cellHeight) + this.windowHeight);

            foreach (Segment segment in splits.segments)
            {
                this.editList.Add(segment);
            }

            this.populateList(this.editList);
            this.runView.EditingControlShowing += this.runView_EditingControlShowing;
        }
예제 #5
0
        private void mnuImportFromLivesplit_Click(object sender, EventArgs e)
        {
            String fileName = "";
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog = new OpenFileDialog();
            openFileDialog.DefaultExt = ".lss";
            openFileDialog.Filter = "LiveSplit split file (*.lss)|*.lss";
            openFileDialog.AddExtension = true;

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                fileName = openFileDialog.FileName;
                LiveSplitXMLReader liveSplitXmlReader = new LiveSplitXMLReader();
                this.split = liveSplitXmlReader.ReadSplit(fileName);
                this.ResetDataGridView();
                if (this.split != null)
                {
                    this.txtRunTitle.Text = this.split.RunTitle;
                    this.txtAttemptsCount.Text = this.split.AttemptsCount.ToString();
                    FillSegmentRows();
                    FillSegmentTimeAfterImportFromLiveSplit();
                }
                else
                {
                    MessageBox.Show("The import from livesplit has failed.");
                }
            }
        }
예제 #6
0
 private void menuItemImportLiveSplit_Click(object sender, EventArgs e)
 {
     Split split = null;
     if (this.openFileDialog.ShowDialog(this) == DialogResult.OK)
     {
         using (FileStream stream = File.OpenRead(this.openFileDialog.FileName))
         {
             this.xmlReader = new LiveSplitXMLReader();
             split = this.xmlReader.ReadSplit(this.openFileDialog.FileName);
         }
     }
     if (split != null)
     {
         this.titleBox.Text = split.RunTitle;
         this.txtGoal.Text = split.RunGoal;
         this.attemptsBox.Text = split.AttemptsCount.ToString();
         this.populateList(split.segments);
         this.startDelay = split.StartDelay;
     }
     else
     {
         MessageBox.Show("The import from livesplit has failed.");
     }
 }