private void InitializeApplication(UIControlledApplication application)
        {
            ApplicationGlobals.UiControlledApplication = application;
            WindowsApplication.Application.EnableVisualStyles();
            var applicationContext = new ApplicationContext("UOL Revit Sample Addin", "1.0.0.0", "UOLSample");

            ApplicationGlobals.ApplicationContext = applicationContext;

            // Add all services to the ApplicationContext that this Revit Add-in requires.
            applicationContext.AddUOLRevitAddIn();

            var monitoredExecutionContext = ApplicationGlobals.ApplicationContext.GetService <IMonitoredExecutionContext>();
            var windowTools = new WindowTools(monitoredExecutionContext);

            ApplicationGlobals.HostWindow = windowTools.GetWindowHandle("Revit");

            registryManager = ApplicationGlobals.ApplicationContext.GetService <IRegistryManager>();
            var registryHelper = new RegistryHelper();

            Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(registryHelper.GetLanguage());
        }