Esempio n. 1
0
		public IBin Open(BinConfiguration config)
		{
			IsolatedStorageFileBin bin = new IsolatedStorageFileBin(config, _store);
			AddToOpenBinsCollection(bin);
			RegisterForOnCloseEvent(bin);
			
			return bin;
		}
        public IBin Open(BinConfiguration config)
        {
            IsolatedStorageFileBin bin = new IsolatedStorageFileBin(config, _store);

            AddToOpenBinsCollection(bin);
            RegisterForOnCloseEvent(bin);

            return(bin);
        }
        public static long FileSize(string uri)
        {
            lock (_openBins)
            {
                if (IsBinAlreadyOpen(uri))
                {
                    IsolatedStorageFileBin bin = _openBins[uri];
                    return(bin.Length());
                }

                using (IsolatedStorageFileStream fileStream = _store.OpenFile(uri, FileMode.Open, FileAccess.Read, FileShare.None))
                {
                    return(fileStream.Length);
                }
            }
        }
 private static void AddToOpenBinsCollection(IsolatedStorageFileBin bin)
 {
     _openBins[bin.Path] = bin;
 }
 private static void RegisterForOnCloseEvent(IsolatedStorageFileBin bin)
 {
     bin.OnClose += (sender, arg) => RemoveFromOpenBinCollection(((IsolatedStorageFileBin)sender).Path);
 }
Esempio n. 6
0
		private static void AddToOpenBinsCollection(IsolatedStorageFileBin bin)
		{
			_openBins[bin.Path] = bin;
		}
Esempio n. 7
0
		private static void RegisterForOnCloseEvent(IsolatedStorageFileBin bin)
		{
			bin.OnClose += (sender, arg) => RemoveFromOpenBinCollection(((IsolatedStorageFileBin)sender).Path);
		}