Beispiel #1
0
        /// <summary>
        /// Attempt to buy application. Method controls visibility/Enable of PBarStatus, TblkPurchaseApp, and ButPurchaseApp.
        /// </summary>
        private async Task AppPurchaseBuy()
        {
            LibMPC.OutputMsgBright(TblkPurchaseApp, "Attempting to purchase application...");
            EnablePageItems(false);
            PBarStatus.Foreground      = LibMPC.colorError;     // Set color PBarStatus from default.
            PBarStatus.Visibility      = Visibility.Visible;
            PBarStatus.IsIndeterminate = true;
            mainPage.boolAppPurchased  = await LibMPC.AppPurchaseBuyAsync(mainPage.applicationDataContainer, mainPage.ds_BoolAppPurchased);

            if (mainPage.boolAppPurchased)
            {
                // App purchased.
                LibMPC.OutputMsgSuccess(TblkPurchaseApp, LibMPC.stringAppPurchaseResult);
                LibMPC.ButtonVisibility(ButPurchaseApp, false);
            }
            else
            {
                // App not purchased.
                LibMPC.OutputMsgError(TblkPurchaseApp, LibMPC.stringAppPurchaseResult);
                LibMPC.ButtonVisibility(ButPurchaseApp, true);
            }
            PBarStatus.IsIndeterminate = false;
            PBarStatus.Visibility      = Visibility.Collapsed;
            EnablePageItems(true);
        }
        /*** 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);
        }
        /*** Private Methods ***************************************************************************************************/

        /// <summary>
        /// Try to setup User's password. If success, then initial variables as
        /// needed and navigate to page HomePage. Otherwise ask for new password.
        /// </summary>
        /// <returns></returns>
        private void PasswordTryCreate()
        {
            try
            {
                if (PwBoxPw2.Password.Length >= mainPage.uintPasswordLengthMinimum)   // Double check that password meets minimum length requirement.
                {
                    mainPage.cryptographicKeyAppPassword = LibAES.CryptographicKeyPassword(PwBoxPw2.Password);
                    if (mainPage.cryptographicKeyAppPassword != null)
                    {
                        string stringLockerPathGet = mainPage.DataStoreLockerPath(true, mainPage.stringLockerPath);
                        if (stringLockerPathGet != null)
                        {
                            mainPage.ShowPageHomePage(); // Everything as expected so navigate to page HomePage.
                            return;                      // Successful completion so return.
                        }
                        else
                        {
                            ErrorOccurred(mainPage.resourceLoader.GetString("SP_Error_Password_Setup"));    // Could not save locker setup data.  Please try different password.
                        }
                    }
                    else
                    {
                        ErrorOccurred(mainPage.resourceLoader.GetString("UMP_Error_Password_Hash"));        // Could not hash password.  Try different password.
                    }
                }
                else
                {
                    ErrorOccurred(mainPage.resourceLoader.GetString("SP_Error_Password_Length"));   // Password must have at least four characters.  Please try different password.
                }
            }
            catch (Exception ex)
            {
                LibMPC.OutputMsgError(TblkResult, mainPage.UnhandledExceptionMessage("SetupPassword.PasswordTryCreate()", ex.GetType()));
            }
        }
 /// <summary>
 /// Do following when TboxBeamPropertiesPoissonsRatio focus changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TboxBeamPropertiesPoissonsRatio_LostFocus(object sender, RoutedEventArgs e)
 {
     _ = sender;                                                                                                        // Discard unused parameter.
     _ = e;                                                                                                             // Discard unused parameter.
     //Debug.WriteLine($"TboxBeamPropertiesPoissonsRatio_LostFocus(): Event fired.");
     CommonItems.doublePoissonsRatio = LibNum.TextBoxGetDouble(TboxBeamPropertiesPoissonsRatio, EnumTextBoxUpdate.Yes); // Get the input from the TextBox and convert to matching numeric.
     if (CommonItems.doublePoissonsRatio > 0d && CommonItems.doublePoissonsRatio < 1d)                                  // Poisson is a ratio so value must be between 0 and 1.
     {
         CommonItems.boolEnteredPoissonsRatio = true;
         LibMPC.OutputMsgSuccess(TblkBeamPropertiesLostFocus, $"{CommonItems.stringConstPoissonsRatio} valid.");
     }
     else
     {
         CommonItems.boolEnteredPoissonsRatio = false;
         CommonItems.doublePoissonsRatio      = 0d;
         LibMPC.OutputMsgError(TblkBeamPropertiesLostFocus, $"{CommonItems.stringConstPoissonsRatio} not valid.  Value must be between 0 and 1.");
     }
     mainPage.applicationDataContainer.Values[CommonItems.ds_DoublePoissonsRatio] = CommonItems.doublePoissonsRatio;
     if (CommonItems.doublePoissonsRatio.Equals(0d))
     {
         TboxBeamPropertiesPoissonsRatio.Text = string.Empty;
     }
     else
     {
         TboxBeamPropertiesPoissonsRatio.Text = CommonItems.doublePoissonsRatio.ToString(LibNum.fpNumericFormatNone);
     }
     CheckBeamPropertyInputValues();
 }
Beispiel #5
0
 /// <summary>
 /// If application has not been rated then show ButRateApp occasionally.
 /// </summary>
 private void AppRatedCheck()
 {
     if (!mainPage.boolAppRated)
     {
         if (mainPage.applicationDataContainer.Values.ContainsKey(mainPage.ds_IntAppRatedCounter))
         {
             int intAppRatedCounter = (int)mainPage.applicationDataContainer.Values[mainPage.ds_IntAppRatedCounter];
             intAppRatedCounter++;
             if (intAppRatedCounter >= intShowButRateApp)
             {
                 // Make ButRateApp visible.
                 if (mainPage.boolAppPurchased)
                 {
                     ButRateApp.Margin = new Thickness(16, 8, 16, 16);                         //ButPurchaseApp is collapsed so need to change margin from (16, 0, 16 ,16). Order is left, top, right, bottom.
                 }
                 mainPage.applicationDataContainer.Values[mainPage.ds_IntAppRatedCounter] = 0; // Reset data store setting to 0.
                 ButRateApp.Foreground = LibMPC.colorSuccess;
                 LibMPC.ButtonVisibility(ButRateApp, true);
             }
             else
             {
                 mainPage.applicationDataContainer.Values[mainPage.ds_IntAppRatedCounter] = intAppRatedCounter;     // Update data store setting to intAppRatedCounter.
             }
         }
         else
         {
             mainPage.applicationDataContainer.Values[mainPage.ds_IntAppRatedCounter] = 1;     // Initialize data store setting to 1.
         }
     }
 }
Beispiel #6
0
        /*** Page Events *******************************************************************************************************/

        /// <summary>
        /// Initialize settings for this page and set visibility of title bar items.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void Page_Loaded(object sender, RoutedEventArgs e)
        {
            _ = sender;     // Discard unused parameter.
            _ = e;          // Discard unused parameter.
            LibMPC.OutputMsgNormal(TblkPageMsg, "This App is intended for multi-monitor configurations.  App displays SMPTE type color bars.  Display can be stretched across multiple monitors.  User can then adjust monitor settings via hardware buttons and/or software settings so display appears consistent across all monitors.\n\nThe display can be reversed and/or rotated allowing comparison of image on one monitor to adjacent monitor.  Double-tap a color bar and its color will expand to fill display.  Double-tap expanded color to return to previous color bar display.  Color bar label position can be toggled Left, Center, Right, or Off, as desired.");
            // Hide button not used on page.
            LibMPC.ButtonVisibility(ButPurchaseApp, false);     // This button will be turned on below when required.
            LibMPC.ButtonVisibility(ButRateApp, false);         // This button will be turned on below when required.
            LibMPC.ButtonVisibility(mainPage.mainPageButAbout, true);
            LibMPC.ButtonVisibility(mainPage.mainPageButBack, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButLabels, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButReverse, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButRotate, false);
            mainPage.mainPageTblkAppTitle.Visibility = Visibility.Visible;
            // Set size of buttons on Start page to same size.
            List <Button> listButtonsThisPage = new List <Button>()
            {
                ButColorBars,
                ButPurchaseApp
                // Do not include ButRateApp in this list since considerably larger and only appears intermittently.
            };

            LibMPC.SizePageButtons(listButtonsThisPage);
            await AppPurchaseCheck();   // This method controls visibility/Enable of PBarStatus, TblkPurchaseApp, and ButPurchaseApp as needed.

            AppRatedCheck();
            // Setup scrolling for this page.
            LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
            ButColorBars.Focus(FocusState.Programmatic);    // Set focus to first button on page.
        }
 /// <summary>
 /// Do following when TboxLoadConcentratedMoment focus changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TboxLoadConcentratedMoment_LostFocus(object sender, RoutedEventArgs e)
 {
     _ = sender;     // Discard unused parameter.
     _ = e;          // Discard unused parameter.
     //Debug.WriteLine($"TboxLoadConcentratedMoment_LostFocus(): Event fired!");
     boolEnteredLoadConcentratedMoment = false;
     if (TboxLoadConcentratedMoment.Text.Length > 0)
     {
         doubleLoadConcentratedMoment = LibNum.TextBoxGetDouble(TboxLoadConcentratedMoment, EnumTextBoxUpdate.Yes);   // Get the input from the TextBox and convert to matching numeric.
         if (doubleLoadConcentratedMoment >= -doubleLoadConcentratedValueMax && doubleLoadConcentratedMoment <= doubleLoadConcentratedValueMax)
         {
             boolEnteredLoadConcentratedMoment = true;
             LibMPC.OutputMsgSuccess(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstMoment} valid.");
         }
         else
         {
             LibMPC.OutputMsgError(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstMoment} not valid since not in range of +/- {doubleLoadConcentratedValueMax:G}.");
         }
     }
     else
     {
         LibMPC.OutputMsgError(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstMoment} not valid since no value entered.");
     }
     CheckLoadConcentratedInputValues();
 }
 /// <summary>
 /// Page that allows User to add concentrated loads to beam.
 /// </summary>
 public EnterLoadsConcentrated()
 {
     InitializeComponent();
     // Set MainPage Button Visibility.
     LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);    // Show back button on this page since nothing done before returning to Home page.
     LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
     LibMPC.ButtonVisibility(mainPage.mainPageButSamples, false);
     // Overwrite XAML default Foreground colors.
     TblkLoadConcentratedNote.Foreground       = LibMPC.colorBright;
     TblkLoadConcentratedBeamLength.Foreground = LibMPC.colorSuccess;
     TblkLoadConcentratedDisplay.Foreground    = LibMPC.colorSuccess;
     TblkLoadConcentratedPosition.Foreground   = LibMPC.colorNormal;
     TblkLoadConcentratedForce.Foreground      = LibMPC.colorNormal;
     TblkLoadConcentratedMoment.Foreground     = LibMPC.colorNormal;
     ButLoadConcentratedReturn.Foreground      = LibMPC.colorSuccess;
     // Overwrite XAML default values.
     TblkLoadConcentratedNote.Text       = $"Enter one or more concentrated loads using consistent USC or SI units.  Enter concentrated load position from left end of beam and enter vertical force and/or moment values at position.  {CommonItems.stringConstLoadForce}  {CommonItems.stringConstLoadMoment}";
     TblkLoadConcentratedBeamLength.Text = $"{CommonItems.stringConstBeamLength} = {CommonItems.doubleBeamLength} {CommonItems.stringConstUnitsLength}";
     TblkLoadConcentratedResult.Text     = string.Empty;
     TblkLoadConcentratedPosition.Text   = $"{CommonItems.stringConstPosition} {CommonItems.stringConstPositionReference} {CommonItems.stringConstUnitsLength}";
     TblkLoadConcentratedForce.Text      = $"{CommonItems.stringConstForce} {CommonItems.stringConstUnitsForce} {CommonItems.stringConstLoadForce}";
     TblkLoadConcentratedMoment.Text     = $"{CommonItems.stringConstMoment} {CommonItems.stringConstUnitsMoment} {CommonItems.stringConstLoadMoment}";
     ButLoadConcentratedAdd.Content      = "Add above concentrated load";
     ButLoadConcentratedReturn.Content   = $"{CommonItems.stringConstButtonReturn}";
     ButLoadConcentratedClear.Content    = "Clear concentrated loads";
     // Set XAML PlaceholderText values.
     TboxLoadConcentratedPosition.PlaceholderText = CommonItems.stringConstPosition;
     TboxLoadConcentratedForce.PlaceholderText    = CommonItems.stringConstForce;
     TboxLoadConcentratedMoment.PlaceholderText   = CommonItems.stringConstMoment;
     // Setup scrolling for this page.
     LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
 }
 /// <summary>
 /// Do following when TboxLoadConcentratedPosition focus changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TboxLoadConcentratedPosition_LostFocus(object sender, RoutedEventArgs e)
 {
     _ = sender;     // Discard unused parameter.
     _ = e;          // Discard unused parameter.
     //Debug.WriteLine($"TTboxLoadConcentratedPosition_LostFocus(): Event fired.");
     boolEnteredLoadConcentratedPosition = false;
     if (TboxLoadConcentratedPosition.Text.Length > 0)
     {
         doubleLoadConcentratedPosition = LibNum.TextBoxGetDouble(TboxLoadConcentratedPosition, EnumTextBoxUpdate.Yes); // Get the input from the TextBox and convert to matching numeric.
         if (doubleLoadConcentratedPosition >= 0d && doubleLoadConcentratedPosition <= CommonItems.doubleBeamLength)    // Verify concentrated load is on beam.
         {
             boolEnteredLoadConcentratedPosition = true;
             LibMPC.OutputMsgSuccess(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstPosition} valid.");
         }
         else
         {
             LibMPC.OutputMsgError(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstPosition} not valid since not on beam.");
         }
     }
     else
     {
         LibMPC.OutputMsgError(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstPosition} not valid since no value entered.");
     }
     CheckLoadConcentratedInputValues();
 }
 /// <summary>
 /// Do following when TboxLoadConcentratedForce focus changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TboxLoadConcentratedForce_LostFocus(object sender, RoutedEventArgs e)
 {
     _ = sender;     // Discard unused parameter.
     _ = e;          // Discard unused parameter.
     //Debug.WriteLine($"TboxLoadConcentratedForce_LostFocus(): Event fired.");
     boolEnteredLoadConcentratedForce = false;
     if (TboxLoadConcentratedForce.Text.Length > 0)
     {
         doubleLoadConcentratedForce = LibNum.TextBoxGetDouble(TboxLoadConcentratedForce, EnumTextBoxUpdate.Yes);           // Get the input from the TextBox and convert to matching numeric.
         // Limit maximum force to resonable value. Value can be positive or negative.
         if (doubleLoadConcentratedForce >= -doubleLoadConcentratedValueMax && doubleLoadConcentratedForce <= doubleLoadConcentratedValueMax)
         {
             boolEnteredLoadConcentratedForce = true;
             LibMPC.OutputMsgSuccess(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstForce} valid.");
         }
         else
         {
             LibMPC.OutputMsgError(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstForce} not valid since not in range of +/- {doubleLoadConcentratedValueMax:G}.");
         }
     }
     else
     {
         LibMPC.OutputMsgError(TblkLoadConcentratedLostFocus, $"{CommonItems.stringConstForce} not valid since no value entered.");
     }
     CheckLoadConcentratedInputValues();
 }
Beispiel #11
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);
        }
Beispiel #12
0
 /// <summary>
 /// Page that shows information about application.
 /// </summary>
 public About()
 {
     InitializeComponent();
     // Hide XAML layout rectangles by setting their color to RelativePanel Background color.
     RectLayoutCenter.Fill = Rpanel.Background;
     RectLayoutLeft.Fill   = Rpanel.Background;
     RectLayoutRight.Fill  = Rpanel.Background;
     // Set MainPage Button Visibility.
     LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
     LibMPC.ButtonVisibility(mainPage.mainPageButSamples, false);
     LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);
     // Overwrite XAML TextBlock Foreground colors.
     TblkAboutDeveloper.Foreground = LibMPC.colorBright;
     TblkAboutPayment.Foreground   = LibMPC.colorSuccess;
     TblkAboutApp.Foreground       = LibMPC.colorNormal;
     TblkAboutCredit.Foreground    = LibMPC.colorSuccess;
     TblkAboutDisclaim.Foreground  = LibMPC.colorError;
     TblkAboutLinks.Foreground     = LibMPC.colorSuccess;
     // Overwrite XAML default values.
     TblkAboutDeveloper.Text = $"Installed application version is {mainPage.stringAppVersion}\nContact developer using following Email link if you encounter issues with application.";
     TblkAboutPayment.Text   = stringAboutPayment;
     TblkAboutApp.Text       = stringAboutApp;
     TblkAboutCredit.Text    = stringAboutCredit;
     TblkAboutDisclaim.Text  = stringAboutDisclaim;
     TblkAboutLinks.Text     = stringAboutLinks;
     ButAboutEmail.Content   = "Email Support";
     ButAboutRateApp.Content = "Rate and review app";
     ButAboutCredit.Content  = "Staskolukasz fob2d app";
     ButAboutFEM.Content     = "Finite element method";
     // Setup scrolling for this page.
     LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
 }
 /// <summary>
 /// Do following when TboxLoadUniformForceRight focus changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TboxLoadUniformForceRight_LostFocus(object sender, RoutedEventArgs e)
 {
     _ = sender;     // Discard unused parameter.
     _ = e;          // Discard unused parameter.
     //Debug.WriteLine($"TboxLoadUniformForceRight_LostFocus(): Event fired.");
     boolEnteredLoadUniformForceRight = false;
     if (TboxLoadUniformForceRight.Text.Length > 0)
     {
         doubleLoadUniformForceRight = LibNum.TextBoxGetDouble(TboxLoadUniformForceRight, EnumTextBoxUpdate.Yes);           // Get the input from the TextBox and convert to matching numeric.
         // Limit maximum force to resonable value. Value can be positive or negative.
         if (doubleLoadUniformForceRight >= -doubleLoadUniformForceMaximum && doubleLoadUniformForceRight <= doubleLoadUniformForceMaximum)
         {
             // Skip error messages if right value not entered.
             if (TboxLoadUniformForceRight.Text.Length == 0 || CheckSignSameDouble(doubleLoadUniformForceLeft, doubleLoadUniformForceRight))
             {
                 boolEnteredLoadUniformForceRight = true;
                 LibMPC.OutputMsgSuccess(TblkLoadUniformLostFocus, $"{CommonItems.stringConstForceRight} valid.");
             }
             else
             {
                 LibMPC.OutputMsgError(TblkLoadUniformLostFocus, $"{CommonItems.stringConstForceRight} not valid since sign not same as {CommonItems.stringConstForceLeft}.");
             }
         }
         else
         {
             LibMPC.OutputMsgError(TblkLoadUniformLostFocus, $"{CommonItems.stringConstForceRight} not valid since not in range of +/- {doubleLoadUniformForceMaximum:G}.");
         }
     }
     else
     {
         LibMPC.OutputMsgError(TblkLoadUniformLostFocus, $"{CommonItems.stringConstForceRight} not valid since no value entered.");
     }
     CheckLoadUniformInputValues();
 }
 /// <summary>
 /// Clear beam properties.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void ButBeamPropertiesClear_Click(object sender, RoutedEventArgs e)
 {
     _ = sender;     // Discard unused parameter.
     _ = e;          // Discard unused parameter.
     //Debug.WriteLine("ButBeamPropertiesClear_Click() event fired.");
     CommonItems.stringNameMaterial = TboxBeamPropertiesNameMaterial.Text = string.Empty;
     mainPage.applicationDataContainer.Values[CommonItems.ds_StringNameMaterial] = TboxBeamPropertiesNameMaterial.Text;
     TboxBeamPropertiesYoungsModulus.Text = string.Empty;
     CommonItems.boolEnteredYoungsModulus = false;
     CommonItems.doubleYoungsModulus      = 0d;
     mainPage.applicationDataContainer.Values[CommonItems.ds_DoubleYoungsModulus] = CommonItems.doubleYoungsModulus;
     TboxBeamPropertiesPoissonsRatio.Text = string.Empty;
     CommonItems.boolEnteredPoissonsRatio = false;
     CommonItems.doublePoissonsRatio      = 0d;
     mainPage.applicationDataContainer.Values[CommonItems.ds_DoublePoissonsRatio] = CommonItems.doublePoissonsRatio;
     CommonItems.stringNameCrossSection = TboxBeamPropertiesNameCrossSection.Text = string.Empty;
     mainPage.applicationDataContainer.Values[CommonItems.ds_StringNameCrossSection] = TboxBeamPropertiesNameCrossSection.Text;
     TboxBeamPropertiesInertia.Text = string.Empty;
     CommonItems.boolEnteredInertia = false;
     CommonItems.doubleInertia      = 0d;
     mainPage.applicationDataContainer.Values[CommonItems.ds_DoubleInertia] = CommonItems.doubleInertia;
     TboxBeamPropertiesLength.Text     = string.Empty;
     CommonItems.boolEnteredBeamLength = false;
     CommonItems.doubleBeamLength      = 0d;
     mainPage.applicationDataContainer.Values[CommonItems.ds_DoubleBeamLength] = CommonItems.doubleBeamLength;
     // Also clear supports and loads.
     CommonItems.ClearSupports();
     CommonItems.ClearLoadsConcentrated();
     CommonItems.ClearLoadsUniform();
     CheckBeamPropertyInputValues();
     LibMPC.OutputMsgSuccess(TblkBeamPropertiesLostFocus, "Cleared all items in this page.  Also cleared any existing supports and loads.");
 }
 /// <summary>
 /// Do following when TboxBeamPropertiesInertia focus changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TboxBeamPropertiesInertia_LostFocus(object sender, RoutedEventArgs e)
 {
     _ = sender;                                                                                            // Discard unused parameter.
     _ = e;                                                                                                 // Discard unused parameter.
     //Debug.WriteLine($"TboxBeamPropertiesInertia_LostFocus(): Event fired.");
     CommonItems.doubleInertia = LibNum.TextBoxGetDouble(TboxBeamPropertiesInertia, EnumTextBoxUpdate.Yes); // Get the input from the TextBox and convert to matching numeric.
     if (CommonItems.doubleInertia >= doubleInertiaMinimum && CommonItems.doubleInertia <= doubleInertiaMaximum)
     {
         CommonItems.boolEnteredInertia = true;
         LibMPC.OutputMsgSuccess(TblkBeamPropertiesLostFocus, $"{CommonItems.stringConstInertia} valid.");
     }
     else
     {
         CommonItems.boolEnteredInertia = false;
         CommonItems.doubleInertia      = 0d;
         LibMPC.OutputMsgError(TblkBeamPropertiesLostFocus, $"{CommonItems.stringConstInertia} not valid.  Value must be in range of {doubleInertiaMinimum.ToString(LibNum.fpNumericFormatNone)} to {doubleInertiaMaximum.ToString(LibNum.fpNumericFormatNone)}.");
     }
     mainPage.applicationDataContainer.Values[CommonItems.ds_DoubleInertia] = CommonItems.doubleInertia;
     if (CommonItems.doubleInertia.Equals(0d))
     {
         TboxBeamPropertiesInertia.Text = string.Empty;
     }
     else
     {
         TboxBeamPropertiesInertia.Text = CommonItems.doubleInertia.ToString(LibNum.fpNumericFormatNone);
     }
     CheckBeamPropertyInputValues();
 }
        /*** Page Events *******************************************************************************************************/

        /// <summary>
        /// Try to retrieve locker folder from FutureAccessList and set focus to PwBoxEPPw if success. Otherwise show error message.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async 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>()
            {
                ButContinue,
                ButLockerReset
            };

            LibMPC.SizePageButtons(listButtonsThisPage);
            ButLockerReset.Foreground = LibMPC.colorError;
            TblkResult.Text           = string.Empty;                                                      // Clear placeholder text.
            PwBoxPw.PlaceholderText   = mainPage.resourceLoader.GetString("EP_PwBox_PlaceholderText");     // Password
            LibMPC.OutputMsgSuccess(TblkPageTitle, mainPage.resourceLoader.GetString("EP_TblkPageTitle")); // Application password entry
            LibMPC.OutputMsgBright(TblkPageMsg, mainPage.resourceLoader.GetString("EP_TblkPageMsg"));      // Enter password to unlock and open locker folder.
            LibMPC.OutputMsgBright(TblkLockerResetMsg, mainPage.GetLockerResetMsg());                      // Get Locker Reset message.
            // Setup scrolling for this page.
            LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
            await GetLockerFolder();
        }
        /// <summary>
        /// Code that runs after page is loaded that will not execute properly until page is rendered.
        /// </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.
            List <TextBox> listTextBox = new List <TextBox>()
            {
                TboxLoadConcentratedPosition,
                TboxLoadConcentratedForce,
                TboxLoadConcentratedMoment
            };

            LibMPC.SizePageTextBoxes(listTextBox);
            List <Button> listButton = new List <Button>()
            {
                ButLoadConcentratedAdd,
                ButLoadConcentratedReturn,
                ButLoadConcentratedClear
            };

            LibMPC.SizePageButtons(listButton);
            // Special case for this page: Ensure MinWidth of TextBoxes >= MinWidth of Buttons.
            if (TboxLoadConcentratedMoment.MinWidth < ButLoadConcentratedClear.MinWidth)
            {
                double doubleMinWidth = ButLoadConcentratedClear.MinWidth;
                TboxLoadConcentratedPosition.MinWidth = doubleMinWidth;
                TboxLoadConcentratedForce.MinWidth    = doubleMinWidth;
                TboxLoadConcentratedMoment.MinWidth   = doubleMinWidth;
            }
            LoadConcentratedDefaultValues();
        }
Beispiel #18
0
        /// <summary>
        /// Code that runs after page is loaded that will not execute properly until page is rendered.
        /// </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.
            List <ToggleSwitch> listToggleSwitchesThisPage = new List <ToggleSwitch>()
            {
                TogSupportDisplacement,
                TogSupportRotation
            };

            LibMPC.SizePageToggleSwitches(listToggleSwitchesThisPage);
            List <Button> listButton = new List <Button>()
            {
                ButSupportAdd,
                ButSupportReturn,
                ButSupportClear
            };

            LibMPC.SizePageButtons(listButton);
            // Only one TextBox this pages so set MinWidth to above button widths.
            TboxSupportPosition.MinWidth = ButSupportClear.MinWidth;
            // Resize following defined support buttons separately since description is much longer.
            listButton = new List <Button>()
            {
                ButSupportDefined1,
                ButSupportDefined2
            };
            LibMPC.SizePageButtons(listButton);
            SetDefaultValuesSupport();
            CommonItems.ButtonForegroundColorSet(ButSupportReturn, true);
            CommonItems.ButtonForegroundColorSet(ButSupportClear, CommonItems.boolEnteredSupport);
        }
Beispiel #19
0
 /// <summary>
 /// Page that allows User to add supports to beam.
 /// </summary>
 public EnterSupports()
 {
     InitializeComponent();
     // Set MainPage Button Visibility.
     LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);
     LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
     LibMPC.ButtonVisibility(mainPage.mainPageButSamples, false);
     // Overwrite XAML TextBlock Foreground colors.
     TblkSupportNote.Foreground         = LibMPC.colorBright;
     TblkSupportBeamLength.Foreground   = LibMPC.colorSuccess;
     TblkSupportDisplay.Foreground      = LibMPC.colorSuccess;
     TblkSupportPosition.Foreground     = LibMPC.colorNormal;
     TblkSupportDisplacement.Foreground = LibMPC.colorNormal;
     TblkSupportRotation.Foreground     = LibMPC.colorNormal;
     // Overwrite XAML default values.
     TblkSupportNote.Text         = "Enter one or more supports using consistent USC or SI units.  Enter support position from left end of beam and set displacement and rotation toggles on or off.  Entered supports should create a stable beam.";
     TblkSupportBeamLength.Text   = $"{CommonItems.stringConstBeamLength} = {CommonItems.doubleBeamLength} {CommonItems.stringConstUnitsLength}";
     TblkSupportResult.Text       = string.Empty;
     TblkSupportPosition.Text     = $"{CommonItems.stringConstPosition} {CommonItems.stringConstPositionReference} {CommonItems.stringConstUnitsLength}";
     TblkSupportDisplacement.Text = $"{CommonItems.stringConstDisplacement}";
     TblkSupportRotation.Text     = $"{CommonItems.stringConstRotation}";
     ButSupportAdd.Content        = "Add above support";
     ButSupportReturn.Content     = $"{CommonItems.stringConstButtonReturn}";
     ButSupportDefined1.Content   = "Add simple supports at each end of beam";
     ButSupportDefined2.Content   = "Add cantilever support at left end of beam";
     // Set XAML PlaceholderText values.
     TboxSupportPosition.PlaceholderText = CommonItems.stringConstPosition;
     // Setup scrolling for this page.
     LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
 }
Beispiel #20
0
 /// <summary>
 /// Enable items on page if boolEnableItems is true, otherwise disable items on page.
 /// </summary>
 /// <param name="boolEnableItems">If true then enable page items, otherwise disable.</param>
 private void EnablePageItems(bool boolEnableItems)
 {
     LibMPC.ButtonIsEnabled(mainPage.mainPageButAbout, boolEnableItems);
     LibMPC.ButtonIsEnabled(ButColorBars, boolEnableItems);
     LibMPC.ButtonIsEnabled(ButPurchaseApp, boolEnableItems);
     LibMPC.ButtonIsEnabled(ButRateApp, boolEnableItems);
 }
Beispiel #21
0
 /// <summary>
 /// Do following when TboxSupportPosition focus changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void TboxSupportPosition_LostFocus(object sender, RoutedEventArgs e)
 {
     _ = sender;     // Discard unused parameter.
     _ = e;          // Discard unused parameter.
     //Debug.WriteLine($"TboxSupportPosition_LostFocus(): Event fired.");
     boolEnteredSupportPosition = false;
     if (TboxSupportPosition.Text.Length > 0)
     {
         doubleSupportPosition = LibNum.TextBoxGetDouble(TboxSupportPosition, EnumTextBoxUpdate.Yes); // Get the input from the TextBox and convert to matching numeric.
         if (doubleSupportPosition >= 0d && doubleSupportPosition <= CommonItems.doubleBeamLength)    // Verify support is on beam.
         {
             boolEnteredSupportPosition = true;
             LibMPC.OutputMsgSuccess(TblkSupportLostFocus, "Valid support position entered.");
         }
         else
         {
             LibMPC.OutputMsgError(TblkSupportLostFocus, "Invalid support position entered.  Support must be on beam.");
         }
     }
     else
     {
         LibMPC.OutputMsgError(TblkSupportLostFocus, "Invalid support position since no value entered.");
     }
     CheckSupportInputValues();
 }
Beispiel #22
0
        /*** Private Methods ***************************************************************************************************/

        /// <summary>
        /// Reset App to various states using parameter enumResetApp.
        /// </summary>
        /// <param name="enumResetApp">Enum used to reset App setup values.</param>
        private void AppReset(EnumResetApp enumResetApp)
        {
            switch (enumResetApp)
            {
            case EnumResetApp.DoNothing:                    // Do nothing. Most common so exit quick.
                break;

            case EnumResetApp.ResetApp:                     // Clear all data store settings.
                applicationDataContainer.Values.Clear();
                break;

            case EnumResetApp.ResetPurchaseHistory:         // Clear App purchase history.
                applicationDataContainer.Values.Remove(ds_BoolAppPurchased);
                boolAppPurchased = false;
                break;

            case EnumResetApp.ResetRateHistory:             // Clear App rate history.
                applicationDataContainer.Values.Remove(ds_BoolAppRated);
                boolAppRated = false;
                break;

            case EnumResetApp.ShowDataStoreValues:             // Show data store values via Debug.
                LibMPC.ListDataStoreItems(applicationDataContainer);
                break;

            default:        // Throw exception so error can be discovered and corrected.
                throw new NotSupportedException($"MainPage.AppReset(): enumResetApp={enumResetApp} not found in switch statement.");
            }
        }
Beispiel #23
0
 /// <summary>
 /// Invoked when user clicks 'ButRateApp'. MS Store popup box will lock out all access to App.
 /// Goal is to get more App ratings in Microsoft Store without hassling User too much.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void ButRateApp_Click(object sender, RoutedEventArgs e)
 {
     _ = sender;     // Discard unused parameter.
     _ = e;          // Discard unused parameter.
     if (await mainPage.RateAppInW10Store())
     {
         LibMPC.ButtonVisibility(ButRateApp, false);
     }
 }
 /// <summary>
 /// Revert application to default settings..
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void ButAppReset_Click(object sender, RoutedEventArgs e)
 {
     _ = sender;     // Discard unused parameter.
     _ = e;          // Discard unused parameter.
     if (await LibMPC.ShowPopupBoxAsync("Reset application?", "Click 'Yes' to reset application to default settings.", "Yes", "No"))
     {
         mainPage.AppReset(EnumResetApp.ResetApp);
         Application.Current.Exit();     // Exit App to complete reset.
     }
 }
Beispiel #25
0
 /// <summary>
 /// Open Windows 10 Store App so User can rate and review this App.
 /// </summary>
 /// <returns></returns>
 public async Task <bool> RateAppInW10Store()
 {
     if (await LibMPC.ShowRatingReviewDialogAsync())
     {
         boolAppRated = true;
         applicationDataContainer.Values[ds_BoolAppRated] = true;        // Write setting to data store.
         applicationDataContainer.Values.Remove(ds_IntAppRatedCounter);  // Remove ds_IntAppRatedCounter since no longer used.
         return(true);
     }
     return(false);
 }
 /// <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"));
     }
 }
 /// <summary>
 /// Display error messages to user and set other UI items as required..
 /// </summary>
 /// <param name="stringErrorMessage">Error message to display in TblkSPResult.</param>
 private void ErrorOccurred(string stringErrorMessage)
 {
     boolPasswordError1 = true;              // Skip one pass on password entry error.
     PwBoxPw1.Password  = string.Empty;      // Change causes event to fire.
     boolPasswordError2 = true;              // Skip one pass on password entry error.
     PwBoxPw2.Password  = string.Empty;      // Change causes event to fire.
     LibMPC.OutputMsgError(TblkResult, stringErrorMessage);
     // HideContinue button until password and subfolder successfully created.
     LibMPC.ButtonVisibility(ButContinue, false);
     PwBoxPw1.Focus(FocusState.Programmatic);
 }
        /// <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));
        }
        /// <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()));
            }
        }
Beispiel #30
0
        /// <summary>
        /// Code that runs after page is loaded that will not execute properly until page is rendered.
        /// </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.
            List <Button> listButton = new List <Button>()
            {
                ButSamplesA36Steel,
                ButSamplesBeamsWF,
                ButSamplesPUC
            };

            LibMPC.SizePageButtons(listButton);
        }