public void Initialize()
        {
            _container.RegisterType <ISolutionItemProvider, SmartScriptCreatureProvider>("Creature Script");
            _container.RegisterType <ISolutionItemProvider, SmartScriptGameobjectProvider>("Gameobject Script");
            _container.RegisterType <ISolutionItemProvider, SmartScriptQuestProvider>("Quest Script");
            _container.RegisterType <ISolutionItemProvider, SmartScriptAuraProvider>("Aura Script");
            _container.RegisterType <ISolutionItemProvider, SmartScriptSpellProvider>("Spell Script");
            _container.RegisterType <ISolutionItemProvider, SmartScriptTimedActionListProvider>("Timed action list Script");

            _container.Resolve <ISolutionEditorManager>().Register <SmartScriptSolutionItem>(item =>
            {
                var view         = new SmartScriptEditorView();
                var solutionItem = item as SmartScriptSolutionItem;
                var vm           = new SmartScriptEditorViewModel(solutionItem, _container, _container.Resolve <IHistoryManager>());
                view.DataContext = vm;

                DocumentEditor editor = new DocumentEditor();
                editor.Title          = solutionItem.Name;
                editor.Content        = view;
                editor.Undo           = vm.UndoCommand;
                editor.Redo           = vm.RedoCommand;
                editor.Save           = vm.SaveCommand;

                return(editor);
            });

            SmartDataLoader.Load(SmartDataManager.GetInstance(), new SmartDataFileLoader());
        }
        public void OnInitialized(IContainerProvider containerProvider)
        {
            containerProvider.Resolve <ISolutionEditorManager>().Register <SmartScriptSolutionItem>(item =>
            {
                var view         = new SmartScriptEditorView();
                var solutionItem = item as SmartScriptSolutionItem;
                var vm           = new SmartScriptEditorViewModel(solutionItem, containerProvider.Resolve <IHistoryManager>(), containerProvider.Resolve <IDatabaseProvider>(), containerProvider.Resolve <IEventAggregator>(), containerProvider.Resolve <ISmartFactory>(), containerProvider.Resolve <IItemFromListProvider>(), containerProvider.Resolve <SmartTypeListProvider>(), containerProvider.Resolve <ISolutionItemNameRegistry>());
                view.DataContext = vm;

                DocumentEditor editor = new DocumentEditor();
                editor.Title          = containerProvider.Resolve <ISolutionItemNameRegistry>().GetName(solutionItem);
                editor.Content        = view;
                editor.Undo           = vm.UndoCommand;
                editor.Redo           = vm.RedoCommand;
                editor.Save           = vm.SaveCommand;
                editor.History        = vm.History;
                editor.CanClose       = true;

                return(editor);
            });

            SmartDataLoader.Load(SmartDataManager.GetInstance(), new SmartDataFileLoader());
        }
Example #3
0
 public void OnInitialized(IContainerProvider containerProvider)
 {
     SmartDataLoader.Load(SmartDataManager.GetInstance(), new SmartDataFileLoader());
 }