示例#1
0
        private static void Main()
        {
            try
            {
                BindingRedirectsHelper.Initialize();

                LogCentral.Current.ConfigureLogging();

                // --
                // Register extension.

                try
                {
                    var info =
                        new FileExtensionRegistration.RegistrationInformation
                    {
                        ApplicationFilePath = typeof(Host).Assembly.Location,
                        Extension           = Project.ProjectFileExtension,
                        ClassName           = @"ZetaResourceEditorDocument",
                        Description         = Resources.SR_Host_Main_ZetaResourceEditorProjectFile
                    };

                    FileExtensionRegistration.Register(info);
                }
                catch (Exception x)
                {
                    // May fail if no permissions, silently eat.
                    LogCentral.Current.LogError(x);
                }

                // --

                var persistentStorage =
                    new PersistentXmlFilePairStorage
                {
                    FilePath =
                        ZlpPathHelper.Combine(
                            CurrentUserStorageBaseFolderPath.FullName,
                            @"zeta-resource-editor-settings.xml")
                };
                persistentStorage.Error += storageError;

                PersistanceHelper.Storage = persistentStorage;

                // --

                // http://community.devexpress.com/forums/t/80133.aspx

                SkinHelper.InitializeAll();

                // --

                AppDomain.CurrentDomain.UnhandledException += currentDomainUnhandledException;
                Application.ThreadException += applicationThreadException;

                // --
                // http://stackoverflow.com/a/9180843/107625

                var dir = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location ?? string.Empty);
                foreach (var assemblyName in Directory.GetFiles(dir, @"*.dll"))
                {
                    try
                    {
                        var assembly = Assembly.LoadFile(assemblyName);
                        _additional.Add(assembly.GetName().Name, assembly);
                    }
                    catch (BadImageFormatException)
                    {
                        // Ignorieren.
                    }
                }

                AppDomain.CurrentDomain.ReflectionOnlyAssemblyResolve += CurrentDomain_ResolveAssembly;
                AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_ResolveAssembly;

                // --

                test();

                initializeLanguage();

                Application.Run(new MainForm());
            }
            catch (Exception x)
            {
                doHandleException(x);
            }
        }
示例#2
0
        private static void Main()
        {
            try
            {
                //Zeta.VoyagerLibrary.Common.Configuration.
                //    LibraryConfiguration.Current.Initialize();
                //Zeta.VoyagerLibrary.WinForms.Configuration.
                //    LibraryConfiguration.Current.Initialize();

                LogCentral.Current.ConfigureLogging();

                // --
                // Register extension.

                try
                {
                    var info =
                        new FileExtensionRegistration.RegistrationInformation
                    {
                        ApplicationFilePath = typeof(Host).Assembly.Location,
                        Extension           = Project.ProjectFileExtension,
                        ClassName           = @"ZetaResourceEditorDocument",
                        Description         = Resources.SR_Host_Main_ZetaResourceEditorProjectFile
                    };

                    FileExtensionRegistration.Register(info);
                }
                catch (Exception x)
                {
                    // May fail if no permissions, silently eat.
                    LogCentral.Current.LogError(x);
                }

                // --

                var persistentStorage =
                    new PersistentXmlFilePairStorage
                {
                    FilePath =
                        ZlpPathHelper.Combine(
                            CurrentUserStorageBaseFolderPath.FullName,
                            @"zeta-resource-editor-settings.xml")
                };
                persistentStorage.Error += storageError;

                PersistanceHelper.Storage = persistentStorage;

                // --

                // http://community.devexpress.com/forums/t/80133.aspx

                // http://www.devexpress.com/Support/Center/p/B155647.aspx
                //DevExpress.UserSkins.OfficeSkins.Register();
                //DevExpress.LookAndFeel.UserLookAndFeel.Default.SkinName = @"Office 2010 Silver";

                SkinHelper.InitializeAll();

                // --

                // Manually turn off.
                //Zeta.VoyagerLibrary.WinForms.Configuration.
                //    LibraryConfiguration.Current.IsDesignMode = false;

                AppDomain.CurrentDomain.UnhandledException +=
                    currentDomainUnhandledException;
                Application.ThreadException +=
                    applicationThreadException;

                test();

                initializeLanguage();

                Application.Run(new MainForm());
            }
            catch (Exception x)
            {
                doHandleException(x);
            }
        }
示例#3
0
        private static void Main()
        {
            try
            {
                LogCentral.Current.ConfigureLogging();

                // --
                // Register extension.

                try
                {
                    var info =
                        new FileExtensionRegistration.RegistrationInformation
                    {
                        ApplicationFilePath = typeof(Host).Assembly.Location,
                        Extension           = Project.ProjectFileExtension,
                        ClassName           = @"ZetaResourceEditorDocument",
                        Description         = Resources.SR_Host_Main_ZetaResourceEditorProjectFile
                    };

                    FileExtensionRegistration.Register(info);
                }
                catch (Exception x)
                {
                    // May fail if no permissions, silently eat.
                    LogCentral.Current.LogError(x);
                }

                // --

                var persistentStorage =
                    new PersistentXmlFilePairStorage
                {
                    FilePath =
                        ZlpPathHelper.Combine(
                            CurrentUserStorageBaseFolderPath.FullName,
                            @"zeta-resource-editor-settings.xml")
                };
                persistentStorage.Error += storageError;

                PersistanceHelper.Storage = persistentStorage;

                // --

                // http://community.devexpress.com/forums/t/80133.aspx

                SkinHelper.InitializeAll();

                // --

                AppDomain.CurrentDomain.UnhandledException += currentDomainUnhandledException;
                Application.ThreadException += applicationThreadException;

                test();

                initializeLanguage();

                Application.Run(new MainForm());
            }
            catch (Exception x)
            {
                doHandleException(x);
            }
        }