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
- NavigationCommands.cs
- NavigatorOutput.cs
- PersonalizableTypeEntry.cs
- HtmlShimManager.cs
- XPathParser.cs
- DataControlFieldsEditor.cs
- Shared.cs
- RuntimeHandles.cs
- PathFigureCollectionConverter.cs
- GrammarBuilder.cs
- RichTextBox.cs
- SocketConnection.cs
- CompilerCollection.cs
- PolyBezierSegment.cs
- DbConnectionInternal.cs
- ElementUtil.cs
- IFlowDocumentViewer.cs
- Section.cs
- ComplexPropertyEntry.cs
- Size3D.cs
- FlowLayout.cs
- Matrix3DConverter.cs
- ObjectSet.cs
- TemplateField.cs
- WorkflowWebHostingModule.cs
- TextHintingModeValidation.cs
- ApplicationException.cs
- Brushes.cs
- ExceptionUtil.cs
- SQLChars.cs
- AppDomainShutdownMonitor.cs
- AnchorEditor.cs
- GeneralTransformGroup.cs
- ListItemCollection.cs
- ThrowHelper.cs
- Font.cs
- EventLogStatus.cs
- AdCreatedEventArgs.cs
- FixedFindEngine.cs
- SecurityManager.cs
- WebPartDisplayModeCancelEventArgs.cs
- ResourceAssociationSet.cs
- SqlStream.cs
- WaitForChangedResult.cs
- ContainerControl.cs
- WindowsGraphics2.cs
- CompilerWrapper.cs
- XmlResolver.cs
- ResourcesGenerator.cs
- SqlDataRecord.cs
- AssemblyCollection.cs
- PersonalizationProviderCollection.cs
- AccessDataSource.cs
- TypeConvertions.cs
- Vector3DIndependentAnimationStorage.cs
- BooleanFacetDescriptionElement.cs
- GroupQuery.cs
- WeakHashtable.cs
- Repeater.cs
- EmptyReadOnlyDictionaryInternal.cs
- BridgeDataRecord.cs
- RegistrationServices.cs
- SpecialNameAttribute.cs
- SortedDictionary.cs
- DataControlField.cs
- DependencyPropertyChangedEventArgs.cs
- AnnotationHighlightLayer.cs
- ZipIOModeEnforcingStream.cs
- SocketElement.cs
- Thread.cs
- FunctionNode.cs
- ControlOperationInvoker.cs
- UriTemplateClientFormatter.cs
- StorageEntityTypeMapping.cs
- WebPartDescription.cs
- EventlogProvider.cs
- StateBag.cs
- WebPartUtil.cs
- Route.cs
- TreeNodeStyle.cs
- StateMachineTimers.cs
- configsystem.cs
- ActivityStatusChangeEventArgs.cs
- NoClickablePointException.cs
- SqlMultiplexer.cs
- XmlReflectionImporter.cs
- DataGrid.cs
- AudioFormatConverter.cs
- PersonalizationProvider.cs
- GroupQuery.cs
- PersonalizationStateInfo.cs
- _NegoStream.cs
- ThreadExceptionEvent.cs
- IDReferencePropertyAttribute.cs
- AnimationClockResource.cs
- PipelineModuleStepContainer.cs
- PagePropertiesChangingEventArgs.cs
- MediaEntryAttribute.cs
- assertwrapper.cs
- PriorityQueue.cs