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."); } } }
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."); } }
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; }
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; }