Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / SaveRecipientRequest.cs / 1 / SaveRecipientRequest.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace Microsoft.InfoCards
{
using System;
using System.IO;
using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace;
//
// Summary
// This class handles requests from the UI which need to save the updated recipient information
//
class SaveRecipientRequest : UIAgentRequest
{
Recipient m_recipient; // recipient to be saved to the store
public SaveRecipientRequest( IntPtr rpcHandle, Stream inArgs, Stream outArgs, ClientUIRequest parent )
: base( rpcHandle, inArgs, outArgs, parent )
{
IDT.Assert( IntPtr.Zero != rpcHandle, "Null RPC handle" );
IDT.Assert( null != inArgs, "Null InArgs" );
IDT.Assert( null != outArgs, "Null outArgs" );
IDT.TraceDebug( "Intiating a request to save the updated recipient object" );
}
protected override void OnInitializeAsSystem()
{
base.OnInitializeAsSystem();
}
//
// Summary
// Deserialize the incoming arguments.
//
// Remarks
// The expected order of data is
// Recipient
//
protected override void OnMarshalInArgs()
{
IDT.Assert( null != InArgs, "Null inArgs" );
m_recipient = new Recipient( InArgs );
}
//
// Summary
// Persist the recipient to the store.
//
protected override void OnProcess()
{
StoreConnection connection = StoreConnection.GetConnection();
try
{
IDT.Assert( null != m_recipient, " Null Recipient" );
connection.BeginTransaction();
try
{
m_recipient.Save( connection );
connection.CommitTransaction();
}
catch
{
connection.RollbackTransaction();
throw;
}
}
finally
{
connection.Close();
}
}
protected override void OnMarshalOutArgs()
{
}
}
}
// 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
- FrameworkTemplate.cs
- ValidationSummary.cs
- TreeSet.cs
- TripleDESCryptoServiceProvider.cs
- IMembershipProvider.cs
- TextPointer.cs
- ServiceBuildProvider.cs
- ping.cs
- CodeValidator.cs
- CodeDirectoryCompiler.cs
- ToolStripKeyboardHandlingService.cs
- SmtpNegotiateAuthenticationModule.cs
- ToolStripSplitButton.cs
- UrlAuthFailedErrorFormatter.cs
- SmtpCommands.cs
- SpeechSynthesizer.cs
- ObjectHandle.cs
- RadioButtonList.cs
- WindowsFormsSynchronizationContext.cs
- ObjectTag.cs
- SqlFileStream.cs
- ContentIterators.cs
- XmlCharCheckingReader.cs
- storepermissionattribute.cs
- HttpModuleActionCollection.cs
- AttributeCollection.cs
- AttributeUsageAttribute.cs
- FtpWebRequest.cs
- XmlCustomFormatter.cs
- ProtocolsConfigurationHandler.cs
- BlobPersonalizationState.cs
- TreeWalkHelper.cs
- DoubleUtil.cs
- BitmapData.cs
- WebServiceTypeData.cs
- ProcessThreadCollection.cs
- DataGridTable.cs
- UnmanagedMemoryStreamWrapper.cs
- TreeNodeClickEventArgs.cs
- CalendarTable.cs
- ServicePrincipalNameElement.cs
- SystemParameters.cs
- StackOverflowException.cs
- GeneralTransformGroup.cs
- XmlDocument.cs
- SqlConnectionHelper.cs
- ProtocolsSection.cs
- TypeDescriptionProvider.cs
- WeakEventManager.cs
- WebEncodingValidatorAttribute.cs
- RootBrowserWindowAutomationPeer.cs
- ContainerAction.cs
- _TransmitFileOverlappedAsyncResult.cs
- PlainXmlDeserializer.cs
- KeyPressEvent.cs
- VolatileResourceManager.cs
- XmlSubtreeReader.cs
- SQLInt64.cs
- SpanIndex.cs
- HashCodeCombiner.cs
- DeclarativeCatalogPart.cs
- DataRowExtensions.cs
- Attributes.cs
- InvariantComparer.cs
- BulletedListEventArgs.cs
- NullExtension.cs
- ExpressionBuilder.cs
- OutputCacheSection.cs
- coordinatorscratchpad.cs
- FastPropertyAccessor.cs
- CqlBlock.cs
- StructuredType.cs
- TextDecorationCollectionConverter.cs
- MissingMethodException.cs
- ListManagerBindingsCollection.cs
- odbcmetadatafactory.cs
- TableCellCollection.cs
- ObjectDataSourceMethodEventArgs.cs
- EndEvent.cs
- ClientScriptManager.cs
- CheckBox.cs
- SkipQueryOptionExpression.cs
- DataGridViewSortCompareEventArgs.cs
- XmlUrlResolver.cs
- XPathAncestorIterator.cs
- MsmqVerifier.cs
- PathFigureCollectionValueSerializer.cs
- TextWriterTraceListener.cs
- TypedTableBaseExtensions.cs
- SqlDependencyListener.cs
- ProcessInputEventArgs.cs
- RotateTransform.cs
- _NegotiateClient.cs
- WinFormsSecurity.cs
- CanonicalFormWriter.cs
- OrCondition.cs
- Parallel.cs
- QilCloneVisitor.cs
- RawStylusInputReport.cs
- CompModHelpers.cs