コード例 #1
0
 public PswsTimer(ElapsedEventHandler elapsedEventHandler, int timeout, bool continuous, bool startAtCreation)
 {
     this.timeout             = new BoundedInteger(timeout, 1, 0x7fffffff);
     this.elapsedEventHandler = elapsedEventHandler;
     this.continuous          = continuous;
     this.timer    = PswsTimer.CreateTimer(elapsedEventHandler, this.timeout.Value, this.continuous, startAtCreation);
     this.disposed = false;
 }
コード例 #2
0
ファイル: CacheController.cs プロジェクト: nickchal/pash
		protected virtual void Dispose(bool disposeManagedResources)
		{
			if (!this.disposed && disposeManagedResources && this.timer != null)
			{
				this.timer.Dispose();
				this.timer = null;
			}
			this.disposed = true;
		}
コード例 #3
0
ファイル: CacheController.cs プロジェクト: modulexcite/pash-1
 protected virtual void Dispose(bool disposeManagedResources)
 {
     if (!this.disposed && disposeManagedResources && this.timer != null)
     {
         this.timer.Dispose();
         this.timer = null;
     }
     this.disposed = true;
 }
コード例 #4
0
ファイル: PSCommand.cs プロジェクト: nickchal/pash
		public PSCommand(Envelope<PSRunspace, UserContext> runspace, ResourceType entityType, PSCmdletInfo cmdletInfo, CommandType commandType = (CommandType)1)
		{
			this.syncObject = new object();
			this.runspace = runspace;
			this.cmdletInfo = cmdletInfo;
			this.entityType = entityType;
			this.parameters = new Dictionary<string, object>();
			this.powerShell = null;
			this.timer = new PswsTimer(new ElapsedEventHandler(this.TimerCallback), DataServiceController.Current.Configuration.PowerShell.Quotas.MaxExecutionTime, false, false);
			this.commandType = commandType;
		}
コード例 #5
0
ファイル: CacheController.cs プロジェクト: nickchal/pash
		public CacheController(int timeout)
		{
			this.syncObject = new object();
			this.timer = new PswsTimer(new ElapsedEventHandler(this.OnElapsedEvent), timeout);
			this.caches = new HashSet<Cache>();
		}
コード例 #6
0
ファイル: PSCommand.cs プロジェクト: nickchal/pash
		protected virtual void Dispose(bool disposeManagedResources)
		{
			if (!this.disposed && disposeManagedResources)
			{
				if (this.runspace != null)
				{
					this.runspace.Store.Return(this.runspace);
					this.runspace = null;
				}
				if (this.timer != null)
				{
					this.timer.Dispose();
					this.timer = null;
				}
			}
			this.disposed = true;
		}
コード例 #7
0
ファイル: PipelineInvocation.cs プロジェクト: nickchal/pash
		protected virtual void Dispose(bool disposeManagedResources)
		{
			if (!this.disposed && disposeManagedResources)
			{
				if (this.runspace != null)
				{
					this.runspace.Store.Return(this.runspace);
				}
				if (this.executionToken != null)
				{
					this.executionToken.Release();
					this.executionToken = null;
				}
				if (this.timer != null)
				{
					this.timer.Dispose();
					this.timer = null;
				}
				if (this.userCacheLocked)
				{
					DataServiceController.Current.UserDataCache.TryUnlockKey(this.runspace.Borrower);
					this.userCacheLocked = false;
				}
			}
			this.disposed = true;
		}
コード例 #8
0
ファイル: PipelineInvocation.cs プロジェクト: nickchal/pash
		public PipelineInvocation(Envelope<PSRunspace, UserContext> runspace, ResourceType entityType)
		{
			UserData userDatum = null;
			this.runspace = runspace;
			this.entityType = entityType;
			this.ID = Guid.NewGuid();
			this.Status = PipelineState.Executing;
			this.WaitMsec = 0;
			this.OutputFormat = null;
			this.ExpirationTime = DateTimeHelper.UtcNow;
			this.outputQuotaExceeded = false;
			this.outputObjects = new PSDataCollection<PSObject>();
			this.Errors = new Collection<ErrorRecord>();
			this.finished = new ManualResetEvent(false);
			this.TestHookCompletionCallback = new AsyncCallback(this.AsyncCallback);
			if (runspace != null)
			{
				this.executionToken = DataServiceController.Current.GetAuthorizedUserIdentity(runspace.Borrower);
				this.executionToken.AddRef();
				DataServiceController.Current.UserDataCache.TryLockKey(runspace.Borrower, out userDatum);
				this.userCacheLocked = true;
			}
			this.timer = new PswsTimer(new ElapsedEventHandler(this.TimerCallback), DataServiceController.Current.Configuration.PowerShell.Quotas.MaxExecutionTime, false, false);
		}
コード例 #9
0
ファイル: CacheController.cs プロジェクト: modulexcite/pash-1
 public CacheController(int timeout)
 {
     this.syncObject = new object();
     this.timer      = new PswsTimer(new ElapsedEventHandler(this.OnElapsedEvent), timeout);
     this.caches     = new HashSet <Cache>();
 }