Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / SendAgentStatusRequest.cs / 1 / SendAgentStatusRequest.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.Collections; using System.IO; using System.Threading; using Microsoft.InfoCards.Diagnostics; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // This class handles the request from the UI Agent to set the agent status. // class SendAgentStatusRequest : UIAgentRequest { // // Status must match that in the agent - SendAgentStatusRequest.h // public enum AgentStatusType { AGENT_INITIALIZING = 0, AGENT_DESKTOP_CREATED = 1, AGENT_DESKTOP_SWITCH_OUT = 2, AGENT_DESKTOP_SWITCH_IN = 3, AGENT_SHUTTING_DOWN = 4 }; AgentStatusType m_agentStatus; bool m_retVal; uint m_ATApplicationsFlags; // // Summary: // Constructs a new SendAgentStatusRequest instance. // // Parameters: // rpcHandle - Handle to the RPC call from the UI Agent // inArgs - Stream for the incoming information. Null in this case. // outArgs - Stream used to collect the outbound data. // public SendAgentStatusRequest( IntPtr rpcHandle, Stream inArgs, Stream outArgs, ClientUIRequest parentRequest ) : base( rpcHandle, inArgs, outArgs, parentRequest ) { } // // Summary // Event for marshalling the request information // protected override void OnMarshalInArgs() { IDT.Assert( InArgs.Length > 0, "The agent status must be specified" ); // // Get the current agent status from the InArgs stream // BinaryReader reader = new InfoCardBinaryReader( InArgs, System.Text.Encoding.Unicode ); m_agentStatus = (AgentStatusType) reader.ReadUInt32(); m_ATApplicationsFlags = reader.ReadUInt32(); } // // Summary // Event for processing the user request // protected override void OnProcess() { // // Determine the action based on the status change. // m_retVal = false; switch ( m_agentStatus ) { case AgentStatusType.AGENT_DESKTOP_CREATED: case AgentStatusType.AGENT_DESKTOP_SWITCH_IN: // // Start AT Applications as we know the private desktop is ready. // ParentRequest.StartAccessibilityApplications( m_ATApplicationsFlags ); break; case AgentStatusType.AGENT_DESKTOP_SWITCH_OUT: // // Start processing to kill the AT apps on private desktop and // start up apps on the user desktop. Note that if we get true // as the return value, on vista the agent has to start AT apps // using the WinKey + U sequence. // m_retVal = ParentRequest.RestartAccessibilityApplications(); break; } } // // Summary // Event for marshalling the response information // // Remarks // Nothing. // protected override void OnMarshalOutArgs() { BinaryWriter writer = new BinaryWriter( OutArgs, System.Text.Encoding.Unicode ); writer.Write( m_retVal ); } } } // 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
- PublisherIdentityPermission.cs
- NamedPipeChannelListener.cs
- ClientSponsor.cs
- MemoryRecordBuffer.cs
- ComplexPropertyEntry.cs
- cryptoapiTransform.cs
- ICollection.cs
- SHA1Cng.cs
- SafeNativeMethods.cs
- TypedDataSetSchemaImporterExtension.cs
- OracleParameter.cs
- ExtenderProvidedPropertyAttribute.cs
- LinkLabel.cs
- RawStylusInputCustomDataList.cs
- LocalValueEnumerator.cs
- XmlSchemaDocumentation.cs
- Int64.cs
- ChineseLunisolarCalendar.cs
- InputScope.cs
- TextTreeUndoUnit.cs
- VisualStyleElement.cs
- BulletedListEventArgs.cs
- DecimalStorage.cs
- FixUp.cs
- WSSecurityPolicy12.cs
- ExtensionQuery.cs
- Condition.cs
- LoadMessageLogger.cs
- AlphaSortedEnumConverter.cs
- XmlILOptimizerVisitor.cs
- ParameterCollectionEditorForm.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- UIElementParaClient.cs
- QilLoop.cs
- Rect3D.cs
- SchemaImporterExtensionsSection.cs
- GPRECT.cs
- ScriptingSectionGroup.cs
- ZoneIdentityPermission.cs
- WindowProviderWrapper.cs
- GeometryHitTestParameters.cs
- WS2007FederationHttpBindingElement.cs
- SQLBytes.cs
- PackagePart.cs
- InstanceCompleteException.cs
- DataGridLength.cs
- Predicate.cs
- SqlNotificationEventArgs.cs
- EncoderBestFitFallback.cs
- UriTemplateCompoundPathSegment.cs
- WebControlAdapter.cs
- QueryNode.cs
- ServiceHttpModule.cs
- StructuralCache.cs
- CompModSwitches.cs
- DbUpdateCommandTree.cs
- TypeForwardedToAttribute.cs
- X509Certificate2.cs
- BitConverter.cs
- LinearGradientBrush.cs
- HttpListener.cs
- RouteParametersHelper.cs
- TickBar.cs
- _AcceptOverlappedAsyncResult.cs
- LassoHelper.cs
- DataServiceHost.cs
- Translator.cs
- DefaultPrintController.cs
- AssociationSetMetadata.cs
- WSDualHttpSecurity.cs
- AutomationEvent.cs
- SafeNativeMethodsCLR.cs
- AuthenticateEventArgs.cs
- InfoCardRSACryptoProvider.cs
- TextTreeRootNode.cs
- LoginDesigner.cs
- CalendarDataBindingHandler.cs
- ExpressionEditorAttribute.cs
- CustomAssemblyResolver.cs
- DrawingContextWalker.cs
- AttachmentService.cs
- AssemblyBuilder.cs
- PrinterUnitConvert.cs
- X509Certificate2Collection.cs
- MatrixValueSerializer.cs
- ServerIdentity.cs
- ScriptComponentDescriptor.cs
- SqlFormatter.cs
- BaseTemplateParser.cs
- DbgUtil.cs
- TypeConverter.cs
- StringKeyFrameCollection.cs
- DetailsViewUpdateEventArgs.cs
- UnitySerializationHolder.cs
- TimeIntervalCollection.cs
- ActivityTypeResolver.xaml.cs
- VectorAnimation.cs
- EmptyTextWriter.cs
- SerializationSectionGroup.cs
- ParameterToken.cs