Beispiel #1
0
        public static bool LaunchFile(string path, out string err)
        {
            err = "";

            Windows.Storage.StorageFile fle = RscStore_Storage.GetStorageFileObject(path, out err);
            if (fle == null)
            {
                return(false);
            }

            bool bSucc = false;

            try
            {
                //NO!

                /*
                 * var options = new Windows.System.LauncherOptions();
                 * options.DisplayApplicationPicker = false;
                 */

                var taskHlp = Task.Run(async() => { bSucc = await Windows.System.Launcher.LaunchFileAsync(fle /*, options*/); });
                taskHlp.Wait();
            }
            catch (Exception)
            {
            }

            return(bSucc);
        }
Beispiel #2
0
        protected RscStore_Base GetStore(string sPath)
        {
            if (sPath.Length < 2)
            {
                return(null);
            }
            if (sPath[1] != ':')
            {
                return(null);
            }

            RscStore_Base store = null;

            switch (sPath[0])
            {
            case 'A':
            case 'a':
                store = new RscStore_IsoStore();
                break;

            case 'B':
            case 'b':
                store = new RscStore_KnownFolders();
                break;

            default:
                store = new RscStore_Storage();
                break;
            }

            store = store.GetSpecialStorage(GetStorePath(sPath));

            return(store);
        }
Beispiel #3
0
        public static Windows.Storage.StorageFile GetStorageFileObject(string path, out string err)
        {
            err = "";

            string sPath = "";

            switch (path.Substring(0, 2).ToUpper())
            {
            case "A:":
                sPath = IsoStoreDevicePath() + path.Substring(2);
                break;

            case "B:":

                //sPath = "C:" + path.Substring(2);

                err = "Content of virtual drive B: is not accessible through physical drive!";
                break;

            default:
                sPath = path;
                break;
            }

            RscStore_Storage strg = new RscStore_Storage();

            return(strg.GetFileObject(sPath));
        }
Beispiel #4
0
        // //
        //

        public static string [] GetRoots(bool bIncludeHidden, bool bStartWithInfChr)
        {
            //return new String [] {"A:", "B:", "C:", "D:"};

            RscStore_Storage store = new RscStore_Storage();

            string [] astrDrvs = new String [26];
            object    oFldr;

            int iCnt = 0;

            for (char cDrv = 'C'; cDrv <= 'Z'; cDrv++)
            {
                oFldr = store.GetRootFolderByNameLower((cDrv.ToString() + ":").ToLower());
                if (oFldr != null)
                {
                    //Drive exits...
                    astrDrvs[iCnt] = cDrv.ToString() + ":"; iCnt++;
                }
            }

            string [] astrRes = new String [iCnt + 2];
            if (bStartWithInfChr)
            {
                astrRes[0] = "nA:";                   //Normal..
                astrRes[1] = "nB:";                   //Normal..
            }
            else
            {
                astrRes[0] = "A:";
                astrRes[1] = "B:";
            }
            for (int i = 0; i < iCnt; i++)
            {
                if (bStartWithInfChr)
                {
                    astrRes[2 + i] = "n";                       //Normal...
                }
                else
                {
                    astrRes[2 + i] = "";
                }

                astrRes[2 + i] += astrDrvs[i];
            }
            return(astrRes);
        }
Beispiel #5
0
        //
        // //
        //

        public static long AvailableFreeSpace(out string sDrive)
        {
            sDrive = RscStore_Storage.IsoStoreDrive();
            return(RscStore_IsoStore.AvailableFreeSpace());
        }