public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: Add any constructor code after InitializeComponent call // #region Settings StiSettings.Load(); StiFormSettings.Load(this); #endregion }
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(); } }