コード例 #1
0
 /// <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);
 }
コード例 #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>
 /// 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);
 }
コード例 #4
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.
        }
コード例 #5
0
        /*** 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();
        }
コード例 #6
0
ファイル: About.xaml.cs プロジェクト: BajaPaul/BeamAnalysis
 /// <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);
 }
コード例 #7
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);
        }
コード例 #8
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);
        }
コード例 #9
0
 /// <summary>
 /// Page that displays User entered uniform loads and resulting concentrated loads used to simulate the uniform load. Output is formatted text string.
 /// </summary>
 public DisplaySimulatedLoads()
 {
     InitializeComponent();
     // Set MainPage Button Visibility.
     LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);    // Show back button on this page since nothing done before returning to previous page.
     LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
     LibMPC.ButtonVisibility(mainPage.mainPageButSamples, false);
     // Overwrite XAML TextBlock Foreground colors.
     TblkDisplaySimulatedLoadsNote.Foreground   = LibMPC.colorBright;
     TblkDisplaySimulatedLoadsOutput.Foreground = LibMPC.colorNormal;
     // Overwrite XAML default values.
     TblkDisplaySimulatedLoadsNote.Text   = $"Display of User entered uniform loads and resulting concentrated loads used to simulate the uniform load.  App simulates uniform loads with series of concentrated loads.  Uniform loads are split into segments of equal length.  Then area and centroid for each segment is calculated.  Then an equivalent concentrated load is applied to the centroid position of the segment.  Output results can be refined by using smaller segments at expense of computer processing time and more output to view.  {CommonItems.stringConstLoadForce}.";
     TblkDisplaySimulatedLoadsOutput.Text = CommonItems.stringOutputResults;
     // Clear CommonItems.stringOutputResults since no longer needed.
     CommonItems.stringOutputResults = string.Empty;
     // Setup scrolling for this page.
     LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
 }
コード例 #10
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 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;
            // Set visibility of titlebar items.
            LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);
            // Set XAML item colors and other settings.
            LibMPC.OutputMsgSuccess(TblkPageTitle, "Application information");
            LibMPC.OutputMsgError(TblkAboutBaseUnit, $"Input option followed by {mainPage.stringBaseUnitIndicator} is base used for conversion.{Environment.NewLine}Input is converted to base.  Base is then converted to output.");
            LibMPC.OutputMsgNormal(TblkAboutProgrammer, $"Installed version is {mainPage.stringAppVersion}{Environment.NewLine}Contact developer using following Email link if you encounter any dead links or other issues with application.{Environment.NewLine}{CountConversions()}");
            LibMPC.OutputMsgSuccess(TblkAboutPayment, "Unlimited trial period for evaluation.  Buy application once and use on all your Windows 10 devices.  Please rate and review application.");
            LibMPC.OutputMsgBright(TblkAboutApp, "Application converts input value to related output value.  Sample conversion is Length.  1 foot converts exactly to 0.3048 meters.  Application uses Decimal Types which provide about twice the precision of Double Types.  Disadvantage of using Decimal Types versus Double Types is they are unable to handle extremely large or extremely small numbers that Double Types can process.  For general everyday use this limitation is not an issue.  As with any computer floating-point type calculation, Decimal Types are subject to small rounding errors in various situations.  Many of these errors are obvious and require 'Smart Rounding' and/or truncation of various ‘Trash Digits' to return mathematically exact value.  There is no simple solution that works for every case.  Simply rounding of a Decimal Type to a Double Type will correct many of these small rounding errors but potentially could lose many good significant digits of precision.  This is an option with this application and is handy for copy-paste operations into other applications that will not accept the precision of Decimal Types.  By default, application expends considerable effort to do 'Smart Rounding' to return mathematically exact result to as many significant digits as possible.  'Smart Rounding' will return the original unrounded result if it cannot complete successfully.  User can toggle output format from 'None', to 'Separator', to 'Scientific', to 'Double', and to 'Double x 10ⁿ' formats.  The desired formatted result can then be copied to allow pasting into other applications.");
            LibMPC.OutputMsgBright(TblkAboutUnits, "Throughout history, many methods of measurements have been used.  This application converts values between three dominant systems referred to as SI, US, and IMP.  The avoirdupois system of units became popular in the 13th century.  England, along with many other countries, used this system for trade.  The United States of America (USA), as a former colony of England, also used the avoirdupois system.  In 1824, the United Kingdom, formerly England, revised its system of measurements to the Imperial System which this application refers to as 'IMP'.  The USA chose not to adopt the Imperial System and retained the avoirdupois system.  In time, the avoirdupois system used by the USA became known as the US Customary Systems of Measurement, which this application refers to as 'US'.  The International System of Units 'SI', also known as the Metric System, came about around 1960.  Since then, 'SI' has become the standard system of measurement used by most of the world.  Unfortunately, around 1980, the USA abandoned their transition to 'SI' units and now uses 'US' or 'SI' units where applicable.");
            LibMPC.OutputMsgError(TblkAboutDisclaim, "DISCLAIMER: User assumes all risk of using calculated values from application.  Developer has done considerable research and testing to validate results are correct.  Many relevant links are provided to User to further research and verify results calculated by application.");
            LibMPC.OutputMsgNormal(TblkAboutLinks, "Explore following links for more information about various measurement systems and related conversions.");
            List <Button> listButtonsThisPage = new List <Button>()
            {
                ButEmail,
                ButRateApp,
                ButConversionOfUnits,
                ButInternationalSystemOfUnits,
                ButUnitedStatesCustomaryUnits,
                ButImperialUnits,
                ButAvoirdupois,
                ButMetricPrefixes,
                ButMetricationUnitedStates,
                ButAppReset
            };

            LibMPC.SizePageButtons(listButtonsThisPage);
            ButAppReset.Foreground = LibMPC.colorError;
            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);
            ButEmail.Focus(FocusState.Programmatic);    // Set focus to first button on page.
        }
コード例 #11
0
ファイル: About.xaml.cs プロジェクト: BajaPaul/ColorBars
        /*** 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 void Page_Loaded(object sender, RoutedEventArgs e)
        {
            _ = sender;     // Discard unused parameter.
            _ = e;          // Discard unused parameter.
            LibMPC.OutputMsgNormal(TblkPageMsg, $"Application by Paul Ghilino.  Version: {mainPage.stringAppVersion}");
            LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
            LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);
            // Set size of buttons on About page to same size.
            List <Button> listButtonsThisPage = new List <Button>()
            {
                ButRateApp,
                ButSMPTE,
                ButLearnMore,
                ButEmail
            };

            LibMPC.SizePageButtons(listButtonsThisPage);
            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);      // Set focus to first button on page.
        }
コード例 #12
0
 /// <summary>
 /// Page that displays calculated beam results from User entered input. Output is formatted text string.
 /// </summary>
 public DisplayResults()
 {
     InitializeComponent();
     // Set MainPage Button Visibility.
     LibMPC.ButtonVisibility(mainPage.mainPageButAbout, false);
     LibMPC.ButtonVisibility(mainPage.mainPageButBack, true);
     LibMPC.ButtonVisibility(mainPage.mainPageButSamples, false);
     // Overwrite XAML TextBlock Foreground colors.
     TblkDisplayResultsNote.Foreground     = LibMPC.colorBright;
     TblkDisplayResultsOutput.Foreground   = LibMPC.colorNormal;
     TblkDisplayResultsSaveMsgs.Foreground = LibMPC.colorSuccess;
     ButDisplayResultsSave.Foreground      = LibMPC.colorSuccess;
     // Overwrite XAML default values.
     TblkDisplayResultsNote.Text     = "Calculated beam results";
     TblkDisplayResultsOutput.Text   = CommonItems.stringOutputResults;
     TblkDisplayResultsSaveMsgs.Text = "Click following button to save these results to a file. Then select folder you want to save results too.  Then select existing file or right-click to create a New > Text Document.  If new file, then rename Text Document to something else.  Make sure the file is selected before clicking Open.";
     ButDisplayResultsSave.Content   = "Save results";
     // Clear CommonItems.stringOutputResults since no longer needed.
     CommonItems.stringOutputResults = string.Empty;
     // Setup scrolling for this page.
     LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
 }
コード例 #13
0
 /// <summary>
 /// Page that allows User to enter physical properties of beam.
 /// </summary>
 public EnterBeamProperties()
 {
     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 TextBlock Foreground colors.
     TblkBeamPropertiesNote.Foreground             = LibMPC.colorBright;
     TblkBeamPropertiesNameMaterial.Foreground     = LibMPC.colorNormal;
     TblkBeamPropertiesYoungModulus.Foreground     = LibMPC.colorNormal;
     TblkBeamPropertiesPoissonsRatio.Foreground    = LibMPC.colorNormal;
     TblkBeamPropertiesNameCrossSection.Foreground = LibMPC.colorNormal;
     TblkBeamPropertiesInertia.Foreground          = LibMPC.colorNormal;
     TblkBeamPropertiesLength.Foreground           = LibMPC.colorNormal;
     // Overwrite XAML default values.
     TblkBeamPropertiesNote.Text             = "Enter beam properties using consistent USC or SI units.  If beam length is changed, then any existing supports and loads will be cleared since they are dependent on beam length.";
     TblkBeamPropertiesDisplay.Text          = string.Empty;
     TblkBeamPropertiesLostFocus.Text        = string.Empty;
     TblkBeamPropertiesNameMaterial.Text     = $"{CommonItems.stringConstDescriptionMaterial} (optional).";
     TblkBeamPropertiesYoungModulus.Text     = $"{CommonItems.stringConstYoungsModulus} {CommonItems.stringConstUnitsYoungsModulus}";
     TblkBeamPropertiesPoissonsRatio.Text    = $"{CommonItems.stringConstPoissonsRatio}.";
     TblkBeamPropertiesNameCrossSection.Text = $"{CommonItems.stringConstDescriptionCrossSection} (optional).";
     TblkBeamPropertiesInertia.Text          = $"{CommonItems.stringConstInertia} {CommonItems.stringConstUnitsInertia}";
     TblkBeamPropertiesLength.Text           = $"{CommonItems.stringConstBeamLength} {CommonItems.stringConstUnitsLength}";
     ButBeamPropertiesReturn.Content         = CommonItems.stringConstButtonReturn;
     ButBeamPropertiesReturn.Foreground      = LibMPC.colorSuccess;
     ButBeamPropertiesClear.Content          = "Clear beam properties";
     // Set XAML PlaceholderText values.
     TboxBeamPropertiesNameMaterial.PlaceholderText     = CommonItems.stringConstDescriptionMaterial;
     TboxBeamPropertiesYoungsModulus.PlaceholderText    = CommonItems.stringConstYoungsModulus;
     TboxBeamPropertiesPoissonsRatio.PlaceholderText    = CommonItems.stringConstPoissonsRatio;
     TboxBeamPropertiesNameCrossSection.PlaceholderText = CommonItems.stringConstDescriptionCrossSection;
     TboxBeamPropertiesInertia.PlaceholderText          = CommonItems.stringConstInertia;
     TboxBeamPropertiesLength.PlaceholderText           = CommonItems.stringConstBeamLength;
     // Setup scrolling for this page.
     LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
 }
コード例 #14
0
ファイル: Samples.xaml.cs プロジェクト: BajaPaul/BeamAnalysis
        /// <summary>
        /// Page that shows various samples and results using consistent USC or SI unit combinations.
        /// </summary>
        public Samples()
        {
            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.
            TblkSamplesNotes.Foreground      = LibMPC.colorBright;
            TblkSamplesProperties.Foreground = LibMPC.colorNormal;
            TblkSamples1.Foreground          = LibMPC.colorSuccess;
            TblkSamples2.Foreground          = LibMPC.colorError;
            TblkSamples3.Foreground          = LibMPC.colorSuccess;
            TblkInfoPUC.Foreground           = LibMPC.colorNormal;
            // Overwrite XAML default values.
            TblkSamplesNotes.Text      = $"{CommonItems.stringConstApplicationNote}\n\n{CommonItems.stringConstUnitsUSCInch}\n{CommonItems.stringConstUnitsUSCFoot}\n{CommonItems.stringConstUnitsSI}";
            TblkSamplesProperties.Text = stringProperties01 + stringProperties02 + stringProperties03 + stringProperties04 + stringProperties05 + stringProperties06 + stringProperties07 + stringProperties08;

            TblkSamples1.Text = stringSample1_1 + stringSample1_2 + stringSample1_3 + stringSample1_4 + stringSample1_5;
            TblkSamples2.Text = stringSample2_1 + stringSample2_2 + stringSample2_3 + stringSample2_4;
            TblkSamples3.Text = stringSample3_1 + stringSample3_2 + stringSample3_3 + stringSample3_4 + stringSample3_5;

            ButSamplesA36Steel.Content = "ASTM-A36 Steel Properties";
            ButSamplesBeamsWF.Content  = "Wide Flange Beams";
            TblkInfoPUC.Text           = stringInfoPUC;
            ButSamplesPUC.Content      = stringTitlePUC;
            ButSamplesA36Steel.Tag     = "https://en.wikipedia.org/wiki/A36_steel";
            ButSamplesBeamsWF.Tag      = "https://www.structural-drafting-net-expert.com/steel-sections-i-beam-w-shape.html";
            ButSamplesPUC.Tag          = "https://www.microsoft.com/store/apps/9NBLGGH438MK";
            // Setup scrolling for this page.
            LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
        }
コード例 #15
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);
        }
コード例 #16
0
 /// <summary>
 /// Page that allows User to add uniform loads to beam.
 /// </summary>
 public EnterLoadsUniform()
 {
     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.
     TblkLoadUniformNote.Foreground          = LibMPC.colorBright;
     TblkLoadUniformBeamLength.Foreground    = LibMPC.colorSuccess;
     TblkLoadUniformDisplay.Foreground       = LibMPC.colorSuccess;
     TblkLoadUniformPositionLeft.Foreground  = LibMPC.colorNormal;
     TblkLoadUniformForceLeft.Foreground     = LibMPC.colorNormal;
     TblkLoadUniformPositionRight.Foreground = LibMPC.colorNormal;
     TblkLoadUniformForceRight.Foreground    = LibMPC.colorNormal;
     ButLoadUniformReturn.Foreground         = LibMPC.colorSuccess; // Always can return to previous page.
     // Overwrite XAML default values.
     TblkLoadUniformNote.Text             = $"Enter one or more uniform loads using consistent USC or SI units.  Enter left and right uniform load positions from left end of beam and enter left and right vertical force values per unit length of beam.  {CommonItems.stringConstLoadForce}  Uniform loads are simulated by distributing concentrated loads via straight line from left to right.";
     TblkLoadUniformBeamLength.Text       = $"{CommonItems.stringConstBeamLength} = {CommonItems.doubleBeamLength} {CommonItems.stringConstUnitsLength}";
     TblkLoadUniformResult.Text           = string.Empty;
     TblkLoadUniformPositionLeft.Text     = $"{CommonItems.stringConstPositionLeft} {CommonItems.stringConstPositionReference} {CommonItems.stringConstUnitsLength}";
     TblkLoadUniformForceLeft.Text        = $"{CommonItems.stringConstForceLeft} {CommonItems.stringConstUnitsUniform} {CommonItems.stringConstLoadForce}";
     TblkLoadUniformPositionRight.Text    = $"{CommonItems.stringConstPositionRight} {CommonItems.stringConstPositionReference} {CommonItems.stringConstUnitsLength}";
     TblkLoadUniformForceRight.Text       = $"{CommonItems.stringConstForceRight} {CommonItems.stringConstUnitsUniform} {CommonItems.stringConstLoadForce}";
     ButLoadUniformAdd.Content            = "Add above uniform load";
     ButLoadUniformReturn.Content         = $"{CommonItems.stringConstButtonReturn}";
     ButLoadUniformSimulatedLoads.Content = "Show simulated loads";
     ButLoadUniformClear.Content          = "Clear uniform loads";
     // Set XAML PlaceholderText values.
     TboxLoadUniformPositionLeft.PlaceholderText  = CommonItems.stringConstPositionLeft;
     TboxLoadUniformForceLeft.PlaceholderText     = CommonItems.stringConstForceLeft;
     TboxLoadUniformPositionRight.PlaceholderText = CommonItems.stringConstPositionRight;
     TboxLoadUniformForceRight.PlaceholderText    = CommonItems.stringConstForceRight;
     // Setup scrolling for this page.
     LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, horz: ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
 }
コード例 #17
0
        /*** Page Events *******************************************************************************************************/

        /// <summary>
        /// Set focus to ST_HButAboutToggles when page loads.
        /// </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, true);
            LibMPC.ButtonVisibility(mainPage.mainPageButSettings, false);
            ButAppReset.Foreground = LibMPC.colorError; List <ToggleSwitch> listToggleSwitchesThisPage = new List <ToggleSwitch>()
            {
                TogExitApp,
                TogDeleteSecure,
                TogVerbose
            };
            LibMPC.SizePageToggleSwitches(listToggleSwitchesThisPage);
            List <Button> listButtonsThisPage = new List <Button>()
            {
                ButAboutToggles,
                ButLockerReset,
                ButAppReset
            };

            LibMPC.SizePageButtons(listButtonsThisPage);
            CboxLanguage.MinWidth     = ButAboutToggles.ActualWidth; // Set CboxLanguage.MinWidth to value of other buttons on page.
            ButLockerReset.Foreground = LibMPC.colorError;
            LibMPC.OutputMsgSuccess(TblkPageTitle, mainPage.resourceLoader.GetString("ST_TblkPageTitle"));
            CboxLanguage.PlaceholderText = mainPage.resourceLoader.GetString("ST_CboxLanguage_PlaceholderText");
            // XAML margin setting is 16,2,16,2. Margin Setting Order: left, top, right, bottom.
            // Margin for ToggleSwitches needs to be adjusted for some cultures to keep them centered.
            // TODO: Will need to add new item here if a new translation is added!
            switch (mainPage.stringCultureCurrent)
            {
            case "en-US":
                TogExitApp.Margin      = new Thickness(29, 2, 2, 2);
                TogDeleteSecure.Margin = new Thickness(29, 2, 2, 2);
                TogVerbose.Margin      = new Thickness(29, 2, 2, 2);
                break;

            case "en":
                TogExitApp.Margin      = new Thickness(29, 2, 2, 2);
                TogDeleteSecure.Margin = new Thickness(29, 2, 2, 2);
                TogVerbose.Margin      = new Thickness(29, 2, 2, 2);
                break;

            case "es":
                TogExitApp.Margin      = new Thickness(17, 2, 2, 2);
                TogDeleteSecure.Margin = new Thickness(17, 2, 2, 2);
                TogVerbose.Margin      = new Thickness(17, 2, 2, 2);
                break;

            case "hi":
                TogExitApp.Margin      = new Thickness(17, 2, 2, 2);
                TogDeleteSecure.Margin = new Thickness(17, 2, 2, 2);
                TogVerbose.Margin      = new Thickness(17, 2, 2, 2);
                break;

            case "fr":
                TogExitApp.Margin      = new Thickness(17, 2, 2, 2);
                TogDeleteSecure.Margin = new Thickness(17, 2, 2, 2);
                TogVerbose.Margin      = new Thickness(17, 2, 2, 2);
                break;

            case "zh-Hans":
                TogExitApp.Margin      = new Thickness(44, 2, 2, 2);
                TogDeleteSecure.Margin = new Thickness(44, 2, 2, 2);
                TogVerbose.Margin      = new Thickness(44, 2, 2, 2);
                break;

            default:        // Throw exception so error can be discovered and corrected.
                throw new NotSupportedException($"Settings.Page_Loaded(): mainPage.stringCultureCurrent={mainPage.stringCultureCurrent} not found in switch statement.");
            }

            // TODO: Will need to add new item here if a new translation is added!
            CboxItem_LanguageDevice.Content = mainPage.resourceLoader.GetString("ST_CboxItem_LanguageDevice");
            CboxItem_LanguageEN.Content     = mainPage.resourceLoader.GetString("ST_CboxItem_LanguageEN");
            CboxItem_LanguageES.Content     = mainPage.resourceLoader.GetString("ST_CboxItem_LanguageES");
            CboxItem_LanguageHI.Content     = mainPage.resourceLoader.GetString("ST_CboxItem_LanguageHI");
            CboxItem_LanguageFR.Content     = mainPage.resourceLoader.GetString("ST_CboxItem_LanguageFR");
            CboxItem_LanguageZH.Content     = mainPage.resourceLoader.GetString("ST_CboxItem_LanguageZH");
            CboxLanguage.SelectedIndex      = DataStoreCultureIndex();                                        // Get saved index value from data store.

            LibMPC.OutputMsgNormal(TblkResult, mainPage.resourceLoader.GetString("ST_ModeToggleMsg"));        // Change application configuration using above toggles.  Click above button for more information about the toggles.
            LibMPC.OutputMsgBright(TblkLockerResetMsg, mainPage.GetLockerResetMsg());                         // Get Locker Reset message.
            LibMPC.OutputMsgBright(TblkAppResetMsg, $"{mainPage.resourceLoader.GetString("ST_TblkAppResetMsg")} {mainPage.resourceLoader.GetString("UMP_Reset_Msg")}");
            LibMPC.OutputMsgBright(TblkLanguageMsg, mainPage.resourceLoader.GetString("ST_TblkLanguageMsg")); // Select application language. Application will close if selection is changed. Selected language will load next application start.
            SetToggles();                                                                                     // Set this before next line so initial return message will be cleared by next line.  Don't want to see return message on page load.
            TblkResult.Text = string.Empty;
            // Setup scrolling for this page.
            LibMPC.ScrollViewerOn(mainPage.mainPageScrollViewer, ScrollMode.Disabled, vert: ScrollMode.Auto, horzVis: ScrollBarVisibility.Disabled, vertVis: ScrollBarVisibility.Auto, zoom: ZoomMode.Disabled);
            ButAboutToggles.Focus(FocusState.Programmatic);
        }