Пример #1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // Apply license for redistribution here
            NLicenseManager.Instance.SetLicense(new NLicense("99040c6f01a38c43bcc8a01902004100027d84097206d449"));

            // Install Nevron Open Vision for Windows Forms
            NNovApplicationInstaller.Install();

            Core.Bot.I.Run();                               // Run the bot instance

            if (Properties.Settings.Default.HasBeenSetuped) // If the bot as already been configured
            {
                new MainForm().Show();                      // Start the bots
            }
            else
            {
                new SetupForm().Show();     // else show the Setup form
            }
            Core.TwitchAPI.I.Run();         // Run the Twitch API fetcher
            new Thread(CloseCheck).Start(); // Start the CloseCheck thread

            Application.Run();              // Run the application
        }
Пример #2
0
        static void Main()
        {
            try
            {
                // install Nevron Open Vision for WPF
                NNovApplicationInstaller.Install(
                    NTextModule.Instance,
                    NChartModule.Instance,
                    NDiagramModule.Instance,
                    NScheduleModule.Instance,
                    NGridModule.Instance,
                    NBarcodeModule.Instance);

                // show the main window
                Window window = new Window();
                window.Title       = "Nevron Open Vision Examples for WPF";
                window.WindowState = WindowState.Maximized;

                // load icon from stream
                using (Stream stream = typeof(Program).Assembly.GetManifestResourceStream("Nevron.Nov.Examples.Wpf.Resources.NevronOpenVision.ico"))
                {
                    // Decode the icon from the stream and set the first frame to the BitmapSource
                    BitmapDecoder decoder = IconBitmapDecoder.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.None);
                    BitmapSource  source  = decoder.Frames[1];

                    // set image source
                    window.Icon = source;
                }

                // place a NOV UI Element that contains an NExampleContent widget
                window.Content = new NNovWidgetHost <NExamplesContent>();

                // show the window
                Application app = new Application();
                app.Run(window);
            }
            catch (Exception ex)
            {
                NTrace.WriteException("Exception in Main", ex);
            }
        }
Пример #3
0
        static void Main(string[] args)
        {
            NSApplication.Init();

            // The following code tries to read the LicenseKey.txt file used to provide an
            // evaluation license key to the examples. Please consult with the documentation on more information
            // how to apply an evaluation / retail license.
            string licenseKeyPath = Path.Combine(NSBundle.MainBundle.BundlePath, "../../LicenseKey.txt");

            if (File.Exists(licenseKeyPath))
            {
                string[] licenseLines = File.ReadAllLines(licenseKeyPath);

                if (licenseLines.Length > 0)
                {
                    NLicenseManager.Instance.SetLicense(new NLicense(licenseLines[0].Trim()));
                }
            }

            // install the NOV Mac integration services
            NNovApplicationInstaller.Install(NTextModule.Instance, NGridModule.Instance, NChartModule.Instance, NDiagramModule.Instance, NScheduleModule.Instance);

            NSApplication.Main(args);
        }
Пример #4
0
        static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                // install Nevron Open Vision for Windows Forms
                NNovApplicationInstaller.Install(
                    NTextModule.Instance,
                    NChartModule.Instance,
                    NDiagramModule.Instance,
                    NScheduleModule.Instance,
                    NGridModule.Instance,
                    NBarcodeModule.Instance);

                // show the main form
                bool startWithNovWindow = false;
                if (startWithNovWindow)
                {
                    // create a NOV top level window
                    NTopLevelWindow window = NApplication.CreateTopLevelWindow();
                    window.BackgroundFill = new NColorFill(NColor.White);
                    window.Content        = new NExamplesContent();
                    window.Closed        += OnWindowClosed;
                    window.Title          = "Nevron Open Vision Examples for Windows Forms";
                    window.AllowXResize   = true;
                    window.AllowYResize   = true;
                    window.ShowInTaskbar  = true;
                    window.Modal          = true;
                    window.PreferredSize  = new NSize(500, 500);
                    window.StartPosition  = ENWindowStartPosition.CenterScreen;
                    window.Open();

                    // run the application
                    ApplicationContext context = new ApplicationContext();
                    Application.Run(context);
                }
                else
                {
                    // create a WinForms form
                    Form form = new Form();

                    // set form icon
                    using (Stream stream = typeof(Program).Assembly.GetManifestResourceStream("Nevron.Nov.Examples.WinForm.Resources.NevronOpenVision.ico"))
                    {
                        Icon icon = new Icon(stream);
                        form.Icon = icon;
                    }

                    // set form title and state
                    form.Text        = "Nevron Open Vision Examples for Windows Forms";
                    form.WindowState = FormWindowState.Maximized;

                    // place a NOV WinForms Control that contains an NExampleContent widget
                    NNovWidgetHost <NExamplesContent> host = new NNovWidgetHost <NExamplesContent>();
                    host.Dock = DockStyle.Fill;
                    form.Controls.Add(host);

                    // run the form
                    Application.Run(form);
                }
            }
            catch (Exception ex)
            {
                NTrace.WriteException("Exception in Main", ex);
            }
        }