Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MetaPropWindow"/> class.
 /// </summary>
 /// <param name="guid">The <see cref="Guid"/> of the Asset.</param>
 /// <param name="fileSystem">The file system.</param>
 public MetaPropWindow(Guid guid, Common.FileSystem.IO fileSystem, Common.CouchDB.Database couchdb)
 {
     InitializeComponent();
     _metaForm    = null;
     _guid        = guid;
     _metaasset   = null;
     _selectedTvi = null;
     _fileSystem  = fileSystem;
     _couchdb     = couchdb;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MetaPropWindow"/> class.
 /// </summary>
 /// <param name="guid">The <see cref="Guid"/> of the Asset.</param>
 /// <param name="fileSystem">The file system.</param>
 public MetaPropWindow(Guid guid, Common.FileSystem.IO fileSystem, Common.CouchDB.Database couchdb)
 {
     InitializeComponent();
     _metaForm = null;
     _guid = guid;
     _metaasset = null;
     _selectedTvi = null;
     _fileSystem = fileSystem;
     _couchdb = couchdb;
 }
Beispiel #3
0
        /// <summary>
        /// Downloads the <see cref="Common.NetworkPackage.MetaForm"/> which contains the collection of properties
        /// for be displayed on the UI
        /// </summary>
        private void DownloadFormProperties()
        {
            Common.Network.Message msg = null;
            UpdateUI actUpdateUI       = UpdateUI_DownloadComplete;

            try
            {
                msg = new Common.Network.Message(Settings.Instance.ServerIp, Settings.Instance.ServerPort, "_settings", "metaform", Common.Network.OperationType.GET,
                                                 Common.Network.DataStreamMethod.Memory, null, null, null, null, false, false, true, true, Settings.Instance.NetworkBufferSize,
                                                 Settings.Instance.NetworkTimeout);
                msg.Send();
            }
            catch (Exception e)
            {
                MainWindow.ErrorManager.AddError(Common.ErrorMessage.ErrorCode.MetaFormDownloadFailed,
                                                 "Failed to Download Properties",
                                                 "I failed to download the available properties, please try again.",
                                                 "Failed to download the meta properties to be displayed in the MetaPropWindow.",
                                                 true, true, e);
                return;
            }

            _metaForm = new Common.NetworkPackage.MetaForm();

            try
            {
                _metaForm.Deserialize(msg.State.Stream);
            }
            catch (Exception e)
            {
                MainWindow.ErrorManager.AddError(Common.ErrorMessage.ErrorCode.MetaFormDeserializationFailed,
                                                 "Failed to Read Properties",
                                                 "I failed to read the available properties, please try again.",
                                                 "Failed to deserialize the meta properties to be displayed in the MetaPropWindow.",
                                                 true, true, e);
                return;
            }

            Dispatcher.BeginInvoke(actUpdateUI, System.Windows.Threading.DispatcherPriority.Normal);
        }
        /// <summary>
        /// Downloads the <see cref="Common.NetworkPackage.MetaForm"/> which contains the collection of properties 
        /// for be displayed on the UI
        /// </summary>
        private void DownloadFormProperties()
        {
            Common.Network.Message msg = null;
            UpdateUI actUpdateUI = UpdateUI_DownloadComplete;

            try
            {
                msg = new Common.Network.Message(Settings.Instance.ServerIp, Settings.Instance.ServerPort, "_settings", "metaform", Common.Network.OperationType.GET,
                     Common.Network.DataStreamMethod.Memory, null, null, null, null, false, false, true, true, Settings.Instance.NetworkBufferSize,
                     Settings.Instance.NetworkTimeout);
                msg.Send();
            }
            catch (Exception e)
            {
                MainWindow.ErrorManager.AddError(Common.ErrorMessage.ErrorCode.MetaFormDownloadFailed,
                    "Failed to Download Properties",
                    "I failed to download the available properties, please try again.",
                    "Failed to download the meta properties to be displayed in the MetaPropWindow.",
                    true, true, e);
                return;
            }

            _metaForm = new Common.NetworkPackage.MetaForm();

            try
            {
                _metaForm.Deserialize(msg.State.Stream);
            }
            catch (Exception e)
            {
                MainWindow.ErrorManager.AddError(Common.ErrorMessage.ErrorCode.MetaFormDeserializationFailed,
                    "Failed to Read Properties",
                    "I failed to read the available properties, please try again.",
                    "Failed to deserialize the meta properties to be displayed in the MetaPropWindow.",
                    true, true, e);
                return;
            }

            Dispatcher.BeginInvoke(actUpdateUI, System.Windows.Threading.DispatcherPriority.Normal);
        }