コード例 #1
0
		public IBin Open(BinConfiguration config)
		{
			IsolatedStorageFileBin bin = new IsolatedStorageFileBin(config, _store);
			AddToOpenBinsCollection(bin);
			RegisterForOnCloseEvent(bin);
			
			return bin;
		}
コード例 #2
0
        public IBin Open(BinConfiguration config)
        {
            IsolatedStorageFileBin bin = new IsolatedStorageFileBin(config, _store);

            AddToOpenBinsCollection(bin);
            RegisterForOnCloseEvent(bin);

            return(bin);
        }
コード例 #3
0
        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);
                }
            }
        }
コード例 #4
0
 private static void AddToOpenBinsCollection(IsolatedStorageFileBin bin)
 {
     _openBins[bin.Path] = bin;
 }
コード例 #5
0
 private static void RegisterForOnCloseEvent(IsolatedStorageFileBin bin)
 {
     bin.OnClose += (sender, arg) => RemoveFromOpenBinCollection(((IsolatedStorageFileBin)sender).Path);
 }
コード例 #6
0
		private static void AddToOpenBinsCollection(IsolatedStorageFileBin bin)
		{
			_openBins[bin.Path] = bin;
		}
コード例 #7
0
		private static void RegisterForOnCloseEvent(IsolatedStorageFileBin bin)
		{
			bin.OnClose += (sender, arg) => RemoveFromOpenBinCollection(((IsolatedStorageFileBin)sender).Path);
		}