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
- TargetConverter.cs
- BaseDataBoundControl.cs
- FileDialog_Vista.cs
- PostBackTrigger.cs
- MetadataUtil.cs
- RegexTree.cs
- SetterBaseCollection.cs
- AssociationType.cs
- WindowsListView.cs
- PolicyException.cs
- IxmlLineInfo.cs
- TextElement.cs
- ThreadStateException.cs
- ChoiceConverter.cs
- HTTPAPI_VERSION.cs
- FactoryGenerator.cs
- PolicyChain.cs
- DynamicMethod.cs
- DebugController.cs
- StateBag.cs
- SortFieldComparer.cs
- ValidatedControlConverter.cs
- FreezableOperations.cs
- InternalSafeNativeMethods.cs
- SqlProviderServices.cs
- Encoder.cs
- TabControl.cs
- GPRECT.cs
- SqlDataSourceEnumerator.cs
- ItemsPresenter.cs
- SessionStateItemCollection.cs
- Vector3DCollectionConverter.cs
- M3DUtil.cs
- TrackBar.cs
- SQLGuidStorage.cs
- ObjectComplexPropertyMapping.cs
- OdbcConnectionFactory.cs
- PropertyItem.cs
- PropertyGridView.cs
- ManagedIStream.cs
- AtomMaterializer.cs
- WindowsTooltip.cs
- HtmlDocument.cs
- WebFormDesignerActionService.cs
- SemaphoreFullException.cs
- ApplicationActivator.cs
- securitycriticaldataClass.cs
- Adorner.cs
- OdbcException.cs
- ObjectParameter.cs
- Propagator.JoinPropagator.cs
- SoapSchemaMember.cs
- SqlClientPermission.cs
- ArrayWithOffset.cs
- CompilerGlobalScopeAttribute.cs
- DashStyle.cs
- MethodBody.cs
- CrossSiteScriptingValidation.cs
- Update.cs
- CssStyleCollection.cs
- WmiEventSink.cs
- BitmapEffectGroup.cs
- Compiler.cs
- Serializer.cs
- Document.cs
- DesignerSerializationOptionsAttribute.cs
- RequestSecurityTokenResponseCollection.cs
- columnmapkeybuilder.cs
- PlainXmlSerializer.cs
- TaiwanCalendar.cs
- ListControlStringCollectionEditor.cs
- TitleStyle.cs
- _NegoState.cs
- QilFunction.cs
- WorkflowDefinitionDispenser.cs
- FormClosingEvent.cs
- HttpCookieCollection.cs
- AlternateViewCollection.cs
- IItemProperties.cs
- ScriptResourceAttribute.cs
- LinqDataSourceDeleteEventArgs.cs
- HttpCachePolicyWrapper.cs
- ConfigurationSettings.cs
- OleDbMetaDataFactory.cs
- CryptoHandle.cs
- OutputScopeManager.cs
- StreamProxy.cs
- MSHTMLHostUtil.cs
- TraceUtility.cs
- SerializationAttributes.cs
- ModelTreeManager.cs
- RunInstallerAttribute.cs
- FacetValueContainer.cs
- ObjectManager.cs
- XmlSchemaAttributeGroup.cs
- Pair.cs
- ConnectionStringSettingsCollection.cs
- WindowsEditBoxRange.cs
- XamlFilter.cs
- StylusPointCollection.cs