Пример #1
0
        protected async override void OnLaunched(LaunchActivatedEventArgs args)
        {
            // Отключаем интеграцию в SettingsPane контролами
            StiSettingsInternalHelper.IntegrateToTheSettingsPane = false;
            // Сами инициализируем интеграцию в SettingsPane
            StiSettingsPaneHelper.Initialize();

            if (StiSettings.GetBool("NavigatorWinRT", "IsFirstLaunch", true))
            {
                StiSettings.Set("NavigatorWinRT", "IsFirstLaunch", false);

                var key = System.Globalization.CultureInfo.CurrentCulture.Name;

                #region Cultures
                if (key.StartsWith("de"))
                {
                    key = "de";
                }
                else if (key.StartsWith("ru"))
                {
                    key = "ru";
                }
                else if (key == "zh-Hans")
                {
                    key = "zh-CHS";
                }
                else if (key == "zh-Hant")
                {
                    key = "zh-CHT";
                }
                else
                {
                    key = "en";
                }
                #endregion

                StiSettings.Set("Localization", "Current", key);
            }

            StiThemesHelper.LoadTheme();
            await StiLocalizationHelper.LoadDefaulLocalizationAsync();

            Window.Current.Content = new StiSplashControl(args.Arguments, null);
            Window.Current.Activate();
        }
Пример #2
0
        public StiDemoForm()
        {
            InitializeComponent();

            #region Read Data
            if (File.Exists(applicationPath + "Data\\Demo.xsd"))
            {
                dataSet1.ReadXmlSchema(applicationPath + "Data\\Demo.xsd");
            }
            else
            {
                MessageBox.Show("File \"Demo.xsd\" not found");
            }

            if (File.Exists(applicationPath + "Data\\Demo.xml"))
            {
                dataSet1.ReadXml(applicationPath + "Data\\Demo.xml");
            }
            else
            {
                MessageBox.Show("File \"Demo.xml\" not found");
            }

            dataSet1.DataSetName = "Demo";
            #endregion

            ReadReportsInfo();
            tvReports.SelectedNode = tvReports.Nodes[0];

#if Debug
            btTest.Visible = true;
#endif

            #region Create Welcome Screen
            this.welcomeScreen          = new StiWelcomeScreenControl();
            this.welcomeScreen.Location = new Point(50, 50);
            this.welcomeScreen.Size     = new Size(900, 550);
            this.welcomeScreen.Visible  = false;
            this.Controls.Add(this.welcomeScreen);

            StiSettings.Load();
            bool displayWelcomeScreenAgain = StiSettings.GetBool(this.Name, "DisplayWelcomeScreenAgain", true);
            this.welcomeScreen.checkBoxDisplayWelcomeScreenAgain.Checked         = displayWelcomeScreenAgain;
            this.welcomeScreen.checkBoxDisplayWelcomeScreenAgain.CheckedChanged += new EventHandler(checkBoxDisplayWelcomeScreenAgain_CheckedChanged);

            this.welcomeScreen.buttonDemo.Click += new EventHandler(buttonDemo_Click);

            this.welcomeScreen.welcome            = (string)demoLocalization["Welcome"];
            this.welcomeScreen.welcomeDescription = (string)demoLocalization["WelcomeDesc"];

            this.welcomeScreen.SetDemoButtonText(this.welcomeScreen.buttonDemo, (string)demoLocalization["DescDemo"]);
            this.welcomeScreen.SetDemoButtonText(this.welcomeScreen.buttonSupport, (string)demoLocalization["DescSupport"]);
            this.welcomeScreen.SetDemoButtonText(this.welcomeScreen.buttonVideo, (string)demoLocalization["DescVideo"]);
            this.welcomeScreen.SetDemoButtonText(this.welcomeScreen.buttonDocumentation, (string)demoLocalization["DescDocumentation"]);
            this.welcomeScreen.SetDemoButtonText(this.welcomeScreen.buttonForum, (string)demoLocalization["DescForum"]);
            this.welcomeScreen.SetDemoButtonText(this.welcomeScreen.buttonSampleProject, (string)demoLocalization["DescSampleProject"]);

            this.welcomeScreen.checkBoxDisplayWelcomeScreenAgain.Text = (string)demoLocalization["DisplayWelcomeScreenAgain"];
            #endregion

            #region Viewer
            this.viewerControl.IgnoreApplyStyle       = true;
            this.viewerControl.View.BorderStyle       = BorderStyle.None;
            this.viewerControl.ToolBar.RoundCorners   = true;
            this.viewerControl.StatusBar.RoundCorners = true;
            this.viewerControl.FindBar.RoundCorners   = true;
            viewerControl.Close += new EventHandler(viewerControl_Close);
            this.viewerControl.GlobalGuiStyleChanged += delegate
            {
                ApplyStyle();
            };
            ApplyStyle();

            CreateHelpResourcesMenu();
            #endregion

            #region Get Position
            Point position = Point.Empty;
            Size  size     = new Size(960, 588);
            Stimulsoft.Report.Helpers.StiFormHelper.LoadStateForm(this, "DemoWindow", ref position, ref size);
            this.StartPosition = FormStartPosition.Manual;
            base.SetBoundsCore(position.X, position.Y, size.Width, size.Height, BoundsSpecified.All);
            #endregion

            if (displayWelcomeScreenAgain)
            {
                ShowStartPage();
            }
            else
            {
                ShowViewerControl();
            }
        }