コード例 #1
0
        /*** Page Events *******************************************************************************************************/

        /// <summary>
        /// Set buttons on page to same size.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            _ = sender;     // Discard unused parameter.
            _ = e;          // Discard unused parameter.
            // Hide XAML layout rectangles by setting their color to RelativePanel Background color;
            RectLayoutCenter.Fill = Rpanel.Background;
            RectLayoutLeft.Fill   = Rpanel.Background;
            RectLayoutRight.Fill  = Rpanel.Background;
            LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);
            LibMPC.ButtonVisibility(mainPage.mainPageButSettings, false);
            // Set size of buttons on About page to same size.
            List <Button> listButtonsThisPage = new List <Button>()
            {
                ButEmail,
                ButRateApp,
                ButCryptoLink1,
                ButCryptoLink2,
                ButCryptoLink3,
                ButCryptoLink4
            };

            LibMPC.SizePageButtons(listButtonsThisPage);
            LibMPC.OutputMsgSuccess(TblkPageTitle, mainPage.resourceLoader.GetString("AB_TblkPageTitle"));
            LibMPC.OutputMsgSuccess(TblkPayment, mainPage.resourceLoader.GetString("AB_TblkPayment"));
            LibMPC.OutputMsgNormal(TblkProgrammer, LibMPC.JoinListString(Translate.TRS_AB_List_TblkProgrammer_Text, EnumStringSeparator.OneSpace)); // Do not assemble string until needed to save memory.
            LibMPC.OutputMsgNormal(TblkLink, mainPage.resourceLoader.GetString("AB_TblkLink"));
            LibMPC.OutputMsgBright(TblkPageMsg, LibMPC.JoinListString(Translate.TRS_AB_List_TblkPageMsg_Text, EnumStringSeparator.TwoNewlines));    // Do not assemble string until needed to save memory.
            LibMPC.ButtonEmailXboxDisable(ButEmail);
            //Setup scrolling for this page.
            LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
            ButRateApp.Focus(FocusState.Programmatic);
        }
コード例 #2
0
        /*** Page Events *******************************************************************************************************/

        /// <summary>
        /// On page load set focus to SP_PwBoxPw1.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            _ = sender;     // Discard unused parameter.
            _ = e;          // Discard unused parameter.
            // Hide XAML layout rectangles by setting to same color as RelativePanel Background;
            RectLayoutCenter.Fill = Rpanel.Background;
            RectLayoutLeft.Fill   = Rpanel.Background;
            RectLayoutRight.Fill  = Rpanel.Background;
            LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButBack, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButSettings, false);
            LibMPC.ButtonVisibility(ButContinue, false);    // Hide button until needed.
            LibMPC.OutputMsgSuccess(TblkPageTitle, mainPage.resourceLoader.GetString("SP_TblkPageTitle"));
            PwBoxPw1.PlaceholderText = mainPage.resourceLoader.GetString("SP_PwBoxPw1_PlaceholderText");
            PwBoxPw2.PlaceholderText = mainPage.resourceLoader.GetString("SP_PwBoxPw2_PlaceholderText");
            if (mainPage.boolVerbose)                                                                                                                    // Show long message.
            {
                LibMPC.OutputMsgBright(TblkPageMsg, LibMPC.JoinListString(Translate.TRS_SP_List_TblkPageMsg_Text_Long, EnumStringSeparator.TwoSpaces));  // Do not assemble string until needed to save memory.
            }
            else                                                                                                                                         // Show short message.
            {
                LibMPC.OutputMsgBright(TblkPageMsg, LibMPC.JoinListString(Translate.TRS_SP_List_TblkPageMsg_Text_Short, EnumStringSeparator.TwoSpaces)); // Do not assemble string until needed to save memory.
            }
            LibMPC.OutputMsgNormal(TblkResult, mainPage.resourceLoader.GetString("SP_PwBoxPw1_PlaceholderText"));                                        // Enter password
            //Setup scrolling for this page.
            LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
            PwBoxPw1.Focus(FocusState.Programmatic);
        }
コード例 #3
0
 /// <summary>
 /// Get Locker Reset output message. This message is used mutiple locations so consolidate here.
 /// </summary>
 /// <returns></returns>
 public string GetLockerResetMsg()
 {
     if (boolVerbose)                                                                                             // Show long message.
     {
         return(LibMPC.JoinListString(Translate.TRS_MP_List_LockerResetMsgLong, EnumStringSeparator.OneNewline)); // Do not assemble string until needed to save memory.
     }
     else                                                                                                         // Show short message.
     {
         return(resourceLoader.GetString("UMP_LockerReset_Msg03"));
     }
 }
コード例 #4
0
        /// <summary>
        /// Get locker folder from FutureAccessList and set some pages values.
        /// </summary>
        /// <returns></returns>
        private async Task GetLockerFolder()
        {
            try
            {
                // Uncomment following line to delete FutureAccessList to test the fail code below.
                // StorageApplicationPermissions.FutureAccessList.Clear();

                // Before navigating to this page it was confirmed that file 'mainPage.stringFilenameFirstRunCompleted' does exist.
                // Therefore user has set up a folder to use for his/her locker and it has been saved to FutureAccessList.
                // Now retrieve folder from FutureAccessList so this app will have Read/Write access to all contents 'inside'User's
                // selected folder.  Note!!! If User manually renames or moves file outside of this App this will still return the file!
                if (StorageApplicationPermissions.FutureAccessList.ContainsItem(mainPage.stringTokenLocker))
                {
                    mainPage.storageFolderLocker = await StorageApplicationPermissions.FutureAccessList.GetFolderAsync(mainPage.stringTokenLocker);

                    if (mainPage.storageFolderLocker != null)
                    {
                        mainPage.stringLockerPath = mainPage.storageFolderLocker.Path;  // Initialize.
                        List <string> list_stringMessagePage = new List <string>()
                        {
                            mainPage.resourceLoader.GetString("EP_Success_PageLoad_Msg01"),  // Found locker folder at
                            mainPage.stringLockerPath,
                            mainPage.resourceLoader.GetString("EP_Success_PageLoad_Msg02")   // Application has read and write access to folder.
                        };
                        LibMPC.OutputMsgSuccess(TblkResult, LibMPC.JoinListString(list_stringMessagePage, EnumStringSeparator.OneNewline));
                        PwBoxPw.Focus(FocusState.Programmatic);
                        return;     // Success so return.
                    }
                }
                // Should never get here but if do, then Continue button click will force a Locker Reset. Never exit App as per MS guidelines.
                // Uncomment line mentioned above to test this failure path!
                boolAppResetRequired = true;
                LibMPC.OutputMsgError(TblkPageMsg, LibMPC.JoinListString(Translate.TRS_EP_Error_PageLoad_Msg01, EnumStringSeparator.TwoSpaces));  // Do not assemble string until needed to save memory.
                PwBoxPw.Visibility            = Visibility.Collapsed;
                TblkLockerResetMsg.Visibility = Visibility.Collapsed;
                ButLockerReset.Visibility     = Visibility.Collapsed; // Hide this so User is forced to click Continue to force a Locker Reset.
                // ButEPContinue click will now run mainPage.ResetLockerAsync() to reset locker.  Never exit App as per MS guidelines.
            }
            catch (System.IO.FileNotFoundException)     // Handle exception.
            {
                // Exception will be thrown if Locker folder no longer exist. To test this failure path, delete locker or save locker on USB stick. Then exit, remove stick, and run again.
                boolAppResetRequired = true;
                LibMPC.OutputMsgError(TblkPageMsg, LibMPC.JoinListString(Translate.TRS_EP_Error_PageLoad_Msg02, EnumStringSeparator.TwoSpaces));  // Do not assemble string until needed to save memory.
                PwBoxPw.Visibility            = Visibility.Collapsed;
                TblkLockerResetMsg.Visibility = Visibility.Collapsed;
                ButLockerReset.Visibility     = Visibility.Collapsed;   // Hide this so User is forced to click Continue to start Locker Reset.
                // ButEPContinue click will now run mainPage.ResetLockerAsync() to reset locker. Never just exit App as per MS guidelines.
            }
            catch (Exception ex)    // Catch any other exception.
            {
                LibMPC.OutputMsgError(TblkResult, mainPage.UnhandledExceptionMessage("EnterPassword.Page_Loaded()", ex.GetType()));
            }
        }
コード例 #5
0
        /// <summary>
        /// Format and return uniform unhandled exception message.
        /// </summary>
        /// <param name="stringMethodName">Name of method exception occurred in. Format as 'PageName: MethodName'.</param>
        /// <param name="objectGetType">Exception value returned by GetType().</param>
        /// <returns></returns>
        public string UnhandledExceptionMessage(string stringMethodName, object objectGetType)
        {
            List <string> list_UnhandledExceptionMsg = new List <string>()
            {
                resourceLoader.GetString("MP_UnhandledException_Msg"),
                stringMethodName,
                $"{Environment.NewLine}{resourceLoader.GetString("MP_UnhandledException_Type")}",     // Place string on newline.
                objectGetType.ToString()
            };

            return(LibMPC.JoinListString(list_UnhandledExceptionMsg, EnumStringSeparator.OneSpace));
        }
コード例 #6
0
        /// <summary>
        /// Check if NoArchive folder exists. Return storageFolderNoArchive if found or created successfully, null otherwise.
        /// Output messages are written to public MainPage variable stringFolderCheckOutput if needed.
        /// User can delete NoArchive folder at any time so may need to check if exists.
        /// </summary>
        /// <returns></returns>
        public async Task <StorageFolder> FolderCheckNoArchiveAsync()
        {
            try
            {
                List <string> list_stringFolderCheckOutput = new List <string>();
                StorageFolder storageFolderNoArchive       = null;
                // Debug.WriteLine($"MainPage.FolderCheckNoArchiveAsync(): storageFolderLocker.Path={storageFolderLocker.Path}");
                IStorageItem iStorageItem = await storageFolderLocker.TryGetItemAsync(stringFoldernameNoArchive);

                if (iStorageItem != null)   // Item found but don't know if it was folder or file.
                {
                    if (iStorageItem.IsOfType(StorageItemTypes.Folder))
                    {
                        storageFolderNoArchive = (StorageFolder)iStorageItem;     // Found folder.
                    }
                    else
                    {
                        // Item found was not a folder as expected but is using App reserved name.
                        // Delete item to Recycle Bin to be safe and create NoArchive folder.
                        await iStorageItem.DeleteAsync();

                        storageFolderNoArchive = await storageFolderLocker.CreateFolderAsync(stringFoldernameNoArchive);
                    }
                }
                else    // iStorageItem is null, so create NoArchive folder.
                {
                    storageFolderNoArchive = await storageFolderLocker.CreateFolderAsync(stringFoldernameNoArchive);
                }
                if (storageFolderNoArchive != null)
                {
                    list_stringFolderCheckOutput.Add(resourceLoader.GetString("MP_Success_FolderCheck_NoArchive"));     // Found or created folder
                }
                else
                {
                    list_stringFolderCheckOutput.Add(resourceLoader.GetString("MP_Error_FolderCheck_NoArchive"));       // Could not find or create folder
                }
                list_stringFolderCheckOutput.Add(storageFolderNoArchive.Name);
                stringFolderCheckOutput = LibMPC.JoinListString(list_stringFolderCheckOutput, EnumStringSeparator.OneSpace);
                // Debug.WriteLine($"MainPage.FolderCheckNoArchiveAsync(): stringFolderCheckOutput={stringFolderCheckOutput}");
                // Debug.WriteLine($"MainPage.FolderCheckNoArchiveAsync(): storageFolderNoArchive.Path={storageFolderNoArchive.Path}");
                // throw new ArgumentException("Throw exception to test exception methods. Comment this out when satisfied all is working.");
                return(storageFolderNoArchive);    // Is null on error.
            }
            catch (Exception ex)
            {
                stringFolderCheckOutput = UnhandledExceptionMessage("MainPage.FolderCheckNoArchiveAsync()", ex.GetType());
                return(null);

                throw;
            }
        }
コード例 #7
0
        /*** Page Events *******************************************************************************************************/

        private void Page_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            _ = sender;     // Discard unused parameter.
            _ = e;          // Discard unused parameter.
            // Hide XAML layout rectangles by setting their color to RelativePanel Background color;
            RectLayoutCenter.Fill = Rpanel.Background;
            RectLayoutLeft.Fill   = Rpanel.Background;
            RectLayoutRight.Fill  = Rpanel.Background;
            LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);
            LibMPC.ButtonVisibility(mainPage.mainPageButSettings, false);
            LibMPC.OutputMsgSuccess(TblkPageTitle, mainPage.resourceLoader.GetString("AT_TblkPageTitle"));
            LibMPC.OutputMsgBright(TblkToggleMsg, LibMPC.JoinListString(Translate.TRS_AT_List_TblkToggleMsg_Text, EnumStringSeparator.TwoNewlines));   // Do not assemble string until needed to save memory.
            //Setup scrolling for this page.
            LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
        }
コード例 #8
0
        /*** Private Methods ***************************************************************************************************/

        /// <summary>
        /// This method checks if entered password is valid. Otherwise, wrong password was entered so request user to enter another one.
        /// If password is valid then navigate to page HomePage.
        /// </summary>
        private void PasswordVerify()
        {
            mainPage.cryptographicKeyAppPassword = LibAES.CryptographicKeyPassword(PwBoxPw.Password);
            if (mainPage.cryptographicKeyAppPassword != null)
            {
                string stringStoreValue = mainPage.DataStoreLockerPath(false, null);
                if (stringStoreValue != null)
                {
                    if (stringStoreValue.Equals(mainPage.stringLockerPath, StringComparison.OrdinalIgnoreCase))
                    {
                        // Password is valid if decrypted path using entered password is same as locker folder path.
                        // Debug.WriteLine($"PasswordVerify(): Password valid since {stringStoreValue}={mainPage.stringLockerPath}");
                        mainPage.ShowPageHomePage(); // Everything as expected so navigate to page HomePage.
                        return;                      // Success. Correct password was entered.
                    }
                    else
                    {
                        // To test this error path, negate value in 'if' above and then run App. Then enter correct password.
                        boolAppResetRequired = true;
                        PwBoxPw.Visibility   = Visibility.Collapsed;
                        LibMPC.OutputMsgError(TblkPageMsg, LibMPC.JoinListString(Translate.TRS_EP_Error_PasswordVerify, EnumStringSeparator.TwoSpaces));    // Do not assemble string until needed to save memory.
                        TblkResult.Text = string.Empty;
                        TblkLockerResetMsg.Visibility = Visibility.Collapsed;
                        LibMPC.ButtonVisibility(ButLockerReset, false);     // Hide button so User is forced to click Continue to start Locker Reset.
                    }
                }
                else
                {
                    PasswordWrong();
                }
            }
            else
            {
                ErrorOccurred(mainPage.resourceLoader.GetString("UMP_Error_Password_Hash"));   // Could not hash password.  Try different password.
            }
        }
コード例 #9
0
        /*** Page Events *******************************************************************************************************/

        /// <summary>
        /// On page load set focus to ButSFFolderPicker.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            _ = sender;     // Discard unused parameter.
            _ = e;          // Discard unused parameter.
            // Hide XAML layout rectangles by setting to same color as RelativePanel Background;
            RectLayoutCenter.Fill = Rpanel.Background;
            RectLayoutLeft.Fill   = Rpanel.Background;
            RectLayoutRight.Fill  = Rpanel.Background;
            LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButBack, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButSettings, false);
            List <Button> listButtonsThisPage = new List <Button>()
            {
                ButFolderPicker,
                ButContinue
            };

            LibMPC.SizePageButtons(listButtonsThisPage);
            LibMPC.OutputMsgSuccess(TblkPageTitle, mainPage.resourceLoader.GetString("SF_TblkPageTitle"));
            CboxSamples.Content = mainPage.resourceLoader.GetString("SF_CboxSamples");
            if (mainPage.boolVerbose)                                                                                                                     // Display long message.
            {
                LibMPC.OutputMsgBright(TblkPageMsg, LibMPC.JoinListString(Translate.TRS_SF_List_TblkPageMsg_Text_Long, EnumStringSeparator.TwoNewlines)); // Do not assemble string until needed to save memory.
            }
            else                                                                                                                                          // Display short message.
            {
                LibMPC.OutputMsgBright(TblkPageMsg, LibMPC.JoinListString(Translate.TRS_SF_List_TblkPageMsg_Text_Short, EnumStringSeparator.TwoSpaces));  // Do not assemble string until needed to save memory.
            }
            TblkResult.Text        = string.Empty;                                                                                                        // Show empty string until a value is set by App.
            CboxSamples.Visibility = Visibility.Collapsed;                                                                                                // Hide CboxSamples until needed.
            LibMPC.ButtonVisibility(ButContinue, false);                                                                                                  // Hide ButContinue until needed.
            DataStoreFirstRun();
            //Setup scrolling for this page.
            LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
            ButFolderPicker.Focus(FocusState.Programmatic);
        }
コード例 #10
0
        /// <summary>
        /// Ask User to create folder and edit name to use as their Encryption Locker.
        /// User's folder will then be added to 'FutureAccessList' for retrieval on subsequent runs.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void ButFolderPicker_Click(object sender, RoutedEventArgs e)
        {
            _ = sender;     // Discard unused parameter.
            _ = e;          // Discard unused parameter.
            try
            {
                CboxSamples.Visibility = Visibility.Collapsed;      // Hide checkbox until needed.
                LibMPC.ButtonVisibility(ButContinue, false);        // Hide continue button until needed.
                FolderPicker folderPicker = new FolderPicker()
                {
                    SuggestedStartLocation = PickerLocationId.DocumentsLibrary
                };
                folderPicker.FileTypeFilter.Add("*");   // Need at least one filter to prevent exception.
                StorageFolder storageFolderPicked = await folderPicker.PickSingleFolderAsync();

                if (storageFolderPicked != null)
                {
                    // Folder picker can create a folder anywhere.  Example, 'C:\Program Files'.  But that does not mean App can get Read/Write access to it.  If folder
                    // location is protected, a 'System.UnauthorizedAccessException' error will occur when attempt is made to write data there.  App needs to check if it
                    // can get R/W access by attempting to create a file there.  if exception occurs, folder is in protected location. Make User pick a different location.
                    // Do not need to translate this since should only exist for an instant.
                    StorageFile storageFileFolderTest = await storageFolderPicked.CreateFileAsync("EL_XYZ_FILE_TEST.txt", CreationCollisionOption.ReplaceExisting);

                    if (storageFileFolderTest != null)
                    {
                        await storageFileFolderTest.DeleteAsync(StorageDeleteOption.PermanentDelete);
                    }
                    // If above file did not throw exception, then App has R/W access to folder.  So continue...
                    mainPage.storageFolderLocker = storageFolderPicked;
                    mainPage.stringLockerPath    = mainPage.storageFolderLocker.Path;                                                      // Save path since used often.
                                                                                                                                           // Application now has Read/Write access to contents 'inside' picked folder.  INSIDE is key word here.  App cannot delete or rename picked folder.
                    StorageApplicationPermissions.FutureAccessList.Clear();                                                                // Empty FutureAccessList and start fresh.
                    StorageApplicationPermissions.FutureAccessList.AddOrReplace(mainPage.stringTokenLocker, mainPage.storageFolderLocker); //Add new token to FutureAccessList.
                    List <string> list_stringMessagePage = new List <string>()
                    {
                        mainPage.resourceLoader.GetString("SF_Success_Picker_Msg1"),       // Folder selected was:
                        mainPage.stringLockerPath,
                        mainPage.resourceLoader.GetString("SF_Success_Picker_Msg2")        // Click following button to use this folder.  Click above button to select different folder.
                    };
                    LibMPC.OutputMsgSuccess(TblkResult, LibMPC.JoinListString(list_stringMessagePage, EnumStringSeparator.OneNewline));
                    CboxSamples.Visibility = Visibility.Visible;    // Show checkbox only if verbose mode?????
                    LibMPC.ButtonVisibility(ButContinue, true);     // Show continue button.
                    ButContinue.Focus(FocusState.Programmatic);
                }
                else                                                                                                        // User did not select a folder.
                {
                    LibMPC.OutputMsgError(TblkResult, mainPage.resourceLoader.GetString("UMP_Error_Picker_NothingPicked")); // Did not pick anything.
                    ButFolderPicker.Focus(FocusState.Programmatic);
                }
            }
            catch (UnauthorizedAccessException)
            {
                // Catch 'UnauthorizedAccessException' exception if User picks protected location for Locker folder.
                // This exception can be triggered by attempting to create the test file in a protected folder. Example, try to create Locker in C:\Program Files.
                // Cannot get read and write access to selected folder.  Folder likely in protected location.  Create folder in different location.
                LibMPC.OutputMsgError(TblkResult, mainPage.resourceLoader.GetString("SF_Error_Picker_FolderException"));
                CboxSamples.Visibility = Visibility.Collapsed;      // Hide checkbox.
                LibMPC.ButtonVisibility(ButContinue, false);        // Hide continue button.
                throw;
            }
            catch (Exception ex)    // Catch any other exceptions.
            {
                LibMPC.OutputMsgError(TblkResult, mainPage.UnhandledExceptionMessage("SetupFolder.ButFolderPicker_Click()", ex.GetType()));
                throw;
            }
        }
コード例 #11
0
        /// <summary>
        /// Create sample files and folders in Locker folder.
        /// </summary>
        /// <returns></returns>
        private async Task CreateSamplesItemsAsync()
        {
            try
            {
                mainPage.boolSamplesCreated = false;                                                                                                      // Set to false until a sample item is created since sample item may already exist.
                string stringFilename1  = mainPage.resourceLoader.GetString("SF_SampleFilename1");                                                        // Instructions and tips
                string stringFilename2  = mainPage.resourceLoader.GetString("SF_SampleFilename2");                                                        // Sample file
                string stringFoldername = mainPage.resourceLoader.GetString("SF_SampleFoldername");                                                       // Sample folder
                // Build content string of sample files.
                string        stringSampleFileContent = LibMPC.JoinListString(Translate.TRS_SF_List_SampleFile_Content, EnumStringSeparator.TwoNewlines); // Do not assemble string until needed to save memory.
                string        stringSampleName;
                StorageFolder storageFolderResult;
                // Create sample files and folders in Locker folder.
                stringSampleName = $"{stringFilename1}{ mainPage.stringExtensionTxt}";
                await CreateSampleFileAsync(mainPage.storageFolderLocker, stringSampleName, stringSampleFileContent);

                stringSampleName = $"{stringFilename2} 01{mainPage.stringExtensionTxt}";
                await CreateSampleFileAsync(mainPage.storageFolderLocker, stringSampleName, stringSampleFileContent);

                stringSampleName = $"{stringFilename2} 02{mainPage.stringExtensionTxt}";
                await CreateSampleFileAsync(mainPage.storageFolderLocker, stringSampleName, stringSampleFileContent);

                stringSampleName    = $"{stringFoldername} 1";
                storageFolderResult = await CreateSampleFolderAsync(mainPage.storageFolderLocker, stringSampleName);

                if (storageFolderResult != null)
                {
                    stringSampleName = $"{stringFilename2} 03{mainPage.stringExtensionTxt}";
                    await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);

                    stringSampleName = $"{stringFilename2} 04{mainPage.stringExtensionTxt}";
                    await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);

                    stringSampleName    = $"{stringFoldername} 2";
                    storageFolderResult = await CreateSampleFolderAsync(storageFolderResult, stringSampleName);

                    if (storageFolderResult != null)
                    {
                        stringSampleName = $"{stringFilename2} 05{mainPage.stringExtensionTxt}";
                        await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);

                        stringSampleName = $"{stringFilename2} 06{mainPage.stringExtensionTxt}";
                        await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);
                    }
                }
                // Create NoArchive folder in Locker folder and create sample folders and files in it.
                storageFolderResult = await mainPage.FolderCheckNoArchiveAsync();

                if (storageFolderResult != null)
                {
                    stringSampleName = $"{stringFilename2} 07{mainPage.stringExtensionTxt}";
                    await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);

                    stringSampleName = $"{stringFilename2} 08{mainPage.stringExtensionTxt}";
                    await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);

                    stringSampleName    = $"{stringFoldername} 3";
                    storageFolderResult = await CreateSampleFolderAsync(storageFolderResult, stringSampleName);

                    if (storageFolderResult != null)
                    {
                        stringSampleName = $"{stringFilename2} 09{mainPage.stringExtensionTxt}";
                        await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);

                        stringSampleName = $"{stringFilename2} 10{mainPage.stringExtensionTxt}";
                        await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);

                        stringSampleName    = $"{stringFoldername} 4";
                        storageFolderResult = await CreateSampleFolderAsync(storageFolderResult, stringSampleName);

                        if (storageFolderResult != null)
                        {
                            stringSampleName = $"{stringFilename2} 11{mainPage.stringExtensionTxt}";
                            await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);

                            stringSampleName = $"{stringFilename2} 12{mainPage.stringExtensionTxt}";
                            await CreateSampleFileAsync(storageFolderResult, stringSampleName, stringSampleFileContent);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                LibMPC.OutputMsgError(TblkResult, mainPage.UnhandledExceptionMessage("SetupFolder.CreateSamplesItemsAsync()", ex.GetType()));
                throw;
            }
        }