Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / GetLedgerEntryForRecipientRequest.cs / 1 / GetLedgerEntryForRecipientRequest.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace Microsoft.InfoCards { using System; using System.IO; using System.Text; using System.Collections; using System.Collections.Generic; using Microsoft.InfoCards.Diagnostics; using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace; // // Summary: // This class handles the request from the UI Agent to get the Ledger information // for a specific recipient. // class GetLedgerEntryForRecipientRequest : UIAgentRequest { Uri m_cardId; string m_recipientId; byte[] m_bytes; // // Summary: // Constructs a new SetUserPreferenceRequest 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. // parent - Client UI Request. // public GetLedgerEntryForRecipientRequest( IntPtr rpcHandle, Stream inArgs, Stream outArgs, ClientUIRequest parent ) : base( rpcHandle, inArgs, outArgs, parent ) { } // // Summary // Event for marshalling the request information // protected override void OnMarshalInArgs() { IDT.Assert( InArgs.Length > 0, "The user preferences must be specified" ); BinaryReader br = new InfoCardBinaryReader( InArgs, Encoding.Unicode ); m_cardId = Utility.DeserializeUri( br ); m_recipientId = Utility.DeserializeString( br ); } // // Summary // Event for processing the user request // protected override void OnProcess() { IDT.Assert( null != m_cardId, "The card Id must not be null" ); IDT.Assert( false == String.IsNullOrEmpty( m_recipientId ), "The thumbPrint must be specified" ); ListparamList = new List (); QueryParameter query = new QueryParameter( SecondaryIndexDefinition.ObjectTypeIndex, (Int32)StorableObjectType.LedgerEntry ); paramList.Add( query ); query = new QueryParameter( SecondaryIndexDefinition.ParentIdIndex, GlobalId.DeriveFrom( m_cardId.ToString() ) ); paramList.Add( query ); paramList.Add( new QueryParameter( SecondaryIndexDefinition.RecipientIdIndex, m_recipientId ) ); StoreConnection connection = StoreConnection.GetConnection(); try { // // There should be only one row of this type for each recipient. So just return the first one. // DataRow row = connection.GetSingleRow( paramList.ToArray() ); if( null != row ) { m_bytes = row.GetDataField(); } } finally { connection.Close(); } } // // Summary // Event for marshalling the response information // // Remarks // Write nothing if the ledger entry is not found. // protected override void OnMarshalOutArgs() { if( null != m_bytes ) { OutArgs.Write( m_bytes, 0, m_bytes.Length ); } } } } // 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
- RSAOAEPKeyExchangeFormatter.cs
- ConfigurationLocation.cs
- CreateUserErrorEventArgs.cs
- keycontainerpermission.cs
- OutOfProcStateClientManager.cs
- FrameworkElementFactoryMarkupObject.cs
- LinkedResourceCollection.cs
- Parsers.cs
- MessageFormatterConverter.cs
- InvariantComparer.cs
- CodeParameterDeclarationExpressionCollection.cs
- AnimationException.cs
- SystemIPInterfaceProperties.cs
- BuildDependencySet.cs
- CanonicalizationDriver.cs
- TextTreePropertyUndoUnit.cs
- TdsParser.cs
- DataGridViewComboBoxEditingControl.cs
- OutputCacheSettings.cs
- FormsIdentity.cs
- CacheRequest.cs
- SystemIPGlobalStatistics.cs
- XmlCustomFormatter.cs
- XmlEntity.cs
- FixedLineResult.cs
- InternalResources.cs
- QuadraticBezierSegment.cs
- DesignTimeParseData.cs
- CodeArrayIndexerExpression.cs
- PathParser.cs
- InkCanvasInnerCanvas.cs
- XmlDataFileEditor.cs
- WebBrowserUriTypeConverter.cs
- DataGridViewLinkColumn.cs
- StylusDownEventArgs.cs
- SignedPkcs7.cs
- PersistenceParticipant.cs
- UriSection.cs
- FrameworkContentElement.cs
- Mapping.cs
- EntityCommand.cs
- Frame.cs
- ApplicationSecurityManager.cs
- DbDataAdapter.cs
- ConfigsHelper.cs
- ProfileSettings.cs
- NullRuntimeConfig.cs
- ELinqQueryState.cs
- DataGridCell.cs
- FlowPosition.cs
- ComplexTypeEmitter.cs
- LogicalExpressionTypeConverter.cs
- IssuanceLicense.cs
- FixedSOMTextRun.cs
- nulltextnavigator.cs
- DataGridViewSelectedRowCollection.cs
- EdmEntityTypeAttribute.cs
- ScriptResourceAttribute.cs
- CustomAttributeBuilder.cs
- ProgressBarBrushConverter.cs
- UtilityExtension.cs
- InvalidFilterCriteriaException.cs
- entitydatasourceentitysetnameconverter.cs
- Accessible.cs
- SynchronizationFilter.cs
- InvokeGenerator.cs
- AnnotationResourceCollection.cs
- RepeaterItemCollection.cs
- ClientOptions.cs
- ContentPosition.cs
- KeyboardDevice.cs
- SessionStateSection.cs
- TextElementAutomationPeer.cs
- EventManager.cs
- TraceLevelStore.cs
- ChannelPool.cs
- IBuiltInEvidence.cs
- cookiecontainer.cs
- ExpandCollapseProviderWrapper.cs
- AlphaSortedEnumConverter.cs
- OutputCacheModule.cs
- DataGridViewComboBoxCell.cs
- MatrixAnimationBase.cs
- ExceptionNotification.cs
- RewritingValidator.cs
- TempFiles.cs
- UInt64Converter.cs
- DataGridViewSortCompareEventArgs.cs
- ImageListImageEditor.cs
- RedBlackList.cs
- SystemNetworkInterface.cs
- XmlAttributeOverrides.cs
- GuidConverter.cs
- MenuAutomationPeer.cs
- SqlDataSourceSelectingEventArgs.cs
- ConstraintCollection.cs
- Rotation3DKeyFrameCollection.cs
- WindowsTreeView.cs
- TransactionManagerProxy.cs
- RuleSettingsCollection.cs