private void setName_TextChanged(object sender, System.EventArgs e) { if (_clips == null) { _clips = new Clips(); } _clips.Name = setName.Text; }
public Clips Load(string filename) { System.Xml.XmlTextReader xtw = new System.Xml.XmlTextReader(filename); try { Clips clips = (Clips)s_ser.Deserialize(xtw); return(clips); } finally { xtw.Close(); } }
public void Save(Clips clips, string filename) { System.Xml.XmlTextWriter xtw = new System.Xml.XmlTextWriter(filename, System.Text.Encoding.UTF8); try { xtw.Formatting = System.Xml.Formatting.Indented; s_ser.Serialize(xtw, clips, s_xsn); } finally { xtw.Close(); } }
private void btnAdd_Click(object sender, System.EventArgs e) { if (this._clips == null) { this._clips = new Clips(); } Clip c = new Clip(this.getGoodNewClipName()); this._clips.TextClips.Add(c); this.lstClips.Items.Add(c); this.lstClips.SelectedItem = c; }
private void itmNew_Click(object sender, System.EventArgs e) { if (this.CheckModified() == true) { this._changing = true; this.lstClips.Items.Clear(); this.txtClipName.Text = ""; this.txtClipText.Text = ""; this.setName.Text = ""; this._filename = ""; this._clips = null; this._changing = false; this.enableButtons(false); } }
private void itmOpen_Click(object sender, System.EventArgs e) { if (this.CheckModified() == true && this.openFileDialog.ShowDialog(this) == DialogResult.OK) { this._changing = true; this.lstClips.Items.Clear(); this.enableButtons(false); this.txtClipName.Text = ""; this.txtClipText.Text = ""; this.setName.Text = ""; this._filename = ""; this._clips = null; Clips clips = null; try { clips = this._cs.Load(this.openFileDialog.FileName); } catch (Exception) { } if (clips != null) { this._clips = clips; foreach (Clip c in this._clips.TextClips) { this.lstClips.Items.Add(c); } this.setName.Text = clips.Name; this._filename = this.openFileDialog.FileName; } this._changing = false; this.enableButtons(false); } }
private void itmNew_Click(object sender, System.EventArgs e) { if (CheckModified() == true) { _changing = true; lstClips.Items.Clear(); txtClipName.Text = ""; txtClipText.Text = ""; setName.Text = ""; _filename = ""; _clips = null; _changing = false; enableButtons(false); } }
private void setName_TextChanged(object sender, System.EventArgs e) { if(_clips == null) _clips = new Clips(); _clips.Name = setName.Text; }
private void btnAdd_Click(object sender, System.EventArgs e) { if(_clips == null) _clips = new Clips(); Clip c = new Clip(getGoodNewClipName()); _clips.TextClips.Add(c); lstClips.Items.Add(c); lstClips.SelectedItem = c; }
private void itmOpen_Click(object sender, System.EventArgs e) { if (CheckModified() == true && openFileDialog.ShowDialog(this) == DialogResult.OK) { _changing = true; lstClips.Items.Clear(); enableButtons(false); txtClipName.Text = ""; txtClipText.Text = ""; setName.Text = ""; _filename = ""; _clips = null; Clips clips = null; try { clips = _cs.Load(openFileDialog.FileName); } catch(Exception) { } if(clips != null) { _clips = clips; foreach(Clip c in _clips.TextClips) { lstClips.Items.Add(c); } setName.Text = clips.Name; _filename = openFileDialog.FileName; } _changing = false; enableButtons(false); } }