Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / UIAgentMonitorHandle.cs / 1 / UIAgentMonitorHandle.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- // // Presharp uses the c# pragma mechanism to supress its warnings. // These are not recognised by the base compiler so we need to explictly // disable the following warnings. See http://winweb/cse/Tools/PREsharp/userguide/default.asp // for details. // #pragma warning disable 1634, 1691 // unknown message, unknown pragma namespace Microsoft.InfoCards { using System; using System.Collections.Generic; using System.Security.Principal; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary // This class manages the entry and deletion of a UIAgent from the UIAgent monitor which prevents a UIAgent // from being created if one already exists either for this user or for this TS session. // class UIAgentMonitorHandle : IDisposable { InfoCardUIAgent m_agent; string m_username; int m_tsSessionId; public UIAgentMonitorHandle() { } public string UserName { get { return m_username; } } public int TsSessionId { get { return m_tsSessionId; } } // // Summary // Creates an InfoCard UIAgent if and only if there are no agent currently servicing this user or this // TS session. // // Parameters // callerPid - the pid of the calling process. // callerIdenity - the id of the calling process. // tsSessionId - the TS session id of the calling process. // public InfoCardUIAgent CreateAgent( int callerPid, WindowsIdentity callerIdentity, int tsSessionId ) { m_username = callerIdentity.User.ToString(); m_tsSessionId = tsSessionId; // // This call will throw if a UIAgent is already active for this user or TS session. // UIAgentMonitor.Instance().AddNewClient( this ); m_agent = InfoCardUIAgent.Create( callerPid, callerIdentity, tsSessionId ); return m_agent; } void IDisposable.Dispose() { // // Remove this instance from the monitor. // UIAgentMonitor.Instance().RemoveClient( this ); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- TemplateField.cs
- InternalTypeHelper.cs
- SiteMapPathDesigner.cs
- TextDecorationLocationValidation.cs
- Version.cs
- CompoundFileStorageReference.cs
- MarkerProperties.cs
- WebPartTransformerAttribute.cs
- GraphicsState.cs
- BindingContext.cs
- DESCryptoServiceProvider.cs
- LayoutInformation.cs
- DrawingGroup.cs
- SupportsEventValidationAttribute.cs
- SoapExtensionImporter.cs
- SettingsProperty.cs
- SourceFileBuildProvider.cs
- Stylesheet.cs
- ListItem.cs
- SurrogateEncoder.cs
- SafeBitVector32.cs
- Errors.cs
- OdbcInfoMessageEvent.cs
- TabControlAutomationPeer.cs
- PropertyValue.cs
- XmlWriterTraceListener.cs
- FieldToken.cs
- DataGridViewColumnTypePicker.cs
- Style.cs
- GeometryHitTestParameters.cs
- TextRangeSerialization.cs
- GridSplitter.cs
- AdPostCacheSubstitution.cs
- ImageField.cs
- ToolStripDropDownClosedEventArgs.cs
- XmlFormatExtensionAttribute.cs
- OrCondition.cs
- WCFModelStrings.Designer.cs
- WebPartEditorOkVerb.cs
- TimeManager.cs
- DataGridItemCollection.cs
- GraphicsContext.cs
- SoapTypeAttribute.cs
- MetaForeignKeyColumn.cs
- SchemaInfo.cs
- IsolatedStorageFile.cs
- ResourceContainer.cs
- CheckBoxField.cs
- DataSourceControlBuilder.cs
- SelectorAutomationPeer.cs
- Span.cs
- ObfuscateAssemblyAttribute.cs
- SkewTransform.cs
- PersistenceTypeAttribute.cs
- EntityKeyElement.cs
- TransformCollection.cs
- SecurityContext.cs
- TreeNodeBinding.cs
- DependsOnAttribute.cs
- AuthenticationService.cs
- ToggleProviderWrapper.cs
- JoinGraph.cs
- BindingCompleteEventArgs.cs
- Win32Interop.cs
- RectAnimationUsingKeyFrames.cs
- IEnumerable.cs
- UserNameSecurityToken.cs
- LabelLiteral.cs
- RIPEMD160Managed.cs
- AdCreatedEventArgs.cs
- MsmqIntegrationProcessProtocolHandler.cs
- EntityContainer.cs
- SafeViewOfFileHandle.cs
- DBParameter.cs
- ByteConverter.cs
- NamespaceInfo.cs
- OracleConnection.cs
- SymbolPair.cs
- SourceCollection.cs
- ObjectItemCachedAssemblyLoader.cs
- ZipIOExtraFieldPaddingElement.cs
- UserControl.cs
- DBDataPermission.cs
- CheckBoxAutomationPeer.cs
- TextStore.cs
- BitmapEffectInputData.cs
- UnsafeNativeMethods.cs
- RangeValuePattern.cs
- DataTemplate.cs
- WindowsGraphicsWrapper.cs
- XmlWrappingReader.cs
- StructuredTypeInfo.cs
- XPathMultyIterator.cs
- Keywords.cs
- Compilation.cs
- ClientTargetCollection.cs
- VectorAnimationUsingKeyFrames.cs
- EditorBrowsableAttribute.cs
- XmlDataSourceDesigner.cs
- MemberInitExpression.cs