protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            if (windowService != null)
            {
                if (objectProvider != null)
                {
                    var obj = objectProvider.GetObject() as QueryData;
                    //  flag1 = obj == null;
                    if (obj != null)
                    {
                        var form = new EfVisualizerForm();
                        if (!string.IsNullOrEmpty(obj.ExceptionMessage))
                        {
                            form.SetDebugText(string.Format("Error:{0}{1}", Environment.NewLine, obj.ExceptionMessage));
                        }
                        else
                        {
                            form.SetDebugText(obj.SQLCommand);
                        }
                        DialogResult dialogResult = windowService.ShowDialog(form);

                    }
                }
                else
                {
                    throw new ArgumentNullException("objectProvider");
                }
            }
            else
            {
                throw new ArgumentNullException("windowService");
            }
        }
示例#2
0
 override protected void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
 {
     if (windowService != null)
     {
         if (objectProvider != null)
         {
             var obj = objectProvider.GetObject() as QueryData;
             //  flag1 = obj == null;
             if (obj != null)
             {
                 var form = new EfVisualizerForm();
                 if (!string.IsNullOrEmpty(obj.ExceptionMessage))
                 {
                     form.SetDebugText(string.Format("Error:{0}{1}", Environment.NewLine, obj.ExceptionMessage));
                 }
                 else
                 {
                     form.SetDebugText(obj.SQLCommand);
                 }
                 DialogResult dialogResult = windowService.ShowDialog(form);
             }
         }
         else
         {
             throw new ArgumentNullException("objectProvider");
         }
     }
     else
     {
         throw new ArgumentNullException("windowService");
     }
 }
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            if (windowService != null)
            {
                if (objectProvider != null)
                {
                    var obj = objectProvider.GetObject() as QueryData;

                    if (obj != null)
                    {
                        var form = new EfVisualizerForm();
                        if (!string.IsNullOrEmpty(obj.ExceptionMessage))
                        {
                            form.SetDebugText(string.Format("Error:{0}{1}", Environment.NewLine, obj.ExceptionMessage));
                        }
                        else
                        {
                            form.SetDebugText(obj.SQLCommand);
                        }
                        DialogResult dialogResult = windowService.ShowDialog(form);
                        bool         flag;
                        if (!objectProvider.IsObjectReplaceable)
                        {
                            flag = true;
                        }
                        else
                        {
                            flag = dialogResult != DialogResult.OK;
                        }
                        if (!flag)
                        {
                            objectProvider.ReplaceObject(obj);
                        }
                    }
                }
                else
                {
                    throw new ArgumentNullException("objectProvider");
                }
            }
            else
            {
                throw new ArgumentNullException("windowService");
            }
        }