Ejemplo n.º 1
0
 public static void ActivateReflector(MemberHelpInfo hi)
 {
     string assemblyPath = hi.get_AssemblyLocation();
     if (ReflectorPath == null)
     {
         MessageBox.Show("Unable to invoke .NET Reflector (is it installed?)", "LINQPad", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
     }
     else
     {
         if (!IsReflectorRunning())
         {
             WorkingForm.FlashForm("Working...", 0x5dc);
         }
         new Thread(delegate {
             try
             {
                 if (((!string.IsNullOrEmpty(assemblyPath) && File.Exists(assemblyPath)) && !assemblyPath.ToLowerInvariant().Contains(@"\microsoft\framework\")) && !assemblyPath.ToLowerInvariant().Contains(@"\gac_"))
                 {
                     bool flag;
                     string arguments = "/share \"" + assemblyPath + "\"";
                     ProcessStartInfo startInfo = new ProcessStartInfo(ReflectorPath, arguments) {
                         WorkingDirectory = Path.GetDirectoryName(ReflectorPath)
                     };
                     if (flag = IsReflectorRunning())
                     {
                         ShowReflectorWindow();
                     }
                     Process process = Process.Start(startInfo);
                     try
                     {
                         if (!flag)
                         {
                             if (!process.WaitForInputIdle(0x3a98))
                             {
                                 return;
                             }
                             Thread.Sleep(200);
                         }
                         else if (!process.WaitForExit(0x3a98))
                         {
                             return;
                         }
                     }
                     catch
                     {
                     }
                     finally
                     {
                         if (process != null)
                         {
                             process.Dispose();
                         }
                     }
                 }
                 NavigateReflector(hi.get_ReflectorCodeUri());
                 Thread.Sleep(100);
                 ShowReflectorWindow();
             }
             catch (Exception exception)
             {
                 MessageBox.Show("Unable to invoke .NET Reflector: " + exception.Message);
             }
         }) { Name = "Reflector Invoker", IsBackground = true }.Start();
     }
 }
Ejemplo n.º 2
0
        public static void ActivateReflector(MemberHelpInfo hi)
        {
            string assemblyPath = hi.get_AssemblyLocation();

            if (ReflectorPath == null)
            {
                MessageBox.Show("Unable to invoke .NET Reflector (is it installed?)", "LINQPad", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            else
            {
                if (!IsReflectorRunning())
                {
                    WorkingForm.FlashForm("Working...", 0x5dc);
                }
                new Thread(delegate {
                    try
                    {
                        if (((!string.IsNullOrEmpty(assemblyPath) && File.Exists(assemblyPath)) && !assemblyPath.ToLowerInvariant().Contains(@"\microsoft\framework\")) && !assemblyPath.ToLowerInvariant().Contains(@"\gac_"))
                        {
                            bool flag;
                            string arguments           = "/share \"" + assemblyPath + "\"";
                            ProcessStartInfo startInfo = new ProcessStartInfo(ReflectorPath, arguments)
                            {
                                WorkingDirectory = Path.GetDirectoryName(ReflectorPath)
                            };
                            if (flag = IsReflectorRunning())
                            {
                                ShowReflectorWindow();
                            }
                            Process process = Process.Start(startInfo);
                            try
                            {
                                if (!flag)
                                {
                                    if (!process.WaitForInputIdle(0x3a98))
                                    {
                                        return;
                                    }
                                    Thread.Sleep(200);
                                }
                                else if (!process.WaitForExit(0x3a98))
                                {
                                    return;
                                }
                            }
                            catch
                            {
                            }
                            finally
                            {
                                if (process != null)
                                {
                                    process.Dispose();
                                }
                            }
                        }
                        NavigateReflector(hi.get_ReflectorCodeUri());
                        Thread.Sleep(100);
                        ShowReflectorWindow();
                    }
                    catch (Exception exception)
                    {
                        MessageBox.Show("Unable to invoke .NET Reflector: " + exception.Message);
                    }
                })
                {
                    Name = "Reflector Invoker", IsBackground = true
                }.Start();
            }
        }