Example #1
0
		public EditorViewModel(EditorPluginLoader plugins, Settings settings)
		{
			this.plugins = plugins;
			Settings.Current = settings;
			service = new OnlineService();
			AvailableProjects = new List<ProjectNameAndFontWeight>();
			Error = Resources.GetApiKeyHere;
			SetupLogger();
			VersionNumber = new VersionNumber();
			plugins.FindAndLoadAllPlugins();
			RegisterCommands();
			SetApiKey(LoadDataFromRegistry("ApiKey"));
			SetInitialContentProject();
			ConnectToOnlineServiceAndTryToLogin();
			EditorPlugins = new List<EditorPluginView>();
			messageViewModel = new PopupMessageViewModel(service);
			messageViewModel.MessageUpdated += RaisePopupMessageProperties;
		}
		private static EditorPluginLoader GetEditorPluginLoaderMock()
		{
			var mockPlugins = new EditorPluginLoader(Path.Combine("..", "..", ".."));
			mockPlugins.UserControlsType.Clear();
			mockPlugins.UserControlsType.Add(typeof(MockEditorPluginView));
			return mockPlugins;
		}
		public void LoadAllUserControlMainViews()
		{
			var plugins = new EditorPluginLoader(Path.Combine("..", "..", ".."));
			Console.WriteLine("Plugins: " + plugins.UserControlsType.ToText());
			Assert.Contains(typeof(ProjectCreatorView), plugins.UserControlsType);
		}