コード例 #1
0
        static void Main()
        {
            AppDomain.CurrentDomain.AssemblyResolve += OnCurrentDomainAssemblyResolve;
            DataDirectoryHelper.LocalPrefix          = "WinOutlookInspiredApp";
            bool exit;

            using (IDisposable singleInstanceApplicationGuard = DataDirectoryHelper.SingleInstanceApplicationGuard("DevExpressWinOutlookInspiredApp", out exit)) {
                if (exit)
                {
                    return;
                }
                //DevExpress.UserSkins.BonusSkins.Register();
                DevExpress.XtraEditors.WindowsFormsSettings.SetDPIAware();
                DevExpress.XtraEditors.WindowsFormsSettings.EnableFormSkins();
                DevExpress.XtraEditors.WindowsFormsSettings.DefaultLookAndFeel.SetSkinStyle("Office 2013 Light Gray");
                DevExpress.XtraEditors.WindowsFormsSettings.AllowPixelScrolling = Utils.DefaultBoolean.True;
                DevExpress.XtraEditors.WindowsFormsSettings.ScrollUIMode        = XtraEditors.ScrollUIMode.Touch;
                DevExpress.Utils.AppearanceObject.DefaultFont = new Font("Segoe UI", AppHelper.GetDefaultSize());
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                DevExpress.Mvvm.CommandBase.DefaultUseCommandManager = false;
                using (new StartUpProcess()) {
                    using (StartUpProcess.Status.Subscribe(new DemoStartUp())) {
                        Application.Run(new MainForm());
                    }
                }
            }
        }
コード例 #2
0
        static void Main(string[] arguments)
        {
            ExceptionHelper.Default.Initialize();
            bool isRunning;

            using (DataDirectoryHelper.SingleInstanceApplicationGuard(Application.ProductName + " 1.5", out isRunning)) {
                // Return if the application is already running.
                if (isRunning)
                {
                    return;
                }

                // Enable visual styles for the application.
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                // Set a default skin that is used for every control on this current thread.
                SkinAppearanceHelper.SetDefaultAppearance();

                var Security = new ProgramSecurity(DataDirectoryHelper.GetProductKeys(), "Humosoft\\Security");
                if (!Security.Algorithm())
                {
                    return;
                }

                // Starts the application.
                Application.Run(MainForm = new MainForm(arguments)
                {
                    CancelWhenClosing = false
                });
            }
        }
コード例 #3
0
 public DbConnection CreateConnection(string nameOrConnectionString)
 {
     if (filePath == null)
     {
         filePath = DataDirectoryHelper.GetFile("expenses.sqlite3", DataDirectoryHelper.DataFolderName);
         File.SetAttributes(filePath, File.GetAttributes(filePath) & ~FileAttributes.ReadOnly);
     }
     return(new SQLiteConnection(new SQLiteConnectionStringBuilder {
         DataSource = filePath
     }.ConnectionString));
 }
コード例 #4
0
        protected override void OnStartup(StartupEventArgs e)
        {
            ExceptionHelper.Initialize();
#if !DXCORE3
            DataDirectoryHelper.SetWebBrowserMode();
#endif
            ApplicationThemeHelper.ApplicationThemeName = Theme.MetropolisDark.Name;
            LoadPlugins();
            base.OnStartup(e);
            Timeline.DesiredFrameRateProperty.OverrideMetadata(typeof(Timeline), new FrameworkPropertyMetadata(200));
            SetCultureInfo();
        }
コード例 #5
0
        static DbConnection CreateConnection()
        {
            if (filePath == null)
            {
                filePath = DataDirectoryHelper.GetFile("doctors.db", DataDirectoryHelper.DataFolderName);
            }
            File.SetAttributes(filePath, File.GetAttributes(filePath) & ~FileAttributes.ReadOnly);
            var connection = DbProviderFactories.GetFactory("System.Data.SQLite.EF6").CreateConnection();

            connection.ConnectionString = new SQLiteConnectionStringBuilder {
                DataSource = filePath
            }.ConnectionString;
            return(connection);
        }
コード例 #6
0
 static void SetFilePath()
 {
     if (filePath == null)
     {
         filePath = DataDirectoryHelper.GetFile("devav.sqlite3", DataDirectoryHelper.DataFolderName);
     }
     try {
         var attributes = File.GetAttributes(filePath);
         if (attributes.HasFlag(FileAttributes.ReadOnly))
         {
             File.SetAttributes(filePath, attributes & ~FileAttributes.ReadOnly);
         }
     } catch { }
 }
コード例 #7
0
ファイル: Program.cs プロジェクト: Arsslensoft/FleshHRMS
        private static void Main()
        {
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.AssemblyResolve    += OnCurrentDomainAssemblyResolve;
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            DataDirectoryHelper.LocalPrefix             = "WinHybridApp";
            bool exit;

            using (
                var singleInstanceApplicationGuard =
                    DataDirectoryHelper.SingleInstanceApplicationGuard("DevExpressWinHybridApp", out exit))
            {
                if (exit && IsTablet)
                {
                    return;
                }
                CommandBase.DefaultUseCommandManager = false;
                WindowsFormsSettings.SetDPIAware();
                SkinManager.EnableFormSkins();
                BonusSkins.Register();
                ((UserLookAndFeelDefault)UserLookAndFeel.Default).LoadSettings(() =>
                {
                    var skinCreator = new SkinBlobXmlCreator("HybridApp",
                                                             "PHRMS.SkinData.", typeof(Program).Assembly, null);
                    SkinManager.Default.RegisterSkin(skinCreator);
                });
                AsyncAdornerBootStrapper.RegisterLookAndFeel(
                    "MetroBlack", "DevExpress.RealtorWorld.Win.SkinData.", typeof(Program).Assembly);
                UserLookAndFeel.Default.SetSkinStyle("HybridApp");
                Application.CurrentCulture = CultureInfo.GetCultureInfo("en-us");

                WindowsFormsSettings.AllowPixelScrolling = DefaultBoolean.True;
                WindowsFormsSettings.ScrollUIMode        = ScrollUIMode.Touch;
                float touchScaleFactor, fontSize;
                DeviceDetector.SuggestHybridDemoParameters(out touchScaleFactor, out fontSize);
                WindowsFormsSettings.DefaultFont      = new Font("Segoe UI", fontSize);
                WindowsFormsSettings.DefaultMenuFont  = new Font("Segoe UI", fontSize);
                WindowsFormsSettings.TouchScaleFactor = touchScaleFactor;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                MainForm = new MainForm();
                Application.Run(MainForm);
            }
        }
コード例 #8
0
        static DbConnection CreateConnection()
        {
            if (filePath == null)
            {
                filePath = DataDirectoryHelper.GetFile("cars.db", DataDirectoryHelper.DataFolderName);
            }
            try {
                var attributes = File.GetAttributes(filePath);
                if (attributes.HasFlag(FileAttributes.ReadOnly))
                {
                    File.SetAttributes(filePath, attributes & ~FileAttributes.ReadOnly);
                }
            } catch { }
            var connection = DbProviderFactories.GetFactory("System.Data.SQLite.EF6").CreateConnection();

            connection.ConnectionString = new SQLiteConnectionStringBuilder {
                DataSource = filePath
            }.ConnectionString;
            return(connection);
        }
コード例 #9
0
        void InitBot()
        {
            VirtualAssistant.Logger.Info("Initializing bot...");
            SplashScreenHelper.SetSplashScreenStatus("Initializing bot...");
            VirtualAssistant.Plugins.Add(new SimlPlugin(DataDirectoryHelper.GetRelativeDirectoryPath("Data\\Resources\\SimlProject")));
            VirtualAssistant.Plugins.Add(new DSearchPlugin());
            VirtualAssistant.Plugins.Add(new WordNetPlugin(DataDirectoryHelper.GetRelativeDirectoryPath("Data\\Resources\\WordNet")));
            VirtualAssistant.Plugins.Add(new WikipediaPlugin());
            VirtualAssistant.Plugins.Add(new KJBiblePlugin());
            VirtualAssistant.Speech.Synthesizers.Add(new InBuiltSpeechSynthesizer());
            VirtualAssistant.Speech.Recognizers.Add(new InBuiltSpeechRecognizer(searchControl));
            VirtualAssistant.Speech.Synthesizers.Select("InBuilt");
            VirtualAssistant.Interaction.ResponseReceived += OnResponseReceived;
            VirtualAssistant.Interaction.MessageReceived  += OnMessageReceived;

            // Update user name
            VirtualAssistant.Plugins.GetPluginByType <SimlPlugin>().Bot.MainUser.Settings["Name"].Value    = CurrentProfile.FirstName;
            VirtualAssistant.Plugins.GetPluginByType <SimlPlugin>().Bot.MainUser.Settings["Name"].Changed += (s, e) =>
            {
                CurrentProfile.FirstName = VirtualAssistant.Plugins.GetPluginByType <SimlPlugin>().Bot.MainUser.Settings["Name"].Value;
            };
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: McHarny/WotCompanion
        static void Main()
        {
            TaskbarAssistant.Default.Initialize();

            using (DataDirectoryHelper.SingleInstanceApplicationGuard(ProjectInfo.MutexName, out bool exit))
            {
                if (exit)
                {
                    return;
                }
                foreach (var arg in Environment.GetCommandLineArgs())
                {
                    if (arg.Equals(ForceDirectXPainter, StringComparison.OrdinalIgnoreCase))
                    {
                        DevExpress.XtraEditors.WindowsFormsSettings.ForceDirectXPaint();
                    }
                }
                DevExpress.XtraEditors.WindowsFormsSettings.SetDPIAware();
                DevExpress.XtraEditors.WindowsFormsSettings.EnableFormSkins();
                DevExpress.XtraEditors.WindowsFormsSettings.DefaultLookAndFeel.SetSkinStyle("Office 2016 Colorful");
                DevExpress.XtraEditors.WindowsFormsSettings.AllowPixelScrolling = DevExpress.Utils.DefaultBoolean.True;
                DevExpress.Utils.AppearanceObject.DefaultFont            = new Font(ApplicationHelper.DefaultFontName, ApplicationHelper.DefaultFontSize);
                DevExpress.XtraEditors.WindowsFormsSettings.ScrollUIMode = DevExpress.XtraEditors.ScrollUIMode.Touch;
                DevExpress.XtraEditors.WindowsFormsSettings.CustomizationFormSnapMode = DevExpress.Utils.Controls.SnapMode.OwnerControl;
                DevExpress.XtraEditors.WindowsFormsSettings.ColumnFilterPopupMode     = DevExpress.XtraEditors.ColumnFilterPopupMode.Excel;
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                using (new StartUpProcess())
                {
                    using (StartUpProcess.Status.Subscribe(new SplashScreenStartup()))
                    {
                        Application.Run(new MainForm());
                    }
                }
            }
        }
コード例 #11
0
ファイル: Program.cs プロジェクト: pearorgn/test
        static void Main()
        {
            DataDirectoryHelper.SetWebBrowserMode();
            DevExpress.XtraEditors.WindowsFormsSettings.ApplyDemoSettings();
            SkinManager.EnableFormSkins();
            UserSkins.BonusSkins.Register();
            AppearanceObject.DefaultFont = new Font("Segoe UI", 8.25f);
            SkinBlobXmlCreator skinCreator = new SkinBlobXmlCreator("MetroBlack",
                                                                    "DevExpress.RealtorWorld.Win.SkinData.", typeof(Program).Assembly, null);

            SkinManager.Default.RegisterSkin(skinCreator);
            AsyncAdornerBootStrapper.RegisterLookAndFeel(
                "MetroBlack", "DevExpress.RealtorWorld.Win.SkinData.", typeof(Program).Assembly);
            LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Metropolis");
            CultureInfo demoCI = (CultureInfo)Application.CurrentCulture.Clone();

            demoCI.NumberFormat.CurrencySymbol = "$";
            SplashScreenManager.RegisterUserSkin(skinCreator);
            Application.CurrentCulture = demoCI;
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            DataHelper.CreateWmiService();
            Application.Run(new frmMain());
        }
コード例 #12
0
        Stream CreateImageStream(EmotionState state)
        {
            string name = string.Format("MOCHI_{0}.gif", state.ToString().ToUpper());

            return(new FileStream(DataDirectoryHelper.GetRelativePath("Data\\Images\\Emotions\\" + name), FileMode.Open, FileAccess.Read));
        }
コード例 #13
0
        private void OpenLogDirectory()
        {
            var path = DataDirectoryHelper.GetLogDirectoryPath();

            System.Diagnostics.Process.Start(path);
        }
コード例 #14
0
 public static void Config()
 {
     DataDirectoryHelper.InitializeDataDirectory();
     AppDomain.CurrentDomain.SetData("DataDirectory", DataDirectoryHelper.GetDataDirectoryPath());
 }
コード例 #15
0
        public static void OpenGetStartedWindow()
        {
            string filename = DataDirectoryHelper.GetRelativePath("Data\\License\\Getting Started.pdf");

            ProcessHelper.Start(filename, string.Empty);
        }
コード例 #16
0
 public static string GetDataFilePath(string relativePath)
 {
     return(DataDirectoryHelper.GetFile(relativePath, DataDirectoryHelper.DataFolderName));
 }