import typing, abc
from System import MarshalByRefObject, Exception, IDisposable, DateTimeOffset, Array_1, IAsyncResult, AsyncCallback, Span_1, Memory_1, ReadOnlySpan_1, ReadOnlyMemory_1
from System.Collections import IDictionary, IEnumerator
from System.Reflection import MethodBase
from System.IO import FileMode, FileAccess, FileShare, FileStream, SeekOrigin
from Microsoft.Win32.SafeHandles import SafeFileHandle
from System.Threading.Tasks import ValueTask, Task, ValueTask_1, Task_1
from System.Threading import CancellationToken

class INormalizeForIsolatedStorage(typing.Protocol):
    @abc.abstractmethod
    def Normalize(self) -> typing.Any: ...


class IsolatedStorage(MarshalByRefObject):
    @property
    def ApplicationIdentity(self) -> typing.Any: ...
    @property
    def AssemblyIdentity(self) -> typing.Any: ...
    @property
    def AvailableFreeSpace(self) -> int: ...
    @property
    def CurrentSize(self) -> int: ...
    @property
    def DomainIdentity(self) -> typing.Any: ...
    @property
    def MaximumSize(self) -> int: ...
    @property
    def Quota(self) -> int: ...
    @property
    def Scope(self) -> IsolatedStorageScope: ...
    @Scope.setter
    def Scope(self, value: IsolatedStorageScope) -> IsolatedStorageScope: ...
    @property
    def UsedSize(self) -> int: ...
    def IncreaseQuotaTo(self, newQuotaSize: int) -> bool: ...
    @abc.abstractmethod
    def Remove(self) -> None: ...


class IsolatedStorageException(Exception):
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, message: str) -> None: ...
    @typing.overload
    def __init__(self, message: str, inner: Exception) -> None: ...
    @property
    def Data(self) -> IDictionary: ...
    @property
    def HelpLink(self) -> str: ...
    @HelpLink.setter
    def HelpLink(self, value: str) -> str: ...
    @property
    def HResult(self) -> int: ...
    @HResult.setter
    def HResult(self, value: int) -> int: ...
    @property
    def InnerException(self) -> Exception: ...
    @property
    def Message(self) -> str: ...
    @property
    def Source(self) -> str: ...
    @Source.setter
    def Source(self, value: str) -> str: ...
    @property
    def StackTrace(self) -> str: ...
    @property
    def TargetSite(self) -> MethodBase: ...


class IsolatedStorageFile(IsolatedStorage, IDisposable):
    @property
    def ApplicationIdentity(self) -> typing.Any: ...
    @property
    def AssemblyIdentity(self) -> typing.Any: ...
    @property
    def AvailableFreeSpace(self) -> int: ...
    @property
    def CurrentSize(self) -> int: ...
    @property
    def DomainIdentity(self) -> typing.Any: ...
    @classmethod
    @property
    def IsEnabled(cls) -> bool: ...
    @property
    def MaximumSize(self) -> int: ...
    @property
    def Quota(self) -> int: ...
    @property
    def Scope(self) -> IsolatedStorageScope: ...
    @property
    def UsedSize(self) -> int: ...
    def Close(self) -> None: ...
    def CreateDirectory(self, dir: str) -> None: ...
    def CreateFile(self, path: str) -> IsolatedStorageFileStream: ...
    def DeleteDirectory(self, dir: str) -> None: ...
    def DeleteFile(self, file: str) -> None: ...
    def DirectoryExists(self, path: str) -> bool: ...
    def Dispose(self) -> None: ...
    def FileExists(self, path: str) -> bool: ...
    def GetCreationTime(self, path: str) -> DateTimeOffset: ...
    @staticmethod
    def GetEnumerator(scope: IsolatedStorageScope) -> IEnumerator: ...
    def GetLastAccessTime(self, path: str) -> DateTimeOffset: ...
    def GetLastWriteTime(self, path: str) -> DateTimeOffset: ...
    @staticmethod
    def GetMachineStoreForApplication() -> IsolatedStorageFile: ...
    @staticmethod
    def GetMachineStoreForAssembly() -> IsolatedStorageFile: ...
    @staticmethod
    def GetMachineStoreForDomain() -> IsolatedStorageFile: ...
    @staticmethod
    def GetUserStoreForApplication() -> IsolatedStorageFile: ...
    @staticmethod
    def GetUserStoreForAssembly() -> IsolatedStorageFile: ...
    @staticmethod
    def GetUserStoreForDomain() -> IsolatedStorageFile: ...
    @staticmethod
    def GetUserStoreForSite() -> IsolatedStorageFile: ...
    def IncreaseQuotaTo(self, newQuotaSize: int) -> bool: ...
    def MoveDirectory(self, sourceDirectoryName: str, destinationDirectoryName: str) -> None: ...
    def MoveFile(self, sourceFileName: str, destinationFileName: str) -> None: ...
    # Skipped CopyFile due to it being static, abstract and generic.

    CopyFile : CopyFile_MethodGroup
    class CopyFile_MethodGroup:
        @typing.overload
        def __call__(self, sourceFileName: str, destinationFileName: str) -> None:...
        @typing.overload
        def __call__(self, sourceFileName: str, destinationFileName: str, overwrite: bool) -> None:...

    # Skipped GetDirectoryNames due to it being static, abstract and generic.

    GetDirectoryNames : GetDirectoryNames_MethodGroup
    class GetDirectoryNames_MethodGroup:
        @typing.overload
        def __call__(self) -> Array_1[str]:...
        @typing.overload
        def __call__(self, searchPattern: str) -> Array_1[str]:...

    # Skipped GetFileNames due to it being static, abstract and generic.

    GetFileNames : GetFileNames_MethodGroup
    class GetFileNames_MethodGroup:
        @typing.overload
        def __call__(self) -> Array_1[str]:...
        @typing.overload
        def __call__(self, searchPattern: str) -> Array_1[str]:...

    # Skipped GetStore due to it being static, abstract and generic.

    GetStore : GetStore_MethodGroup
    class GetStore_MethodGroup:
        @typing.overload
        def __call__(self, scope: IsolatedStorageScope, applicationEvidenceType: typing.Type[typing.Any]) -> IsolatedStorageFile:...
        @typing.overload
        def __call__(self, scope: IsolatedStorageScope, applicationIdentity: typing.Any) -> IsolatedStorageFile:...
        @typing.overload
        def __call__(self, scope: IsolatedStorageScope, domainEvidenceType: typing.Type[typing.Any], assemblyEvidenceType: typing.Type[typing.Any]) -> IsolatedStorageFile:...
        @typing.overload
        def __call__(self, scope: IsolatedStorageScope, domainIdentity: typing.Any, assemblyIdentity: typing.Any) -> IsolatedStorageFile:...

    # Skipped OpenFile due to it being static, abstract and generic.

    OpenFile : OpenFile_MethodGroup
    class OpenFile_MethodGroup:
        @typing.overload
        def __call__(self, path: str, mode: FileMode) -> IsolatedStorageFileStream:...
        @typing.overload
        def __call__(self, path: str, mode: FileMode, access: FileAccess) -> IsolatedStorageFileStream:...
        @typing.overload
        def __call__(self, path: str, mode: FileMode, access: FileAccess, share: FileShare) -> IsolatedStorageFileStream:...

    # Skipped Remove due to it being static, abstract and generic.

    Remove : Remove_MethodGroup
    class Remove_MethodGroup:
        @typing.overload
        def __call__(self) -> None:...
        @typing.overload
        def __call__(self, scope: IsolatedStorageScope) -> None:...



class IsolatedStorageFileStream(FileStream):
    @typing.overload
    def __init__(self, path: str, mode: FileMode) -> None: ...
    @typing.overload
    def __init__(self, path: str, mode: FileMode, access: FileAccess) -> None: ...
    @typing.overload
    def __init__(self, path: str, mode: FileMode, access: FileAccess, isf: IsolatedStorageFile) -> None: ...
    @typing.overload
    def __init__(self, path: str, mode: FileMode, access: FileAccess, share: FileShare) -> None: ...
    @typing.overload
    def __init__(self, path: str, mode: FileMode, access: FileAccess, share: FileShare, bufferSize: int) -> None: ...
    @typing.overload
    def __init__(self, path: str, mode: FileMode, access: FileAccess, share: FileShare, bufferSize: int, isf: IsolatedStorageFile) -> None: ...
    @typing.overload
    def __init__(self, path: str, mode: FileMode, access: FileAccess, share: FileShare, isf: IsolatedStorageFile) -> None: ...
    @typing.overload
    def __init__(self, path: str, mode: FileMode, isf: IsolatedStorageFile) -> None: ...
    @property
    def CanRead(self) -> bool: ...
    @property
    def CanSeek(self) -> bool: ...
    @property
    def CanTimeout(self) -> bool: ...
    @property
    def CanWrite(self) -> bool: ...
    @property
    def Handle(self) -> int: ...
    @property
    def IsAsync(self) -> bool: ...
    @property
    def Length(self) -> int: ...
    @property
    def Name(self) -> str: ...
    @property
    def Position(self) -> int: ...
    @Position.setter
    def Position(self, value: int) -> int: ...
    @property
    def ReadTimeout(self) -> int: ...
    @ReadTimeout.setter
    def ReadTimeout(self, value: int) -> int: ...
    @property
    def SafeFileHandle(self) -> SafeFileHandle: ...
    @property
    def WriteTimeout(self) -> int: ...
    @WriteTimeout.setter
    def WriteTimeout(self, value: int) -> int: ...
    def BeginRead(self, array: Array_1[int], offset: int, numBytes: int, userCallback: AsyncCallback, stateObject: typing.Any) -> IAsyncResult: ...
    def BeginWrite(self, array: Array_1[int], offset: int, numBytes: int, userCallback: AsyncCallback, stateObject: typing.Any) -> IAsyncResult: ...
    def DisposeAsync(self) -> ValueTask: ...
    def EndRead(self, asyncResult: IAsyncResult) -> int: ...
    def EndWrite(self, asyncResult: IAsyncResult) -> None: ...
    def Lock(self, position: int, length: int) -> None: ...
    def ReadByte(self) -> int: ...
    def Seek(self, offset: int, origin: SeekOrigin) -> int: ...
    def SetLength(self, value: int) -> None: ...
    def Unlock(self, position: int, length: int) -> None: ...
    def WriteByte(self, value: int) -> None: ...
    # Skipped Flush due to it being static, abstract and generic.

    Flush : Flush_MethodGroup
    class Flush_MethodGroup:
        @typing.overload
        def __call__(self) -> None:...
        @typing.overload
        def __call__(self, flushToDisk: bool) -> None:...

    # Skipped FlushAsync due to it being static, abstract and generic.

    FlushAsync : FlushAsync_MethodGroup
    class FlushAsync_MethodGroup:
        @typing.overload
        def __call__(self) -> Task:...
        @typing.overload
        def __call__(self, cancellationToken: CancellationToken) -> Task:...

    # Skipped Read due to it being static, abstract and generic.

    Read : Read_MethodGroup
    class Read_MethodGroup:
        @typing.overload
        def __call__(self, buffer: Span_1[int]) -> int:...
        @typing.overload
        def __call__(self, buffer: Array_1[int], offset: int, count: int) -> int:...

    # Skipped ReadAsync due to it being static, abstract and generic.

    ReadAsync : ReadAsync_MethodGroup
    class ReadAsync_MethodGroup:
        @typing.overload
        def __call__(self, buffer: Memory_1[int], cancellationToken: CancellationToken) -> ValueTask_1[int]:...
        @typing.overload
        def __call__(self, buffer: Array_1[int], offset: int, count: int) -> Task_1[int]:...
        @typing.overload
        def __call__(self, buffer: Array_1[int], offset: int, count: int, cancellationToken: CancellationToken) -> Task_1[int]:...

    # Skipped Write due to it being static, abstract and generic.

    Write : Write_MethodGroup
    class Write_MethodGroup:
        @typing.overload
        def __call__(self, buffer: ReadOnlySpan_1[int]) -> None:...
        @typing.overload
        def __call__(self, buffer: Array_1[int], offset: int, count: int) -> None:...

    # Skipped WriteAsync due to it being static, abstract and generic.

    WriteAsync : WriteAsync_MethodGroup
    class WriteAsync_MethodGroup:
        @typing.overload
        def __call__(self, buffer: ReadOnlyMemory_1[int], cancellationToken: CancellationToken) -> ValueTask:...
        @typing.overload
        def __call__(self, buffer: Array_1[int], offset: int, count: int) -> Task:...
        @typing.overload
        def __call__(self, buffer: Array_1[int], offset: int, count: int, cancellationToken: CancellationToken) -> Task:...



class IsolatedStorageScope(typing.SupportsInt):
    @typing.overload
    def __init__(self, value : int) -> None: ...
    @typing.overload
    def __init__(self, value : int, force_if_true: bool) -> None: ...
    def __int__(self) -> int: ...
    
    # Values:
    None_ : IsolatedStorageScope # 0
    User : IsolatedStorageScope # 1
    Domain : IsolatedStorageScope # 2
    Assembly : IsolatedStorageScope # 4
    Roaming : IsolatedStorageScope # 8
    Machine : IsolatedStorageScope # 16
    Application : IsolatedStorageScope # 32

