public ShellViewModel([ImportMany] IEnumerable<ToolViewModel> importedTools,
[ImportMany] IEnumerable<ILanguageService> languageServices, [ImportMany] IEnumerable<ISolutionType> solutionTypes, [ImportMany] IEnumerable<IProject> projectTypes,
[ImportMany] IEnumerable<IProjectTemplate> projectTemplates, [ImportMany] IEnumerable<IToolChain> toolChains,
[ImportMany] IEnumerable<IDebugger> debuggers, [ImportMany] IEnumerable<ITestFramework> testFrameworks,
[ImportMany] IEnumerable<ICodeTemplate> codeTemplates, [ImportMany] IEnumerable<IExtension> extensions,
[Import] IMenu mainMenu)
{
MainMenu = mainMenu;
LanguageServices = languageServices;
ProjectTemplates = projectTemplates;
ToolChains = toolChains;
Debuggers = debuggers;
SolutionTypes = solutionTypes;
ProjectTypes = projectTypes;
TestFrameworks = testFrameworks;
CodeTemplates = codeTemplates;
IoC.RegisterConstant(this, typeof(IShell));
foreach (var extension in extensions)
{
extension.BeforeActivation();
}
CurrentPerspective = Perspective.Editor;
StatusBar = new StatusBarViewModel();
DocumentTabs = new DocumentTabControlViewModel();
Console = IoC.Get<IConsole>();
ErrorList = IoC.Get<IErrorList>();
tools = new ObservableCollection<object>();
LeftTabs = new TabControlViewModel();
RightTabs = new TabControlViewModel();
BottomTabs = new TabControlViewModel();
BottomRightTabs = new TabControlViewModel();
RightBottomTabs = new TabControlViewModel();
RightMiddleTabs = new TabControlViewModel();
RightTopTabs = new TabControlViewModel();
MiddleTopTabs = new TabControlViewModel();
ModalDialog = new ModalDialogViewModelBase("Dialog");
foreach (var extension in extensions)
{
extension.Activation();
}
foreach (var tool in importedTools)
{
tools.Add(tool);
switch (tool.DefaultLocation)
{
case Location.Bottom:
BottomTabs.Tools.Add(tool);
break;
case Location.BottomRight:
BottomRightTabs.Tools.Add(tool);
break;
case Location.RightBottom:
RightBottomTabs.Tools.Add(tool);
break;
case Location.RightMiddle:
RightMiddleTabs.Tools.Add(tool);
break;
case Location.RightTop:
RightTopTabs.Tools.Add(tool);
break;
case Location.MiddleTop:
MiddleTopTabs.Tools.Add(tool);
break;
case Location.Left:
LeftTabs.Tools.Add(tool);
break;
case Location.Right:
RightTabs.Tools.Add(tool);
break;
}
}
LeftTabs.SelectedTool = LeftTabs.Tools.FirstOrDefault();
RightTabs.SelectedTool = RightTabs.Tools.FirstOrDefault();
BottomTabs.SelectedTool = BottomTabs.Tools.FirstOrDefault();
BottomRightTabs.SelectedTool = BottomRightTabs.Tools.FirstOrDefault();
RightTopTabs.SelectedTool = RightTopTabs.Tools.FirstOrDefault();
RightMiddleTabs.SelectedTool = RightMiddleTabs.Tools.FirstOrDefault();
RightBottomTabs.SelectedTool = RightBottomTabs.Tools.FirstOrDefault();
MiddleTopTabs.SelectedTool = MiddleTopTabs.Tools.FirstOrDefault();
StatusBar.LineNumber = 1;
StatusBar.Column = 1;
StatusBar.PlatformString = Platform.PlatformString;
ProcessCancellationToken = new CancellationTokenSource();
CurrentPerspective = Perspective.Editor;
ToolBarDefinition = ToolBarDefinitions.MainToolBar;
}