コード例 #1
0
        private void HandleCellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            // Find the correct row
            var row = dataGridView1.SelectedRows.Cast <DataGridViewRow>().FirstOrDefault();

            if (row == null)
            {
                return;
            }

            // Find the cell
            var cell = row.Cells[e.ColumnIndex];

            if (cell == null || cell.Value == null)
            {
                return;
            }

            // Get the data from the cell
            var content = cell.Value.ToString().Replace("\\r", "").Replace("\\n", Environment.NewLine);

            // Might be json? Format if so.
            if (content.StartsWith("{") || content.StartsWith("["))
            {
                try
                {
                    content = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(content), Formatting.Indented);
                }
                catch (Exception exception)
                {
                }
            }

            // Show message
            SelectableMessageBox.Show(this, content, "Logmessage");
        }
コード例 #2
0
 public void SelectableInfo(string text, string title = "Info", string msgUri = "")
 {
     var res = SelectableMessageBox.Show(title, text, MessageBoxButton.OK, MessageBoxImage.Information, msgUri);
 }