public DataProvider(AppMode appMode) { XmlRepository = new XmlRepository(this); CommonSettings = XmlRepository.LoadCommonSettings(); if (CommonSettings == null) { CommonSettings = new CommonSettings { IsSet = false } } ; else { CommonSettings.IsSet = true; } VariablesRepository = new VariablesRepository(this); ObjectsRepository = new ObjectsRepository(this); CommonSettings.AppMode = appMode; CommonSettings.AppModeChanged += delegate { ObjectsRepository.SwitchAppMode(); }; ProjectRepository = new ProjectRepository(this); DialogsManager = new DialogsManager(this); TabsRepository = new TabsRepository(this); WindowsManager = new WindowsManager(this); }