Emveepee.Widgets.ProfileConfiguration.ToArgs C# (CSharp) Method

ToArgs() public method

public ToArgs ( ) : string
return string
        public string ToArgs()
        {
            StringBuilder sb = new StringBuilder ();
            if ((Mode & ProfileMode.Allocations) != 0)
                sb.Append ("alloc");

            if ((Mode & ProfileMode.Instrumented) != 0) {
                if (sb.Length > 0)
                    sb.Append (",");
                sb.Append ("calls");
            }

            if ((Mode & ProfileMode.Statistical) != 0) {
                if (sb.Length > 0)
                    sb.Append (",");
                sb.Append ("s=128");
            }

            if (!StartEnabled)
                sb.Append (",sd");

            return sb.ToString ();
        }

Usage Example

Example #1
0
 public ProfilerProcess(ProfileConfiguration config, Process proc)
 {
     log_file = System.IO.Path.GetTempFileName () + ".mprof";
     this.proc = proc;
     socket = new ProfilerSocket ();
     socket.Paused += delegate { OnPaused (); };
     if (config.TargetPath.EndsWith (".exe")) {
         proc.StartInfo.FileName = "mono";
         proc.StartInfo.Arguments = "--profile=logging:" + config.ToArgs () + ",o=" + log_file + ",cp=" + socket.Port.ToString () + " " + config.TargetPath;
     } else if (config.TargetPath.EndsWith (".aspx")) {
         proc.StartInfo.FileName = "xsp2";
         proc.StartInfo.EnvironmentVariables.Add ("MONO_OPTIONS", "--profile=logging:" + config.ToArgs () + ",o=" + log_file + ",cp=" + socket.Port.ToString ());
         proc.StartInfo.Arguments = "--nonstop --port 8080 --root " + System.IO.Path.GetDirectoryName (config.TargetPath);
         proc.StartInfo.UseShellExecute = false;
     }
     proc.EnableRaisingEvents = true;
     proc.Exited += delegate { OnExited (); };
 }
All Usage Examples Of Emveepee.Widgets.ProfileConfiguration::ToArgs