예제 #1
0
        public override void Initialize(IApp app)
        {
            base.Initialize(app);

            Compilers.ForEach(b =>
            {
                if (b.Type.GetInterface(typeof(IBackgroundCompiler).Name) == null)
                {
                    throw new ElideException("Compiler '{0}' doesn't implement IBackgroundCompiler interface.", b.Type);
                }

                var bc  = TypeCreator.New <IBackgroundCompiler>(b.Type);
                var inf = (EditorInfo)app.GetService <IEditorService>().GetInfo("editors", b.EditorKey);
                var ins = inf.Instance as ICodeEditor;

                if (ins == null)
                {
                    throw new ElideException("Compiler '{0}' can be only registered for the code editor.", b.Type);
                }

                var sci  = ins.Control as ScintillaControl;
                var wrap = new BackgroundCompiler(app, sci, bc, this);
                CompilerInstances.Add(b.EditorKey, wrap);
            });

            app.GetService <IDaemonService>().RegisterDaemon(this);
            app.GetService <IDocumentService>().DocumentAdded += (_, e) => DocumentOpened(e.Document);
        }
예제 #2
0
        public override void Initialize(IApp app)
        {
            base.Initialize(app);

            Providers.ForEach(b =>
            {
                var iface = default(Type);

                if ((iface = b.Type.GetInterface(typeof(ITaskProvider).FullName)) == null)
                {
                    throw new ElideException("Task provider '{0}' doesn't implement ITaskProvider interface.", b.Type);
                }

                ProviderInstances.Add(b.EditorKey, TypeCreator.New <ITaskProvider>(b.Type));
            });
        }
예제 #3
0
        public override void Initialize(IApp app)
        {
            base.Initialize(app);

            Resolvers.ForEach(r =>
            {
                var iface = default(Type);

                if ((iface = r.Type.GetInterface(typeof(IReferenceResolver <>).FullName)) == null)
                {
                    throw new ElideException("Resolver '{0}' doesn't implement IReferenceResolver<> interface.", r.Type);
                }

                var arg = iface.GetGenericArguments()[0];
                ResolverInstances.Add(arg, TypeCreator.New(r.Type));
            });
        }
예제 #4
0
        public override void Initialize(IApp app)
        {
            base.Initialize(app);

            Parsers.ForEach(b =>
            {
                var iface = default(Type);

                if ((iface = b.Type.GetInterface(typeof(ICodeParser <>).FullName)) == null)
                {
                    throw new ElideException("Parser '{0}' doesn't implement ICodeParser<> interface.", b.Type);
                }

                var arg = iface.GetGenericArguments()[0];
                BuilderInstances.Add(arg, TypeCreator.New(b.Type));
            });
        }
예제 #5
0
 public override void Initialize(IApp app)
 {
     base.Initialize(app);
     Editors.ForEach(e => e.Instance = TypeCreator.New <IEditor>(e.Type));
 }