Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / infocard / Service / managed / Microsoft / InfoCards / SetUserPreferenceRequest.cs / 1 / SetUserPreferenceRequest.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace Microsoft.InfoCards
{
using System;
using System.Collections;
using System.IO;
using Microsoft.InfoCards.Diagnostics;
using IDT = Microsoft.InfoCards.Diagnostics.InfoCardTrace;
//
// Summary:
// This class handles the request from the UI Agent to set the user preferences
// object into the store.
//
class SetUserPreferenceRequest : UIAgentRequest
{
UserPreference m_userPreferences;
//
// 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.
// connection - Store connection available to this request.
//
public SetUserPreferenceRequest( 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" );
m_userPreferences = new UserPreference( InArgs );
}
//
// Summary
// Event for processing the user request
//
protected override void OnProcess()
{
IDT.Assert( null != m_userPreferences, "OnMarshalInArgs must be called prior to calling OnProcess" );
StoreConnection connection = StoreConnection.GetConnection();
try
{
connection.BeginTransaction();
try
{
m_userPreferences.Save( connection );
connection.CommitTransaction();
}
catch
{
connection.RollbackTransaction();
throw;
}
}
finally
{
connection.Close();
}
}
//
// Summary
// Event for marshalling the response information
//
// Remarks
// Not used
//
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
- AssertSection.cs
- ResourceProviderFactory.cs
- Win32Native.cs
- ThicknessConverter.cs
- Vector3DAnimation.cs
- Array.cs
- HiddenFieldPageStatePersister.cs
- TransformedBitmap.cs
- WindowClosedEventArgs.cs
- EditingMode.cs
- ObjectDataSourceFilteringEventArgs.cs
- HashLookup.cs
- OleDbFactory.cs
- IndexedGlyphRun.cs
- LinearGradientBrush.cs
- COAUTHIDENTITY.cs
- ImmutableObjectAttribute.cs
- InkSerializer.cs
- PopupRootAutomationPeer.cs
- FormatterServicesNoSerializableCheck.cs
- ManagementClass.cs
- Propagator.cs
- SendingRequestEventArgs.cs
- SchemaExporter.cs
- DoubleLinkList.cs
- DetailsViewInsertedEventArgs.cs
- ValidationHelpers.cs
- CodeLabeledStatement.cs
- ComboBoxRenderer.cs
- EntitySetBaseCollection.cs
- HttpDebugHandler.cs
- SqlConnectionStringBuilder.cs
- DateTimeOffsetAdapter.cs
- InputReportEventArgs.cs
- XmlSchemaValidationException.cs
- DecimalKeyFrameCollection.cs
- SerializationException.cs
- XmlDictionary.cs
- SmiContextFactory.cs
- ColorConverter.cs
- HttpListenerTimeoutManager.cs
- PermissionAttributes.cs
- DocumentViewerBase.cs
- SolidBrush.cs
- XamlVector3DCollectionSerializer.cs
- tooltip.cs
- bidPrivateBase.cs
- CodeCompileUnit.cs
- JpegBitmapDecoder.cs
- XamlFilter.cs
- ClientTargetSection.cs
- ReadOnlyDictionary.cs
- ContentPlaceHolderDesigner.cs
- MediaTimeline.cs
- BaseProcessor.cs
- ReadContentAsBinaryHelper.cs
- Simplifier.cs
- BinHexEncoding.cs
- OciEnlistContext.cs
- JsonReader.cs
- AutomationElement.cs
- SqlDataSourceRefreshSchemaForm.cs
- HostProtectionPermission.cs
- UIElementIsland.cs
- ClrPerspective.cs
- ThumbButtonInfo.cs
- DefaultClaimSet.cs
- MethodRental.cs
- ErrorStyle.cs
- SecurityTokenTypes.cs
- DesignerExtenders.cs
- CodeAccessSecurityEngine.cs
- XPathNavigator.cs
- LambdaCompiler.Binary.cs
- DSACryptoServiceProvider.cs
- GridViewColumnCollection.cs
- TabControl.cs
- PublisherMembershipCondition.cs
- ScrollBarAutomationPeer.cs
- SQLRoleProvider.cs
- SkewTransform.cs
- SimpleHandlerBuildProvider.cs
- relpropertyhelper.cs
- XamlTypeMapper.cs
- SessionIDManager.cs
- BamlResourceContent.cs
- KnownBoxes.cs
- ControlValuePropertyAttribute.cs
- ProxyAttribute.cs
- TextBox.cs
- EncoderExceptionFallback.cs
- Accessible.cs
- HeaderCollection.cs
- QueuePathDialog.cs
- wpf-etw.cs
- EnvironmentPermission.cs
- DataContractJsonSerializer.cs
- WebBrowserEvent.cs
- TreeViewImageKeyConverter.cs
- ConnectionPointCookie.cs