示例#1
0
        private void btnBrowse_Click(object sender, RoutedEventArgs e)
        {
            string uri = KeyVault.BrowseFile();

            if (uri != "")
            {
                try
                {
                    List <DataGridModel> dataGridValues = KeyVault.LoadFile(uri, txtUri);
                    dataGridConfigValues.ItemsSource = dataGridValues;
                    lblStatusMessage.Content         = "";
                }
                catch (Exception ex)
                {
                    lblStatusMessage.Foreground = new SolidColorBrush(Colors.Red);
                    lblStatusMessage.Content    = ex.Message;
                }
            }
        }
示例#2
0
        private void btnLoad_Click(object sender, RoutedEventArgs e)
        {
            string uri = txtUri.Text.ToLower();

            if (uri != "")
            {
                try
                {
                    _dataGridValues = new List <DataGridModel>();
                    _dataGridValues = KeyVault.LoadFile(uri, txtUri);
                    dataGridConfigValues.ItemsSource = _dataGridValues;
                    lblStatusMessage.Foreground      = new SolidColorBrush(Colors.LightGreen);
                    lblStatusMessage.Content         = "Loaded Values Successfully.";
                }
                catch (Exception ex)
                {
                    lblStatusMessage.Foreground = new SolidColorBrush(Colors.Red);
                    lblStatusMessage.Content    = ex.Message;
                }
            }
        }