public override RscStoreProperties GetFolderProperties(string path)
        {
            RscStoreProperties sp = new RscStoreProperties();


            IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();

            sp.CreationTime   = store.GetCreationTime(path).DateTime;
            sp.LastWriteTime  = store.GetLastWriteTime(path).DateTime;
            sp.LastAccessTime = store.GetLastAccessTime(path).DateTime;

            return(sp);
        }
示例#2
0
        public override RscStoreProperties GetFileProperties(string path)
        {
            RscStoreProperties sp = new RscStoreProperties();

            Windows.Storage.StorageFile fle = GetFileObject(path);
            if (fle == null)
            {
                return(sp);
            }

            sp.CreationTime = fle.DateCreated.DateTime;

            Windows.Storage.FileProperties.BasicProperties bp = null;

            var taskHlp1 = Task.Run(async() => { bp = await GetFileBasicPropertiesAsync(fle); });

            taskHlp1.Wait();

            sp.LastWriteTime = bp.DateModified.DateTime;
            sp.Length        = (long)bp.Size;

            //FAILS...

            /*
             * readonly string dateAccessedProperty = "System.DateAccessed";
             * readonly string fileOwnerProperty = "System.FileOwner";
             * List<string> propertiesName = new List<string>();
             * propertiesName.Add(dateAccessedProperty);
             * //propertiesName.Add(fileOwnerProperty);
             *
             * // Get the specified properties through StorageFile.Properties
             * IDictionary<string, object> extraProperties = null;
             *
             * var taskHlp2 = Task.Run(async () => { extraProperties = await GetFileProperties(fle, propertiesName); });
             * taskHlp2.Wait();
             *
             * var propValue = extraProperties[dateAccessedProperty];
             * if (propValue != null)
             * {
             *      outputText.AppendLine("Date accessed: " + propValue);
             * }
             * propValue = extraProperties[fileOwnerProperty];
             * if (propValue != null)
             * {
             *      outputText.AppendLine("File owner: " + propValue);
             * }
             */

            return(sp);
        }
        public override RscStoreProperties GetFileProperties(string path)
        {
            RscStoreProperties sp = new RscStoreProperties();

            IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();

            sp.CreationTime   = store.GetCreationTime(path).DateTime;
            sp.LastWriteTime  = store.GetLastWriteTime(path).DateTime;
            sp.LastAccessTime = store.GetLastAccessTime(path).DateTime;

            IsolatedStorageFileStream stream = store.OpenFile(path, FileMode.Open, FileAccess.Read);

            sp.Length = stream.Length;
            stream.Close();

            return(sp);
        }
示例#4
0
        public override RscStoreProperties GetFileProperties(string path)
        {
            RscStoreProperties sp = new RscStoreProperties();

            Picture p = GetPictureObject(path);

            if (p == null)
            {
                return(sp);
            }

            sp.CreationTime = p.Date;

            sp.Length = p.GetImage().Length;

            return(sp);
        }
        public override RscStoreProperties GetFileProperties(string path)
        {
            RscStoreProperties sp = new RscStoreProperties();

            //TODO...

            /*
             * Picture p = GetPictureObject( path );
             * if( p == null ) return sp;
             *
             * sp.CreationTime = p.Date;
             *
             * sp.Length = p.GetImage().Length;
             */

            return(sp);
        }
示例#6
0
        public override RscStoreProperties GetFolderProperties(string path)
        {
            RscStoreProperties sp = new RscStoreProperties();

            Windows.Storage.StorageFolder fldr = null;

            try
            {
                fldr = GetFolderObject(path);
            }
            catch (Exception)
            {
            }

            if (fldr == null)
            {
                return(sp);
            }

            try
            {
                sp.FullPath = fldr.Path;
            }
            catch (Exception)
            {
            }

            try
            {
                sp.DisplayName = fldr.DisplayName;
            }
            catch (Exception)
            {
            }

            sp.CreationTime = fldr.DateCreated.DateTime;

            /*
             * const string freeSpaceProperty = "System.FreeSpace";
             * IDictionary<string, object> extraProperties = null;
             * try
             * {
             *      MessageBox.Show( "Start..." );
             *      var taskHlp2 = Task.Run(async () => { extraProperties = await GetFolderPropertiesAsync(fldr, new string[] { freeSpaceProperty }); });
             *      taskHlp2.Wait();
             *      MessageBox.Show( "Stop..." );
             * }
             * catch( Exception )
             * {
             *      MessageBox.Show( "Err..." );
             * }
             * if( extraProperties != null )
             * {
             *      var propValue = extraProperties[freeSpaceProperty];
             *      if (propValue != null)
             *      {
             *              sp.DisplayName = propValue.ToString();
             *      }
             * }
             */

            //FAILS...

            /*
             * UInt64 fs = 0;
             * try
             * {
             *      var taskHlp2 = Task.Run(async () => { fs = await GetFolderFreeSpaceAsync(fldr); });
             *      taskHlp2.Wait();
             * }
             * catch( Exception )
             * {
             * }
             * sp.DisplayName = "free space: " + fs.ToString();
             */

            return(sp);
        }