예제 #1
0
 private void gridDiffs_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
       {
     if (e.ColumnIndex == colCompare.DisplayIndex && e.RowIndex >= 0)
     {
       var diff = (InstallItemDiff)gridDiffs.Rows[e.RowIndex].DataBoundItem;
       if (diff.DiffType == DiffType.Different)
       {
     var diffWin = new ADiff.DiffWindow();
     diffWin.LeftText = diff.LeftScript.OuterXml;
     diffWin.RightText = diff.RightScript.OuterXml;
     ElementHost.EnableModelessKeyboardInterop(diffWin);
     diffWin.Show();
       }
       else
       {
     using (var dialog = new EditorWindow())
     {
       dialog.AllowRun = false;
       dialog.AmlGetter = o => Utils.FormatXml(diff.LeftScript ?? diff.RightScript);
       dialog.DisplayMember = "Name";
       dialog.DataSource = new List<InstallItemDiff>() { diff };
       dialog.SetConnection(_wizard.Connection, _wizard.ConnectionInfo.First().ConnectionName);
       dialog.ShowDialog(this);
     }
       }
     }
       }
       catch (Exception ex)
       {
     Utils.HandleError(ex);
       }
 }
예제 #2
0
 private void gridDiffs_CellClick(object sender, DataGridViewCellEventArgs e)
 {
     try
     {
         if (e.ColumnIndex == colCompare.DisplayIndex && e.RowIndex >= 0)
         {
             var diff = (InstallItemDiff)gridDiffs.Rows[e.RowIndex].DataBoundItem;
             if (diff.DiffType == DiffType.Different)
             {
                 var diffWin = new ADiff.DiffWindow();
                 diffWin.LeftText  = diff.LeftScript.OuterXml;
                 diffWin.RightText = diff.RightScript.OuterXml;
                 ElementHost.EnableModelessKeyboardInterop(diffWin);
                 diffWin.Show();
             }
             else
             {
                 using (var dialog = new EditorWindow())
                 {
                     dialog.AllowRun      = false;
                     dialog.AmlGetter     = o => Utils.FormatXml(diff.LeftScript ?? diff.RightScript);
                     dialog.DisplayMember = "Name";
                     dialog.DataSource    = new List <InstallItemDiff>()
                     {
                         diff
                     };
                     dialog.SetConnection(_wizard.Connection, _wizard.ConnectionInfo.First().ConnectionName);
                     dialog.ShowDialog(this);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Utils.HandleError(ex);
     }
 }