Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / IO / IsolatedStorage / IsolatedStorageSecurityState.cs / 1305376 / IsolatedStorageSecurityState.cs
using System.Security; namespace System.IO.IsolatedStorage { public enum IsolatedStorageSecurityOptions { #if FEATURE_CORECLR GetRootUserDirectory = 0, GetGroupAndIdForApplication = 1, GetGroupAndIdForSite = 2, IncreaseQuotaForGroup = 3, #endif // FEATURE_CORECLR IncreaseQuotaForApplication = 4 } [SecurityCritical] public class IsolatedStorageSecurityState : SecurityState { private Int64 m_UsedSize; private Int64 m_Quota; #if FEATURE_CORECLR private string m_Id; private string m_Group; private string m_RootUserDirectory; #endif // FEATURE_CORECLR private IsolatedStorageSecurityOptions m_Options; #if FEATURE_CORECLR internal static IsolatedStorageSecurityState CreateStateToGetRootUserDirectory() { IsolatedStorageSecurityState state = new IsolatedStorageSecurityState(); state.m_Options = IsolatedStorageSecurityOptions.GetRootUserDirectory; return state; } internal static IsolatedStorageSecurityState CreateStateToGetGroupAndIdForApplication() { IsolatedStorageSecurityState state = new IsolatedStorageSecurityState(); state.m_Options = IsolatedStorageSecurityOptions.GetGroupAndIdForApplication; return state; } internal static IsolatedStorageSecurityState CreateStateToGetGroupAndIdForSite() { IsolatedStorageSecurityState state = new IsolatedStorageSecurityState(); state.m_Options = IsolatedStorageSecurityOptions.GetGroupAndIdForSite; return state; } internal static IsolatedStorageSecurityState CreateStateToIncreaseQuotaForGroup(String group, Int64 newQuota, Int64 usedSize) { IsolatedStorageSecurityState state = new IsolatedStorageSecurityState(); state.m_Options = IsolatedStorageSecurityOptions.IncreaseQuotaForGroup; state.m_Group = group; state.m_Quota = newQuota; state.m_UsedSize = usedSize; return state; } #endif // FEATURE_CORECLR internal static IsolatedStorageSecurityState CreateStateToIncreaseQuotaForApplication(Int64 newQuota, Int64 usedSize) { IsolatedStorageSecurityState state = new IsolatedStorageSecurityState(); state.m_Options = IsolatedStorageSecurityOptions.IncreaseQuotaForApplication; state.m_Quota = newQuota; state.m_UsedSize = usedSize; return state; } [SecurityCritical] private IsolatedStorageSecurityState() { } public IsolatedStorageSecurityOptions Options { get { return m_Options; } } #if FEATURE_CORECLR public String Group { get { return m_Group; } set { m_Group = value; } } public String Id { get { return m_Id; } set { m_Id = value; } } public String RootUserDirectory { get { return m_RootUserDirectory; } set { m_RootUserDirectory = value; } } #endif // FEATURE_CORECLR public Int64 UsedSize { get { return m_UsedSize; } } public Int64 Quota { get { return m_Quota; } set { m_Quota = value; } } [SecurityCritical] public override void EnsureState() { if(!IsStateAvailable()) { throw new IsolatedStorageException(Environment.GetResourceString("IsolatedStorage_Operation")); } } } } // 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
- RootBrowserWindow.cs
- SchemaType.cs
- MemberInitExpression.cs
- MailWriter.cs
- CodeComment.cs
- CodeNamespace.cs
- QilReference.cs
- OleDbWrapper.cs
- MsmqNonTransactedPoisonHandler.cs
- SecurityKeyIdentifierClause.cs
- SqlMethods.cs
- Object.cs
- FileDialog_Vista.cs
- TypeSystemHelpers.cs
- WindowsListViewItem.cs
- SoapSchemaImporter.cs
- safesecurityhelperavalon.cs
- FrameworkElementFactory.cs
- HwndHost.cs
- XmlSchemaComplexContentExtension.cs
- QualificationDataAttribute.cs
- BrowserDefinitionCollection.cs
- RNGCryptoServiceProvider.cs
- Int32KeyFrameCollection.cs
- DefaultValueAttribute.cs
- ControlBuilderAttribute.cs
- CommonProperties.cs
- AddInActivator.cs
- Filter.cs
- BuildResultCache.cs
- TextBoxBase.cs
- EntitySet.cs
- AnnotationDocumentPaginator.cs
- NullExtension.cs
- EntityDataSourceValidationException.cs
- FormViewInsertedEventArgs.cs
- WebBrowserEvent.cs
- CodeDirectionExpression.cs
- FixedSOMSemanticBox.cs
- StaticFileHandler.cs
- PointKeyFrameCollection.cs
- HeaderUtility.cs
- xmlfixedPageInfo.cs
- InkPresenterAutomationPeer.cs
- PagerSettings.cs
- LogReserveAndAppendState.cs
- DrawTreeNodeEventArgs.cs
- RoleGroup.cs
- WsatServiceCertificate.cs
- DBBindings.cs
- CodeDelegateCreateExpression.cs
- DiscoveryDocument.cs
- ImageBrush.cs
- XmlSchemaCollection.cs
- NotConverter.cs
- GroupItem.cs
- Rule.cs
- CacheModeConverter.cs
- MruCache.cs
- ExpanderAutomationPeer.cs
- RetrieveVirtualItemEventArgs.cs
- DeploymentExceptionMapper.cs
- PowerStatus.cs
- TransportSecurityProtocol.cs
- ValueUnavailableException.cs
- FeatureSupport.cs
- MsmqIntegrationBindingCollectionElement.cs
- Condition.cs
- OracleTimeSpan.cs
- AuthorizationRule.cs
- WsdlBuildProvider.cs
- TypeLoadException.cs
- ObjectDataSource.cs
- DockProviderWrapper.cs
- UnsafeNativeMethods.cs
- TranslateTransform.cs
- OutputCacheSettingsSection.cs
- CheckoutException.cs
- DataServiceKeyAttribute.cs
- ColorAnimationBase.cs
- QilGenerator.cs
- WindowsFormsSynchronizationContext.cs
- DropAnimation.xaml.cs
- InvokeProviderWrapper.cs
- EntityDataSourceDataSelection.cs
- Native.cs
- WindowsTokenRoleProvider.cs
- Geometry.cs
- OleDbParameterCollection.cs
- DataPointer.cs
- TreeNodeMouseHoverEvent.cs
- LinkConverter.cs
- Assembly.cs
- ThemeDictionaryExtension.cs
- PenThreadWorker.cs
- WindowsContainer.cs
- UntypedNullExpression.cs
- ValidationSummary.cs
- UriWriter.cs
- FaultReason.cs