コード例 #1
0
 private void OnSaveClick(object sender, LinkLabelLinkClickedEventArgs e)
 {
     try
     {
         using (var dlg = new SaveFileDialog())
         {
             dlg.Filter = Resources.XML_FILE;
             if (dlg.ShowDialog() != DialogResult.OK)
             {
                 return;
             }
             using (XmlWriter writer = new XmlTextWriter(dlg.FileName, Encoding.UTF8))
             {
                 var serializer = new XmlSerializer(typeof(Appearance));
                 var app        = new Appearance();
                 app.Bar.Assign((AppearanceBar)pgrdBar.SelectedObject);
                 app.Item.Assign((AppearanceItem)pgrdItem.SelectedObject);
                 serializer.Serialize(writer, app);
                 writer.Flush();
                 writer.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
コード例 #2
0
ファイル: Appearance.cs プロジェクト: m309/fiddler-plus
 /// <summary>
 /// Assigns Values of supplied <see cref="Appearance"/> to current object.
 /// </summary>
 /// <param name="appearance"><see cref="Appearance"/> object whose value is to be assigned.</param>
 public void Assign(Appearance appearance)
 {
     Bar.Assign(appearance.Bar);
     Item.Assign(appearance.Item);
 }
コード例 #3
0
ファイル: Appearance.cs プロジェクト: svn2github/fiddler-plus
 /// <summary>
 /// Creates a new object that is a copy of the current instance.
 /// </summary>
 /// <returns>
 /// A new object that is a copy of this instance.
 /// </returns>
 /// <filterpriority>2</filterpriority>
 public object Clone()
 {
     var app = new Appearance();
     app.Bar.Assign((AppearanceBar) bar.Clone());
     app.Item.Assign((AppearanceItem) item.Clone());
     return app;
 }
コード例 #4
0
ファイル: Appearance.cs プロジェクト: svn2github/fiddler-plus
 /// <summary>
 /// Assigns Values of supplied <see cref="Appearance"/> to current object.
 /// </summary>
 /// <param name="appearance"><see cref="Appearance"/> object whose value is to be assigned.</param>
 public void Assign(Appearance appearance)
 {
     Bar.Assign(appearance.Bar);
     Item.Assign(appearance.Item);
 }
コード例 #5
0
 private void OnSaveClick(object sender, LinkLabelLinkClickedEventArgs e)
 {
     try
     {
         using (var dlg = new SaveFileDialog())
         {
             dlg.Filter = Resources.XML_FILE;
             if (dlg.ShowDialog() != DialogResult.OK)
                 return;
             using (XmlWriter writer = new XmlTextWriter(dlg.FileName, Encoding.UTF8))
             {
                 var serializer = new XmlSerializer(typeof (Appearance));
                 var app = new Appearance();
                 app.Bar.Assign((AppearanceBar) pgrdBar.SelectedObject);
                 app.Item.Assign((AppearanceItem) pgrdItem.SelectedObject);
                 serializer.Serialize(writer, app);
                 writer.Flush();
                 writer.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }