Ejemplo n.º 1
0
 public static RunTimeTracker GetInstance(ExpressionApplication application)
 {
     if (RunTimeTracker.instance == null)
     {
         RunTimeTracker.instance = new RunTimeTracker(application);
         RunTimeTracker.instance.CheckRunTimeState();
     }
     return(RunTimeTracker.instance);
 }
Ejemplo n.º 2
0
        private bool CreateFeedbackSession(ExpressionApplication application)
        {
            if (string.IsNullOrEmpty(this.LoggingFileName))
            {
                this.LoggingFileName = "MySqmSession";
            }
            this.sqmSessionHandle = UnsafeNativeMethods.GetSession(this.LoggingFileName, 65536U, 1U);
            if (this.sqmSessionHandle == null)
            {
                Marshal.GetLastWin32Error();
                return(false);
            }
            if (this.sqmSessionHandle.IsInvalid)
            {
                return(false);
            }
            if (!UnsafeNativeMethods.SetAppId(this.sqmSessionHandle, (uint)application.CustomerFeedbackApplicationIdentifier))
            {
                Marshal.GetLastWin32Error();
                return(false);
            }
            Version version = ExpressionApplication.Version;

            if (!UnsafeNativeMethods.SetAppVersion(this.sqmSessionHandle, (uint)((version.Major << 16) + version.Minor), (uint)((version.Build << 16) + version.Revision)))
            {
                Marshal.GetLastWin32Error();
                return(false);
            }
            if (!UnsafeNativeMethods.ReadSharedMachineId(ref this.sharedMachineId) && !UnsafeNativeMethods.CreateNewId(ref this.sharedMachineId))
            {
                UnsafeNativeMethods.WriteSharedMachineId(ref this.sharedMachineId);
            }
            UnsafeNativeMethods.SetMachineId(this.sqmSessionHandle, ref this.sharedMachineId);
            if (!UnsafeNativeMethods.ReadSharedUserId(ref this.sharedUserId) && !UnsafeNativeMethods.CreateNewId(ref this.sharedUserId))
            {
                UnsafeNativeMethods.WriteSharedUserId(ref this.sharedUserId);
            }
            UnsafeNativeMethods.SetUserId(this.sqmSessionHandle, ref this.sharedUserId);
            return(true);
        }
Ejemplo n.º 3
0
 private RunTimeTracker(ExpressionApplication application)
 {
     this.application = application;
 }
Ejemplo n.º 4
0
 public FeedbackService(ExpressionApplication application)
 {
     this.services          = application.Services;
     this.parentApplication = application;
     this.Timeout           = 30000;
 }