Ejemplo n.º 1
0
 public bool CodeMarker(int nTimerID)
 {
     if (!this.IsEnabled)
     {
         return(false);
     }
     try
     {
         CodeMarkers.NativeMethods.DllPerfCodeMarker(nTimerID, (byte[])null, 0);
     }
     catch (DllNotFoundException ex)
     {
         this.state = CodeMarkers.State.DisabledDueToDllImportException;
         return(false);
     }
     return(true);
 }
Ejemplo n.º 2
0
 public bool CodeMarkerEx(int nTimerID, byte[] aBuff)
 {
     if (!this.IsEnabled)
     {
         return(false);
     }
     if (aBuff == null)
     {
         throw new ArgumentNullException("aBuff");
     }
     try
     {
         CodeMarkers.NativeMethods.DllPerfCodeMarker(nTimerID, aBuff, aBuff.Length);
     }
     catch (DllNotFoundException ex)
     {
         this.state = CodeMarkers.State.DisabledDueToDllImportException;
         return(false);
     }
     return(true);
 }
Ejemplo n.º 3
0
        public void UninitializePerformanceDLL(int iApp)
        {
            if (!this.IsEnabled)
            {
                return;
            }
            this.state = CodeMarkers.State.Disabled;
            ushort atom = CodeMarkers.NativeMethods.FindAtom("VSCodeMarkersEnabled");

            if ((int)atom != 0)
            {
                int num = (int)CodeMarkers.NativeMethods.DeleteAtom(atom);
            }
            try
            {
                CodeMarkers.NativeMethods.DllUnInitPerf(iApp);
            }
            catch (DllNotFoundException ex)
            {
            }
        }
Ejemplo n.º 4
0
 public bool InitPerformanceDll(int iApp, string strRegRoot, RegistryView registryView)
 {
     if (this.IsEnabled)
     {
         return(true);
     }
     if (!CodeMarkers.UseCodeMarkers(strRegRoot, registryView))
     {
         this.state = CodeMarkers.State.DisabledViaRegistryCheck;
         return(false);
     }
     try
     {
         int num = (int)CodeMarkers.NativeMethods.AddAtom("VSCodeMarkersEnabled");
         CodeMarkers.NativeMethods.DllInitPerf(iApp);
         this.state = CodeMarkers.State.Enabled;
     }
     catch (DllNotFoundException ex)
     {
         this.state = CodeMarkers.State.DisabledDueToDllImportException;
         return(false);
     }
     return(true);
 }
Ejemplo n.º 5
0
 private CodeMarkers()
 {
     this.state = (int)CodeMarkers.NativeMethods.FindAtom("VSCodeMarkersEnabled") != 0 ? CodeMarkers.State.Enabled : CodeMarkers.State.Disabled;
 }