Example #1
0
        /// <summary>
        /// Method used for Load the states from Registry.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void OnLoadFromRegStateClick(object sender, RoutedEventArgs e)
        {
            //Load State
            BinaryFormatter formatter1 = new BinaryFormatter();

            try
            {
                DocContainer.LoadDockState(formatter1);
            }
            catch (SerializationException ex)
            {
                MessageBox.Show(ex.Message, AttentionHeader, MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            catch (FormatException ex)
            {
                MessageBox.Show(ex.Message, AttentionHeader, MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }
Example #2
0
        /// <summary>
        /// Method used for Load the states from XML.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnLoadFromXMLStateClick(object sender, RoutedEventArgs e)
        {
            //Load from XML State
            if (BinFormatterRadio.IsChecked == true)
            {
                BinaryFormatter formatter1 = new BinaryFormatter();
                try
                {
                    DocContainer.LoadDockState(formatter1, StorageFormat.Xml,
                                               AppDomain.CurrentDomain.BaseDirectory.ToString() + "\\docum_xml.xml");
                }
                catch (XmlException ex)
                {
                    MessageBox.Show(ex.Message, AttentionHeader, MessageBoxButton.OK,
                                    MessageBoxImage.Warning);
                }
                catch (InvalidOperationException ex)
                {
                    MessageBox.Show(ex.Message, AttentionHeader, MessageBoxButton.OK,
                                    MessageBoxImage.Warning);
                }
            }
#if !NETCORE
            else
            {
                SoapFormatter formatter1 = new SoapFormatter();
                try
                {
                    DocContainer.LoadDockState(formatter1, StorageFormat.Xml,
                                               AppDomain.CurrentDomain.BaseDirectory.ToString() + "\\docum_xml.xml");
                }
                catch (XmlException ex)
                {
                    MessageBox.Show(ex.Message, AttentionHeader, MessageBoxButton.OK,
                                    MessageBoxImage.Warning);
                }
                catch (InvalidOperationException ex)
                {
                    MessageBox.Show(ex.Message, AttentionHeader, MessageBoxButton.OK,
                                    MessageBoxImage.Warning);
                }
            }
#endif
        }
Example #3
0
 /// <summary>
 /// Method used for Load the states from Binary.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnLoadFromBinStateClick(object sender, RoutedEventArgs e)
 {
     //Load from Binary State
     if (BinFormatterRadio.IsChecked == true)
     {
         BinaryFormatter formatter1 = new BinaryFormatter();
         try
         {
             DocContainer.LoadDockState(formatter1, StorageFormat.Binary,
                                        AppDomain.CurrentDomain.BaseDirectory.ToString() + "\\docum_bin.bin");
         }
         catch (SerializationException ex)
         {
             MessageBox.Show(ex.Message, AttentionHeader, MessageBoxButton.OK,
                             MessageBoxImage.Warning);
         }
         catch (XmlException ex)
         {
             MessageBox.Show(ex.Message, AttentionHeader, MessageBoxButton.OK,
                             MessageBoxImage.Warning);
         }
     }
 }
Example #4
0
 /// <summary>
 /// Method used for Load the states from IS.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnLoadStateFromIsoStorageClick(object sender, RoutedEventArgs e)
 {
     //Load State from Isolated Storage
     DocContainer.LoadDockState();
 }