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
- IdentitySection.cs
- FigureParagraph.cs
- OpenTypeLayout.cs
- WebPartCollection.cs
- MemberMaps.cs
- TextHidden.cs
- InputReferenceExpression.cs
- SkipStoryboardToFill.cs
- OlePropertyStructs.cs
- Baml2006ReaderContext.cs
- WebBrowserDocumentCompletedEventHandler.cs
- SelectedDatesCollection.cs
- PixelShader.cs
- InheritanceContextHelper.cs
- ToolStripProgressBar.cs
- ProxyHwnd.cs
- AxHost.cs
- TextRangeEditTables.cs
- WeakHashtable.cs
- SymbolEqualComparer.cs
- TableHeaderCell.cs
- Highlights.cs
- CollectionContainer.cs
- MetadataExporter.cs
- BuilderPropertyEntry.cs
- TransformerConfigurationWizardBase.cs
- FixedSOMGroup.cs
- CodeCompileUnit.cs
- HttpWebResponse.cs
- CheckBoxPopupAdapter.cs
- Vector3dCollection.cs
- AttributeInfo.cs
- CodeAttributeDeclarationCollection.cs
- DesignerVerbToolStripMenuItem.cs
- SapiInterop.cs
- SmiEventSink_Default.cs
- FileDialog_Vista_Interop.cs
- AttachInfo.cs
- InputLangChangeRequestEvent.cs
- ListViewItem.cs
- BrushConverter.cs
- ProtectedProviderSettings.cs
- Attachment.cs
- Overlapped.cs
- GregorianCalendar.cs
- AppearanceEditorPart.cs
- TypeReference.cs
- UpDownBase.cs
- ApplicationDirectory.cs
- StateWorkerRequest.cs
- NominalTypeEliminator.cs
- PageCanvasSize.cs
- ForwardPositionQuery.cs
- TreeNodeMouseHoverEvent.cs
- ListSurrogate.cs
- CorrelationManager.cs
- SelectedDatesCollection.cs
- KeyProperty.cs
- ReflectionServiceProvider.cs
- CategoryAttribute.cs
- FileDetails.cs
- WSSecurityOneDotOneReceiveSecurityHeader.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- XmlNamespaceDeclarationsAttribute.cs
- PnrpPeerResolverBindingElement.cs
- PageFunction.cs
- AlternationConverter.cs
- TabItemAutomationPeer.cs
- GatewayIPAddressInformationCollection.cs
- datacache.cs
- RTTypeWrapper.cs
- DbReferenceCollection.cs
- StringUtil.cs
- CodeIdentifier.cs
- TabPage.cs
- RangeEnumerable.cs
- FirstQueryOperator.cs
- ParserExtension.cs
- DbConnectionPoolCounters.cs
- Calendar.cs
- SystemIcmpV4Statistics.cs
- _ReceiveMessageOverlappedAsyncResult.cs
- TrackBarRenderer.cs
- FacetChecker.cs
- SiteMapNodeItemEventArgs.cs
- ControlCollection.cs
- BooleanExpr.cs
- UInt64.cs
- ToolTipAutomationPeer.cs
- XmlReader.cs
- ControlPropertyNameConverter.cs
- CustomAttributeSerializer.cs
- MemberRelationshipService.cs
- ColorConverter.cs
- DelayedRegex.cs
- TypeUsageBuilder.cs
- DataGridItemEventArgs.cs
- DecoderFallback.cs
- WindowsComboBox.cs
- UIAgentMonitorHandle.cs