Пример #1
0
 static ChartingProviderSciChart_v1_7_2()
 {
     SciChartSurface.SetLicenseKey(@"<LicenseContract>
                                       <Customer>ABT</Customer>
                                       <OrderId>Test</OrderId>
                                       <LicenseCount>1</LicenseCount>
                                       <IsTrialLicense>false</IsTrialLicense>
                                       <SupportExpires>09/07/2013 00:00:00</SupportExpires>
                                       <KeyCode>lwAAAAEAAACd79h9vqvOATkAQ3VzdG9tZXI9QUJUO09yZGVySWQ9VGVzdDtTdWJzY3JpcHRpb25WYWxpZFRvPTA3LVNlcC0yMDEzY4hf1A2pl6mzuJHCr296894GLSQVToXjaeEKo70ufpYOMj/1gZYU/wvNytpDJd7m</KeyCode>
                                     </LicenseContract>");
 }
Пример #2
0
        protected override void OnStartup(StartupEventArgs sea)
        {
            const string FILENAME = "SciChartLicense.xml";

            try
            {
                ShutdownMode = ShutdownMode.OnLastWindowClose;

                string key;

                using (var reader = new StreamReader(FILENAME))
                    key = reader.ReadToEnd();

                SciChartSurface.SetLicenseKey(key);
            }
            catch (Exception error)
            {
                var message = $"The license file couldn't be loaded (Error: {error.Message}).";

                MessageBox.Show(message, "Missing License File",
                                MessageBoxButton.OK, MessageBoxImage.Warning);

                Shutdown();
            }

            DispatcherUnhandledException += (s, e) =>
            {
                MessageBox.Show(e.Exception.Message, "Unhandled Error",
                                MessageBoxButton.OK, MessageBoxImage.Error);

                e.Handled = true;

                Shutdown();
            };

            var window = new MainWindow();

            window.Show();
        }