Code:
/ 4.0 / 4.0 / 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. 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
- Sequence.cs
- PanelContainerDesigner.cs
- ButtonRenderer.cs
- SecurityTokenSerializer.cs
- WithParamAction.cs
- BaseTreeIterator.cs
- ListSourceHelper.cs
- LineServices.cs
- SessionEndedEventArgs.cs
- XPathQilFactory.cs
- HttpWebRequestElement.cs
- ObjectViewFactory.cs
- BrowserCapabilitiesFactory.cs
- RegexRunner.cs
- ReadWriteSpinLock.cs
- TargetPerspective.cs
- XmlnsCache.cs
- FloaterBaseParaClient.cs
- MatrixValueSerializer.cs
- AmbiguousMatchException.cs
- ClassicBorderDecorator.cs
- AutomationElement.cs
- OptionalRstParameters.cs
- CodeAttachEventStatement.cs
- ServiceDescription.cs
- TypeNameParser.cs
- iisPickupDirectory.cs
- RelationshipType.cs
- WebWorkflowRole.cs
- RoleServiceManager.cs
- SaveFileDialog.cs
- PanelDesigner.cs
- hwndwrapper.cs
- Baml2006ReaderFrame.cs
- SequentialActivityDesigner.cs
- URLString.cs
- PersonalizableAttribute.cs
- OleDbConnectionInternal.cs
- DelayDesigner.cs
- UserControlBuildProvider.cs
- DbDataAdapter.cs
- RegexReplacement.cs
- TransactionContext.cs
- StringDictionaryCodeDomSerializer.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- TextureBrush.cs
- InfoCardRSAPKCS1SignatureDeformatter.cs
- Dictionary.cs
- DefaultTextStoreTextComposition.cs
- TextTreeText.cs
- FieldToken.cs
- NumberSubstitution.cs
- PlanCompilerUtil.cs
- CatalogZoneAutoFormat.cs
- StorageEndPropertyMapping.cs
- BlockCollection.cs
- TdsParserStaticMethods.cs
- XmlDocumentType.cs
- FrameworkRichTextComposition.cs
- ComponentSerializationService.cs
- ImageMap.cs
- SmtpMail.cs
- DynamicILGenerator.cs
- WindowsStartMenu.cs
- Registry.cs
- UriTemplateHelpers.cs
- QilTargetType.cs
- XmlAttributeCollection.cs
- ClipboardData.cs
- NestedContainer.cs
- XmlCharCheckingWriter.cs
- DataGridViewCell.cs
- unitconverter.cs
- ResourceDictionary.cs
- QilList.cs
- QualifierSet.cs
- DateTimeValueSerializer.cs
- FromReply.cs
- TextDecorationUnitValidation.cs
- MatrixIndependentAnimationStorage.cs
- DuplexClientBase.cs
- ImageBrush.cs
- XmlSchemaAppInfo.cs
- NamedPipeProcessProtocolHandler.cs
- MenuItemStyleCollection.cs
- HttpPostedFileWrapper.cs
- XmlUTF8TextWriter.cs
- OrderPreservingSpoolingTask.cs
- CustomPopupPlacement.cs
- TextTreePropertyUndoUnit.cs
- WebPartTracker.cs
- DeadLetterQueue.cs
- NamedPipeAppDomainProtocolHandler.cs
- SmtpDigestAuthenticationModule.cs
- DataPagerFieldCollection.cs
- DecoratedNameAttribute.cs
- AccessText.cs
- GlobalEventManager.cs
- ApplicationManager.cs
- DesignTimeVisibleAttribute.cs