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
- CheckedListBox.cs
- JsonReaderDelegator.cs
- ScriptReference.cs
- ObjectQueryState.cs
- StringSorter.cs
- HMACSHA1.cs
- ArithmeticLiteral.cs
- ReadOnlyDictionary.cs
- XPathAxisIterator.cs
- StringSorter.cs
- cache.cs
- Metafile.cs
- TemplateField.cs
- DesignerEditorPartChrome.cs
- DataMemberFieldEditor.cs
- PropertyDescriptorCollection.cs
- XPathAncestorIterator.cs
- TimeIntervalCollection.cs
- ProxyHwnd.cs
- Vector3DCollectionConverter.cs
- BrowserCapabilitiesCompiler.cs
- _ConnectionGroup.cs
- PersistChildrenAttribute.cs
- StateRuntime.cs
- DocumentAutomationPeer.cs
- PageBuildProvider.cs
- UnwrappedTypesXmlSerializerManager.cs
- SatelliteContractVersionAttribute.cs
- StickyNote.cs
- XPathDocumentNavigator.cs
- SubMenuStyle.cs
- DbTransaction.cs
- EdmEntityTypeAttribute.cs
- CodeAccessSecurityEngine.cs
- MembershipSection.cs
- PathFigure.cs
- SchemaMapping.cs
- VersionUtil.cs
- SchemaImporterExtension.cs
- GotoExpression.cs
- TreeSet.cs
- KeysConverter.cs
- __ComObject.cs
- AudioFileOut.cs
- DataException.cs
- ExpandCollapsePatternIdentifiers.cs
- DocumentViewerHelper.cs
- Material.cs
- LiteralSubsegment.cs
- MailDefinition.cs
- ComboBoxDesigner.cs
- PathNode.cs
- _FtpDataStream.cs
- DataTableCollection.cs
- HttpModuleActionCollection.cs
- HtmlContainerControl.cs
- BitmapFrame.cs
- ZoneMembershipCondition.cs
- TerminatingOperationBehavior.cs
- ObjectAnimationBase.cs
- ZipIOExtraFieldElement.cs
- HttpModuleCollection.cs
- ClientSettingsStore.cs
- NodeLabelEditEvent.cs
- XmlSchemaCollection.cs
- TextBoxAutoCompleteSourceConverter.cs
- TransactionInterop.cs
- DirectoryObjectSecurity.cs
- FrameworkContentElement.cs
- EncryptedReference.cs
- TraceContextEventArgs.cs
- _SpnDictionary.cs
- EditorAttribute.cs
- DataGridViewCellEventArgs.cs
- DependencyPropertyValueSerializer.cs
- ListViewTableCell.cs
- X509DefaultServiceCertificateElement.cs
- webproxy.cs
- MobileUITypeEditor.cs
- TriggerAction.cs
- InputManager.cs
- HtmlShim.cs
- coordinatorscratchpad.cs
- GcHandle.cs
- HttpTransportElement.cs
- SqlTriggerAttribute.cs
- LineMetrics.cs
- WebContext.cs
- SelectionEditingBehavior.cs
- SignatureConfirmationElement.cs
- SoapExtensionReflector.cs
- RegisteredHiddenField.cs
- QilExpression.cs
- HtmlUtf8RawTextWriter.cs
- NullRuntimeConfig.cs
- DbSource.cs
- SymbolPair.cs
- ScriptReferenceEventArgs.cs
- NetStream.cs
- QilIterator.cs