Пример #1
0
        private void OnStaticSiteInitialCompleted(Object stepControl)
        {
            var panel = (stepControl as WeblogConfigurationWizardPanelStaticSiteInitial);

            // Fill blog settings
            _temporarySettings.SetProvider(
                StaticSiteClient.PROVIDER_ID,
                StaticSiteClient.SERVICE_NAME,
                StaticSiteClient.POST_API_URL,
                StaticSiteClient.CLIENT_TYPE
                );

            // Save config
            panel.SaveToConfig(staticSiteConfig);

            if (!staticSiteConfig.Initialised)
            {
                // Set initialised flag so detection isn't undertaken again
                staticSiteConfig.Initialised = true;
                // Attempt parameter detection
                var detectionResult = StaticSiteConfigDetector.AttmeptAutoDetect(staticSiteConfig);
                if (detectionResult)
                {
                    // Successful detection of parameters
                    MessageBox.Show(
                        string.Format(Res.Get(StringId.CWStaticSiteConfigDetection), Res.Get(StringId.ProductNameVersioned)),
                        Res.Get(StringId.ProductNameVersioned),
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Information);
                }
            }

            // Go to next step
            AddStaticSiteFeaturesSubStep();
        }
Пример #2
0
        public void GeneralPanel_RunAutoDetect()
        {
            var result = StaticSiteConfigDetector.AttmeptAutoDetect(Config);

            if (result)
            {
                // Successful detection of parameters
                MessageBox.Show(
                    string.Format(Res.Get(StringId.CWStaticSiteConfigDetection), Res.Get(StringId.ProductNameVersioned)),
                    Res.Get(StringId.ProductNameVersioned),
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);

                LoadConfigIntoPanels();
            }
        }