spelling: locals in src/Microsoft.PowerShell.Workflow.ServiceCore

This commit is contained in:
Josh Soref committed 2016-09-01 15:43:37 +00:00
1 parent 4d84d92953
commit c8dde73d15
12 files changed
+35 -35

No files matched your search

@@ -208,8 +208,8 @@ namespace Microsoft.PowerShell.Workflow
using (System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create()) using (System.Management.Automation.PowerShell ps = System.Management.Automation.PowerShell.Create())
{ {
ps.Runspace = runspace; ps.Runspace = runspace;
string langSript = "$ExecutionContext.SessionState.LanguageMode = '" + _languageMode.Value.ToString() + "'"; string langScript = "$ExecutionContext.SessionState.LanguageMode = '" + _languageMode.Value.ToString() + "'";
ps.AddScript(langSript); ps.AddScript(langScript);
ps.Invoke(); ps.Invoke();
} }
} }
@@ -1491,7 +1491,7 @@ namespace Microsoft.PowerShell.Workflow
Connection newConnection = CreateConnection(requestInfo, connections); Connection newConnection = CreateConnection(requestInfo, connections);
_perfCountersMgr.UpdateCounterByValue( _perfCountersMgr.UpdateCounterByValue(
PSWorkflowPerformanceCounterSetInfo.CounterSetId, PSWorkflowPerformanceCounterSetInfo.CounterSetId,
PSWorkflowPerformanceCounterIds.PSRemotingConnectionsClosedReopendCount); PSWorkflowPerformanceCounterIds.PSRemotingConnectionsClosedReopenedCount);
SubmitOperation(new CloseOneAndOpenAnotherOperation(potentialConnection, newConnection)); SubmitOperation(new CloseOneAndOpenAnotherOperation(potentialConnection, newConnection));
_perfCountersMgr.UpdateCounterByValue( _perfCountersMgr.UpdateCounterByValue(
PSWorkflowPerformanceCounterSetInfo.CounterSetId, PSWorkflowPerformanceCounterSetInfo.CounterSetId,
@@ -22,7 +22,7 @@ namespace Microsoft.PowerShell.Workflow
/// <summary> /// <summary>
/// The additional entry for security 'POWERSHELLWORKFLOW' /// The additional entry for security 'POWERSHELLWORKFLOW'
/// </summary> /// </summary>
private static byte[] s_aditionalEntropy = { (byte)'P', (byte)'O', (byte)'W', (byte)'E', (byte)'R', (byte)'S', (byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'W', (byte)'O', (byte)'R', (byte)'K', (byte)'F', (byte)'L', (byte)'O', (byte)'W' }; private static byte[] s_additionalEntropy = { (byte)'P', (byte)'O', (byte)'W', (byte)'E', (byte)'R', (byte)'S', (byte)'H', (byte)'E', (byte)'L', (byte)'L', (byte)'W', (byte)'O', (byte)'R', (byte)'K', (byte)'F', (byte)'L', (byte)'O', (byte)'W' };
/// <summary> /// <summary>
/// Protect the data. /// Protect the data.
@@ -35,7 +35,7 @@ namespace Microsoft.PowerShell.Workflow
{ {
// Encrypt the data using DataProtectionScope.CurrentUser. The result can be decrypted // Encrypt the data using DataProtectionScope.CurrentUser. The result can be decrypted
// only by the same current user. // only by the same current user.
return ProtectedData.Protect(data, s_aditionalEntropy, DataProtectionScope.CurrentUser); return ProtectedData.Protect(data, s_additionalEntropy, DataProtectionScope.CurrentUser);
} }
catch (CryptographicException e) catch (CryptographicException e)
{ {
@@ -54,7 +54,7 @@ namespace Microsoft.PowerShell.Workflow
{ {
try try
{ {
return ProtectedData.Unprotect(data, s_aditionalEntropy, DataProtectionScope.CurrentUser); return ProtectedData.Unprotect(data, s_additionalEntropy, DataProtectionScope.CurrentUser);
} }
catch (CryptographicException e) catch (CryptographicException e)
{ {
@@ -19,19 +19,19 @@ namespace Microsoft.PowerShell.Workflow
internal static void SetDirectoryPermissions(string folderName) internal static void SetDirectoryPermissions(string folderName)
{ {
string account = WindowsIdentity.GetCurrent().Name; string account = WindowsIdentity.GetCurrent().Name;
RemoveInheritablePermissons(folderName); RemoveInheritablePermissions(folderName);
AddDirectorySecurity(folderName, account, FileSystemRights.Modify, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow); AddDirectorySecurity(folderName, account, FileSystemRights.Modify, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow);
} }
private static void AddDirectorySecurity(string folderName, string account, FileSystemRights rights, InheritanceFlags inheritance, PropagationFlags propogation, AccessControlType controlType) private static void AddDirectorySecurity(string folderName, string account, FileSystemRights rights, InheritanceFlags inheritance, PropagationFlags propagation, AccessControlType controlType)
{ {
DirectoryInfo info = new DirectoryInfo(folderName); DirectoryInfo info = new DirectoryInfo(folderName);
DirectorySecurity dSecurity = info.GetAccessControl(); DirectorySecurity dSecurity = info.GetAccessControl();
dSecurity.AddAccessRule(new FileSystemAccessRule(account, rights, inheritance, propogation, controlType)); dSecurity.AddAccessRule(new FileSystemAccessRule(account, rights, inheritance, propagation, controlType));
info.SetAccessControl(dSecurity); info.SetAccessControl(dSecurity);
} }
private static void RemoveInheritablePermissons(string folderName) private static void RemoveInheritablePermissions(string folderName)
{ {
DirectoryInfo info = new DirectoryInfo(folderName); DirectoryInfo info = new DirectoryInfo(folderName);
DirectorySecurity dSecurity = info.GetAccessControl(); DirectorySecurity dSecurity = info.GetAccessControl();
@@ -3121,13 +3121,13 @@ namespace Microsoft.PowerShell.Activities
} }
else else
{ {
PSOutOfProcessActivityController delgateController = workflowHost.PSActivityHostController as PSOutOfProcessActivityController; PSOutOfProcessActivityController delegateController = workflowHost.PSActivityHostController as PSOutOfProcessActivityController;
if (delgateController != null) if (delegateController != null)
{ {
AddHandlersToStreams(commandToRun, args); AddHandlersToStreams(commandToRun, args);
IAsyncResult asyncResult = IAsyncResult asyncResult =
delgateController.BeginInvokePowerShell(commandToRun, input, delegateController.BeginInvokePowerShell(commandToRun, input,
output, output,
implementationContext.PSActivityEnvironment, implementationContext.PSActivityEnvironment,
ActivityHostManagerCallback, ActivityHostManagerCallback,
@@ -593,7 +593,7 @@ namespace Microsoft.PowerShell.Workflow
/// <summary> /// <summary>
/// On suspended handler. /// On suspended handler.
/// </summary> /// </summary>
internal Action<object> OnSuspenedDelegate internal Action<object> OnSuspendedDelegate
{ {
set { this.OnSuspended = value; } set { this.OnSuspended = value; }
} }
@@ -998,7 +998,7 @@ namespace Microsoft.PowerShell.Workflow
debugSource = new DebugSource( debugSource = new DebugSource(
debugSource.Script, // Update script debugSource.Script, // Update script
debugSource.ScriptFile, // Update script filename debugSource.ScriptFile, // Update script filename
existingInfo.XamlDefinition); // Keep XamlDefintion existingInfo.XamlDefinition); // Keep XamlDefinition
} }
funcToSourceMap.Add(fName, debugSource); funcToSourceMap.Add(fName, debugSource);
@@ -234,13 +234,13 @@ namespace Microsoft.PowerShell.Workflow
lock (_syncObject) lock (_syncObject)
{ {
Dictionary<int, Tuple<object, string>> ruspaceIdCollection; Dictionary<int, Tuple<object, string>> runspaceIdCollection;
if (_remoteRunspaceIdCollection.TryGetValue(activityId, out ruspaceIdCollection)) if (_remoteRunspaceIdCollection.TryGetValue(activityId, out runspaceIdCollection))
{ {
if (ruspaceIdCollection != null) if (runspaceIdCollection != null)
{ {
Tuple<object, string> taskTuple; Tuple<object, string> taskTuple;
ruspaceIdCollection.TryGetValue(taskId, out taskTuple); runspaceIdCollection.TryGetValue(taskId, out taskTuple);
if (taskTuple != null) if (taskTuple != null)
taskRunspaceId = taskTuple.Item1; taskRunspaceId = taskTuple.Item1;
@@ -2009,22 +2009,22 @@ namespace Microsoft.PowerShell.Workflow
this.workflowApplication.Extensions.Add(this.GetTrackingParticipant()); this.workflowApplication.Extensions.Add(this.GetTrackingParticipant());
// adding the custom extensions // adding the custom extensions
IEnumerable<object> extentions = this.Runtime.Configuration.CreateWorkflowExtensions(); IEnumerable<object> extensions = this.Runtime.Configuration.CreateWorkflowExtensions();
if (extentions != null) if (extensions != null)
{ {
foreach (object extention in extentions) foreach (object extension in extensions)
{ {
this.workflowApplication.Extensions.Add(extention); this.workflowApplication.Extensions.Add(extension);
} }
} }
// adding the custom extension creation functions // adding the custom extension creation functions
IEnumerable<Func<object>> extentionFunctions = this.Runtime.Configuration.CreateWorkflowExtensionCreationFunctions<object>(); IEnumerable<Func<object>> extensionFunctions = this.Runtime.Configuration.CreateWorkflowExtensionCreationFunctions<object>();
if (extentionFunctions != null) if (extensionFunctions != null)
{ {
foreach(Func<object> extentionFunc in extentionFunctions) foreach(Func<object> extensionFunc in extensionFunctions)
{ {
this.workflowApplication.Extensions.Add<object>(extentionFunc); this.workflowApplication.Extensions.Add<object>(extensionFunc);
} }
} }
@@ -1327,7 +1327,7 @@ namespace Microsoft.PowerShell.Workflow
internal void ConfigureWorkflowHandlers() internal void ConfigureWorkflowHandlers()
{ {
_workflowInstance.OnCompletedDelegate = OnWorkflowCompleted; _workflowInstance.OnCompletedDelegate = OnWorkflowCompleted;
_workflowInstance.OnSuspenedDelegate = OnWorkflowSuspended; _workflowInstance.OnSuspendedDelegate = OnWorkflowSuspended;
_workflowInstance.OnStoppedDelegate = OnWorkflowStopped; _workflowInstance.OnStoppedDelegate = OnWorkflowStopped;
_workflowInstance.OnAbortedDelegate = OnWorkflowAborted; _workflowInstance.OnAbortedDelegate = OnWorkflowAborted;
_workflowInstance.OnFaultedDelegate = OnWorkflowFaulted; _workflowInstance.OnFaultedDelegate = OnWorkflowFaulted;
@@ -166,15 +166,15 @@ namespace Microsoft.PowerShell.Workflow
{ {
foreach (PSWorkflowJob job in newJob.ChildJobs) foreach (PSWorkflowJob job in newJob.ChildJobs)
{ {
bool? psPersitValue = null; bool? psPersistValue = null;
PSWorkflowContext context = job.PSWorkflowInstance.PSWorkflowContext; PSWorkflowContext context = job.PSWorkflowInstance.PSWorkflowContext;
if (context != null && context.PSWorkflowCommonParameters != null && context.PSWorkflowCommonParameters.ContainsKey(Constants.Persist)) if (context != null && context.PSWorkflowCommonParameters != null && context.PSWorkflowCommonParameters.ContainsKey(Constants.Persist))
{ {
psPersitValue = context.PSWorkflowCommonParameters[Constants.Persist] as bool?; psPersistValue = context.PSWorkflowCommonParameters[Constants.Persist] as bool?;
} }
// check for invocation time pspersist value if not true then there is a possibility that workflow is not suspendable. // check for invocation time pspersist value if not true then there is a possibility that workflow is not suspendable.
if (psPersitValue == null || (psPersitValue == false)) if (psPersistValue == null || (psPersistValue == false))
{ {
// check for authoring time definition of persist activity // check for authoring time definition of persist activity
if (isSuspendable != null && isSuspendable.Value == false) if (isSuspendable != null && isSuspendable.Value == false)
@@ -1392,8 +1392,8 @@ namespace Microsoft.PowerShell.Workflow
{ {
if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA) if (Thread.CurrentThread.GetApartmentState() == ApartmentState.STA)
{ {
foreach (WaitHandle hanlde in waitHandles) foreach (WaitHandle handle in waitHandles)
hanlde.WaitOne(); handle.WaitOne();
} }
else else
{ {
@@ -56,7 +56,7 @@ namespace Microsoft.PowerShell.Workflow
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingForcedToWaitRequestsQueueLength, CounterType.RawData64), new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingForcedToWaitRequestsQueueLength, CounterType.RawData64),
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsCreatedCount, CounterType.RawData64), new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsCreatedCount, CounterType.RawData64),
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsDisposedCount, CounterType.RawData64), new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsDisposedCount, CounterType.RawData64),
new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsClosedReopendCount, CounterType.RawData64) new CounterInfo(PSWorkflowPerformanceCounterIds.PSRemotingConnectionsClosedReopenedCount, CounterType.RawData64)
}; };
} }
@@ -100,7 +100,7 @@ namespace Microsoft.PowerShell.Workflow
internal const int PSRemotingForcedToWaitRequestsQueueLength = PSRemotingRequestsBeingServicedCount + 1; internal const int PSRemotingForcedToWaitRequestsQueueLength = PSRemotingRequestsBeingServicedCount + 1;
internal const int PSRemotingConnectionsCreatedCount = PSRemotingForcedToWaitRequestsQueueLength + 1; internal const int PSRemotingConnectionsCreatedCount = PSRemotingForcedToWaitRequestsQueueLength + 1;
internal const int PSRemotingConnectionsDisposedCount = PSRemotingConnectionsCreatedCount + 1; internal const int PSRemotingConnectionsDisposedCount = PSRemotingConnectionsCreatedCount + 1;
internal const int PSRemotingConnectionsClosedReopendCount = PSRemotingConnectionsDisposedCount + 1; internal const int PSRemotingConnectionsClosedReopenedCount = PSRemotingConnectionsDisposedCount + 1;
}; };