private void FileReadOperationFinishedSync(object in_param)
        {
            gFileTransferIndicator.Visibility = Visibility.Hidden;
            gSettings.Visibility = Visibility.Visible;

            // load files
            m_device_settings.ParseXMLFileFromResource("/Settings/*", "CygnusAuxBoardMonitor.Resources.ConfigurationXML.xml"); // load config from resource instead of downloading from the device
            m_device_settings_binary_data.Load(m_files_info[0].FullPath);                                                      // download setting values from the device
            //m_device_settings.ParserXMLFileGZIP("/Settings/*", m_files_info[0].FullPath);
            //m_device_settings_binary_data.Load(m_files_info[1].FullPath);

            m_device_settings.GenerateBinaryValueOffset();
            m_device_settings.UpdateValuesFromBinaryFile(m_device_settings_binary_data.BinaryDataFile);

            // update group list
            m_device_settings_group.Clear();
            for (int i = 0; i < m_device_settings.DeviceSettingsRoot.Groups.Count; i++)
            {
                m_device_settings_group.Add(m_device_settings.DeviceSettingsRoot.Groups[i]);
            }

            // update selected index
            if (m_device_settings_group.Count != 0)
            {
                lbDeviceSetupGroup.SelectedIndex = 0;
            }

            m_dialog_initializing = false;
        }
Exemple #2
0
        private void FileReadOperationFinishedSync(object in_param)
        {
            FileTransferManager.FileTransferResultInfo result = (FileTransferManager.FileTransferResultInfo)in_param;

            if (result.State == FileTransferManager.FileTransferResult.Success)
            {
                gFileTransferIndicator.Visibility = Visibility.Hidden;
                gSettings.Visibility      = Visibility.Visible;
                wpNormalButton.Visibility = Visibility.Visible;
                wpErrorButton.Visibility  = Visibility.Hidden;

                // load files
                m_device_settings.ParserXMLFileGZIP("/Settings/*", m_files_info[0].FullPath);
                m_device_settings_binary_data.Load(m_files_info[1].FullPath);

                m_device_settings.GenerateBinaryValueOffset();
                m_device_settings.UpdateValuesFromBinaryFile(m_device_settings_binary_data.BinaryDataFile);

                // update group list
                m_device_settings_group.Clear();
                for (int i = 0; i < m_device_settings.DeviceSettingsRoot.Groups.Count; i++)
                {
                    m_device_settings_group.Add(m_device_settings.DeviceSettingsRoot.Groups[i]);
                }

                // update selected index
                if (m_device_settings_group.Count != 0)
                {
                    lbDeviceSetupGroup.SelectedIndex = 0;
                }
            }
            else
            {
                // display error
                gFileTransferIndicator.Visibility      = Visibility.Hidden;
                gFileTransferErrorIndicator.Visibility = Visibility.Visible;
                gSettings.Visibility      = Visibility.Hidden;
                wpNormalButton.Visibility = Visibility.Hidden;
                wpErrorButton.Visibility  = Visibility.Visible;
            }
        }