Ejemplo n.º 1
0
        private void UpdateProjectType()
        {
            string str = Options.GetProjectTypeString(CurrentProjectType);

            ContentType.Text = str;

            if (CurrentOptions.IsReady() == false)
            {
                Create.IsEnabled  = false;
                Preview.IsEnabled = false;
                Edit.IsEnabled    = false;
                Details.IsEnabled = false;
            }
            else
            {
                Create.IsEnabled  = true;
                Preview.IsEnabled = true;
                Edit.IsEnabled    = true;
                Details.IsEnabled = true;
            }

            if (CurrentProjectType == Type_Options.BlazorServer)
            {
                RenderModeOptions.SelectedValue = (int)RenderMode_Options.Default;
            }
            else
            {
                RenderModeOptions.SelectedValue = (int)RenderMode_Options.NoChange;
            }
        }
Ejemplo n.º 2
0
        private void HandleEdit()
        {
            if (CurrentOptions.IsReady() == false)
            {
                MessageBox.Show("Make sure all options are ready", MsgTitle);
            }
            else
            {
                UpdateOptionsData();
                string str = Html.Text;

                if (Support.IsHtmlAllowed(CurrentOptions, CurrentOptions.BootstrapProjectPath, str) == false)
                {
                    if (CurrentOptions.IsTraceOn(Trace_Options.TraceWarning) == true)
                    {
                        Trace.TraceWarning("Html is not allowed with editing Html Source");
                    }
                }
                else if (MessageBox.Show("Do you wish allow editing of Html source?", MsgTitle, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                {
                    IsBootstrapHtml = Support.IsBootstrapHtml;
                    CurrentOptions.AllowHtmlEditing = true;
                    Html.IsEnabled      = true;
                    IndexPage.IsEnabled = true;

                    if (MessageBox.Show("Do you wish to use Page as reference?", MsgTitle, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
                    {
                        str       = str.Replace("Test", CurrentOptions.PageName);
                        Html.Text = str;
                    }
                }
            }
        }
Ejemplo n.º 3
0
        // screen button support
        private void HandleCreate()
        {
            string str;

            if (CurrentOptions.IsReady() == false)
            {
                MessageBox.Show("Make sure all options are ready", MsgTitle);
            }
            else
            {
                if (CheckCSSIsolation() == true)
                {
                    DataInfo info = GenerateData(false, true);
                    CurrentProjectType = info.ProjectType;
                    switch (CurrentProjectType)
                    {
                    case Type_Options.BlazorServer:
                    case Type_Options.BlazorWebassembly:
                    case Type_Options.BlazorWebassemblyPWA:
                    case Type_Options.ASPNetRazor:
                        str = Options.GetProjectTypeString(CurrentProjectType);
                        MessageBox.Show(str + " Modifications created", MsgTitle);
                        break;

                    default:
                        MessageBox.Show("Unknown Project Type", MsgTitle);
                        break;
                    }
                }
            }
        }
Ejemplo n.º 4
0
        private void HandlePreview()
        {
            if (CurrentOptions.IsReady() == false)
            {
                MessageBox.Show("Make sure all options are ready", MsgTitle);
            }
            else
            {
                GenerateData(true, true);

                Shell.Start("notepad.exe", CurrentOptions.PreviewFile);
            }
        }
Ejemplo n.º 5
0
 private void HandleNew()
 {
     if (CurrentOptions.IsReady() == false)
     {
         MessageBox.Show("Make sure all options are ready", MsgTitle);
     }
     else
     {
         if (MessageBox.Show("Do you wish start new?", MsgTitle, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             ResetNew();
             UpdateScreen();
         }
     }
 }