Ejemplo n.º 1
0
        public LogViewerViewModel(ITypeFactory typeFactory, IDispatcherService dispatcherService,
                                  IApplicationLogFilterGroupService applicationLogFilterGroupService, LogViewerLogListener logViewerLogListener)
        {
            Argument.IsNotNull(() => typeFactory);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => applicationLogFilterGroupService);
            Argument.IsNotNull(() => logViewerLogListener);

            _typeFactory       = typeFactory;
            _dispatcherService = dispatcherService;
            _applicationLogFilterGroupService = applicationLogFilterGroupService;
            _logViewerLogListener             = logViewerLogListener;

            _timer = new Timer(OnTimerTick);

            LogListenerType = typeof(LogViewerLogListener);
            ShowDebug       = true;
            ShowInfo        = true;
            ShowWarning     = true;
            ShowError       = true;

            var typeNames = new FastObservableCollection <string>
            {
                _defaultComboBoxItem
            };

            TypeNames = typeNames;

            ResetEntriesCount();
        }
Ejemplo n.º 2
0
    /// <summary>
    /// Initializes the module.
    /// </summary>
    public static void Initialize()
    {
        var serviceLocator = ServiceLocator.Default;

        var logListener = (from x in LogManager.GetListeners()
                           where x is LogViewerLogListener
                           select (LogViewerLogListener)x).FirstOrDefault();
        if (logListener == null)
        {
            logListener = new LogViewerLogListener
            {
                IgnoreCatelLogging = true,
                IsDebugEnabled = true,
                IsInfoEnabled = true,
                IsWarningEnabled = true,
                IsErrorEnabled = true
            };

            LogManager.AddListener(logListener);
        }

        serviceLocator.RegisterInstance<LogViewerLogListener>(logListener);

        serviceLocator.RegisterType<ISuggestionListService, SuggestionListService>();

        // Override Catel.SelectDirectoryService with Orchestra.Services.SelectDirectoryService
        serviceLocator.RegisterType<ISelectDirectoryService, MicrosoftApiSelectDirectoryService>();

        var viewModelLocator = serviceLocator.ResolveType<IViewModelLocator>();
        viewModelLocator.Register(typeof(DateTimePickerControl), typeof(DateTimePickerViewModel));
        viewModelLocator.Register(typeof(TimeSpanControl), typeof(TimeSpanViewModel));

        var languageService = serviceLocator.ResolveType<ILanguageService>();
        languageService.RegisterLanguageSource(new LanguageResourceSource("Orc.Controls", "Orc.Controls.Properties", "Resources"));
    }
Ejemplo n.º 3
0
        public LogViewerViewModel(ITypeFactory typeFactory, IDispatcherService dispatcherService, LogViewerLogListener logViewerLogListener)
        {
            Argument.IsNotNull(() => typeFactory);
            Argument.IsNotNull(() => dispatcherService);
            Argument.IsNotNull(() => logViewerLogListener);

            _typeFactory = typeFactory;
            _dispatcherService = dispatcherService;
            _logViewerLogListener = logViewerLogListener;

            LogListenerType = typeof(LogViewerLogListener);
            ShowDebug = true;
            ShowInfo = true;
            ShowWarning = true;
            ShowError = true;

            var typeNames = new FastObservableCollection<string>
            {
                defaultComboBoxItem
            };

            TypeNames = typeNames;

            ResetEntriesCount();
        }
Ejemplo n.º 4
0
    /// <summary>
    /// Initializes the module.
    /// </summary>
    public static void Initialize()
    {
        var serviceLocator = ServiceLocator.Default;

        var logListener = (from x in LogManager.GetListeners()
                           where x is LogViewerLogListener
                           select(LogViewerLogListener) x).FirstOrDefault();

        if (logListener == null)
        {
            logListener = new LogViewerLogListener
            {
                IgnoreCatelLogging = true,
                IsDebugEnabled     = true,
                IsInfoEnabled      = true,
                IsWarningEnabled   = true,
                IsErrorEnabled     = true
            };

            LogManager.AddListener(logListener);
        }

        serviceLocator.RegisterInstance <LogViewerLogListener>(logListener);

        serviceLocator.RegisterType <IAccentColorService, AccentColorService>();
        serviceLocator.RegisterType <IApplicationLogFilterGroupService, ApplicationLogFilterGroupService>();

        serviceLocator.RegisterType <ISuggestionListService, SuggestionListService>();
        serviceLocator.RegisterType <IValidationNamesService, ValidationNamesService>();
        serviceLocator.RegisterTypeIfNotYetRegistered <IConnectionStringBuilderServiceInitializer, ConnectionStringBuilderServiceInitializer>();
        serviceLocator.RegisterType <IConnectionStringBuilderService, ConnectionStringBuilderService>();
        serviceLocator.RegisterTypeIfNotYetRegistered <IControlToolManagerFactory, ControlToolManagerFactory>();

        // Override Catel.SelectDirectoryService with Orchestra.Services.SelectDirectoryService
        serviceLocator.RegisterType <ISelectDirectoryService, MicrosoftApiSelectDirectoryService>();

        serviceLocator.RegisterType <ITimeAdjustmentProvider, TimeAdjustmentProvider>();

        var viewModelLocator = serviceLocator.ResolveType <IViewModelLocator>();

        viewModelLocator.Register(typeof(CulturePicker), typeof(CulturePickerViewModel));
        viewModelLocator.Register(typeof(ValidationContextTree), typeof(ValidationContextTreeViewModel));
        viewModelLocator.Register(typeof(ValidationContextView), typeof(ValidationContextViewModel));
        viewModelLocator.Register(typeof(ConnectionStringBuilder), typeof(ConnectionStringBuilderViewModel));
        viewModelLocator.Register(typeof(ConnectionStringEditWindow), typeof(ConnectionStringEditViewModel));
        viewModelLocator.Register(typeof(ConnectionStringAdvancedOptionsWindow), typeof(ConnectionStringAdvancedOptionsViewModel));
        viewModelLocator.Register(typeof(DbConnectionProviderListWindow), typeof(DbConnectionProviderListViewModel));

        var languageService = serviceLocator.ResolveType <ILanguageService>();

        languageService.RegisterLanguageSource(new LanguageResourceSource("Orc.Controls", "Orc.Controls.Properties", "Resources"));
    }
Ejemplo n.º 5
0
    /// <summary>
    /// Initializes the module.
    /// </summary>
    public static void Initialize()
    {
        var serviceLocator = ServiceLocator.Default;

        var logListener = (from x in LogManager.GetListeners()
                           where x is LogViewerLogListener
                           select(LogViewerLogListener) x).FirstOrDefault();

        if (logListener is null)
        {
            logListener = new LogViewerLogListener
            {
                IgnoreCatelLogging = true,
                IsDebugEnabled     = true,
                IsInfoEnabled      = true,
                IsWarningEnabled   = true,
                IsErrorEnabled     = true
            };

            LogManager.AddListener(logListener);
        }

        serviceLocator.RegisterInstance <LogViewerLogListener>(logListener);

        serviceLocator.RegisterType <IApplicationLogFilterGroupService, ApplicationLogFilterGroupService>();

        serviceLocator.RegisterType <ICalloutManager, CalloutManager>();

        serviceLocator.RegisterType <ISuggestionListService, SuggestionListService>();
        serviceLocator.RegisterType <IValidationNamesService, ValidationNamesService>();
        serviceLocator.RegisterType <ITextInputWindowService, TextInputWindowService>();
        serviceLocator.RegisterTypeIfNotYetRegistered <IControlToolManagerFactory, ControlToolManagerFactory>();

        serviceLocator.RegisterType <ITimeAdjustmentProvider, TimeAdjustmentProvider>();

        var viewModelLocator = serviceLocator.ResolveType <IViewModelLocator>();

        viewModelLocator.Register(typeof(CulturePicker), typeof(CulturePickerViewModel));
        viewModelLocator.Register(typeof(ValidationContextTree), typeof(ValidationContextTreeViewModel));
        viewModelLocator.Register(typeof(ValidationContextView), typeof(ValidationContextViewModel));

        var languageService = serviceLocator.ResolveType <ILanguageService>();

        languageService.RegisterLanguageSource(new LanguageResourceSource("Orc.Controls", "Orc.Controls.Properties", "Resources"));
    }
Ejemplo n.º 6
0
    /// <summary>
    /// Initializes the module.
    /// </summary>
    public static void Initialize()
    {
        var serviceLocator = ServiceLocator.Default;

        var logListener = (from x in LogManager.GetListeners()
                           where x is LogViewerLogListener
                           select(LogViewerLogListener) x).FirstOrDefault();

        if (logListener == null)
        {
            logListener = new LogViewerLogListener
            {
                IgnoreCatelLogging = true,
                IsDebugEnabled     = true,
                IsInfoEnabled      = true,
                IsWarningEnabled   = true,
                IsErrorEnabled     = true
            };

            LogManager.AddListener(logListener);
        }

        serviceLocator.RegisterInstance <LogViewerLogListener>(logListener);

        serviceLocator.RegisterType <ISuggestionListService, SuggestionListService>();
        serviceLocator.RegisterType <IValidationNamesService, ValidationNamesService>();

        // Override Catel.SelectDirectoryService with Orchestra.Services.SelectDirectoryService
        serviceLocator.RegisterType <ISelectDirectoryService, MicrosoftApiSelectDirectoryService>();

        var viewModelLocator = serviceLocator.ResolveType <IViewModelLocator>();

        viewModelLocator.Register(typeof(DateTimePickerControl), typeof(DateTimePickerViewModel));
        viewModelLocator.Register(typeof(TimeSpanControl), typeof(TimeSpanViewModel));
        viewModelLocator.Register(typeof(CulturePicker), typeof(CulturePickerViewModel));
        viewModelLocator.Register(typeof(ValidationContextTree), typeof(ValidationContextTreeViewModel));
        viewModelLocator.Register(typeof(ValidationContextView), typeof(ValidationContextViewModel));

        var languageService = serviceLocator.ResolveType <ILanguageService>();

        languageService.RegisterLanguageSource(new LanguageResourceSource("Orc.Controls", "Orc.Controls.Properties", "Resources"));
    }