示例#1
0
        private void hed_main_btn_save_click(object sender, RoutedEventArgs e)
        {
            information.Save(text_on_image);
            string filename = mwh.SaveFileDialog();

            if (filename != null)
            {
                try
                {
                    IFormatter formatter = new BinaryFormatter();
                    Stream     stream    = new FileStream(filename, FileMode.Create, FileAccess.Write);

                    formatter.Serialize(stream, information);
                    stream.Close();
                }
                catch (System.ArgumentException ex)
                {
                    ShowNotificationWindow(NotificationType.Error, "Path unavailable", "The Program couldn't save under the given path");
                }
            }
        }