当前位置: 首页>>代码示例>>C#>>正文


C# IApp.GetService方法代码示例

本文整理汇总了C#中IApp.GetService方法的典型用法代码示例。如果您正苦于以下问题:C# IApp.GetService方法的具体用法?C# IApp.GetService怎么用?C# IApp.GetService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IApp的用法示例。


在下文中一共展示了IApp.GetService方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Initialize

 public override void Initialize(IApp app)
 {
     base.Initialize(app);
     control.App = app;
     app.GetService<IDocumentService>().DocumentAdded += DocumentAdded;
     app.GetService<IDocumentService>().DocumentRemoved += DocumentRemoved;
     BuildNodes();
 }
开发者ID:rizwan3d,项目名称:elalang,代码行数:8,代码来源:OutlineView.cs

示例2: BuildLogger

        internal BuildLogger(IApp app, Document doc, ScintillaControl sci, BuildOptions options)
        {
            this.app = app;
            this.doc = doc;
            this.sci = sci;
            this.options = options;

            app.CloseView("ErrorList");
            this.err = app.GetService<IErrorListService>();
            this.output = app.GetService<IOutputService>();
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:11,代码来源:BuildLogger.cs

示例3: Initialize

        internal void Initialize(IApp app)
        {
            this.app = app;
            contextMenu = new ContextMenuStrip();
            contextMenu.Items.Add("Remove Bookmark", null, (o, e) => RemoveBookmark(lastNodeClick));
            MenuRenderer.ApplySkin(contextMenu);

            this.sciMap = new Dictionary<ScintillaControl,Object>();
            this.nodeMap = new Dictionary<Document,TreeNode>();
            this.treeView = new BufferedTreeView();
            this.treeView.Font = Fonts.Text;
            this.treeView.BorderStyle = BorderStyle.None;
            this.treeView.ShowLines = false;
            this.treeView.BeforeExpand += TreeViewBeforeExpand;
            this.treeView.NodeMouseClick += NodeMouseClick;

            var img = new ImageList();
            img.ColorDepth = ColorDepth.Depth32Bit;
            img.TransparentColor = Color.Magenta;
            img.ImageSize = new Size(16, 16);
            img.Images.Add("Folder", Bitmaps.Load<NS>("Folder"));
            img.Images.Add("Bookmark", Bitmaps.Load<NS>("Bookmark"));
            treeView.ImageList = img;

            var srv = app.GetService<IDocumentService>();
            srv.EnumerateDocuments().ForEach(d => AddDocument(d as TextDocument));
            srv.DocumentAdded += DocumentAdded;
            srv.DocumentRemoved += DocumentRemoved;
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:29,代码来源:BookmarkManager.cs

示例4: Initialize

 public void Initialize(IApp app)
 {
     viewer = new ObjectFileViewer();
     App = app;
     app.GetService<IConfigService>().ConfigUpdated += ConfigUpdated;
     contextMenu = BuildContextMenu();
 }
开发者ID:rizwan3d,项目名称:elalang,代码行数:7,代码来源:ObjectFileEditor.cs

示例5: Initialize

        public override void Initialize(IApp app)
        {
            base.Initialize(app);

            if (man == null)
                man = new TaskManager(app, (TaskListService)app.GetService<ITaskListService>());
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:7,代码来源:TaskListView.cs

示例6: TaskManager

        public TaskManager(IApp app, TaskListService service)
        {
            this.app = app;
            this.service = service;

            this.sciMap = new Dictionary<ScintillaControl,Object>();
            this.nodeMap = new Dictionary<CodeDocument,TreeNode>();
            this.treeView = new BufferedTreeView();
            this.treeView.Font = Fonts.Text;
            this.treeView.BorderStyle = BorderStyle.None;
            this.treeView.ShowLines = false;
            this.treeView.BeforeExpand += TreeViewBeforeExpand;
            this.treeView.NodeMouseClick += NodeMouseClick;

            var img = new ImageList();
            img.ColorDepth = ColorDepth.Depth32Bit;
            img.TransparentColor = Color.Magenta;
            img.ImageSize = new Size(16, 16);
            img.Images.Add("Folder", Bitmaps.Load<NS>("Folder"));
            img.Images.Add("Task", Bitmaps.Load<NS>("Task"));
            treeView.ImageList = img;

            var srv = app.GetService<IDocumentService>();
            srv.EnumerateDocuments().ForEach(d => AddDocument(d as CodeDocument));
            srv.DocumentAdded += DocumentAdded;
            srv.DocumentRemoved += DocumentRemoved;
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:27,代码来源:TaskManager.cs

示例7: Initialize

        public override void Initialize(IApp app)
        {
            base.Initialize(app);
            WB.Form.Initialize(app);

            var cs = app.GetService<IConfigService>();
            cs.ConfigUpdated += ConfigUpdated;
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:8,代码来源:EnvironmentService.cs

示例8: Initialize

        public override void Initialize(IApp app)
        {
            base.Initialize(app);
            grid.App = app;

            var builder = app.GetService<IMenuService>().CreateMenuBuilder<ContextMenuStrip>();
            grid.ContextMenuStrip = builder.Item("Clear", ClearItems, () => grid.ItemsCount > 0).Finish();
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:8,代码来源:ResultGridView.cs

示例9: Initialize

 public override void Initialize(IApp app)
 {
     base.Initialize(app);
     var docs = app.GetService<IDocumentService>();
     docs.ActiveDocumentChanged += ActiveDocumentChanged;
     docs.DocumentAdded += DocumentAdded;
     docs.DocumentClosed += DocumentClosed;
     docs.DocumentRemoved += DocumentRemoved;
 }
开发者ID:rizwan3d,项目名称:elalang,代码行数:9,代码来源:FileService.cs

示例10: Initialize

        public override void Initialize(IApp app)
        {
            base.Initialize(app);

            treeView.NodesNeeded += (o,e) => NodesNeeded(e.Node);
            treeView.NodeMouseDoubleClick += (o,e) =>
            {
                if (e.Node.Tag is FileInfo)
                    App.GetService<IFileService>().OpenFile((FileInfo)e.Node.Tag);
            };

            app.GetService<IConfigService>().ConfigUpdated += ConfigUpdated;
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:13,代码来源:ExplorerView.cs

示例11: DocReader

 internal DocReader(IApp app)
 {
     this.baseDir = app.GetService<IPathService>().GetPath(PlatformPath.Docs);
 }
开发者ID:rizwan3d,项目名称:elalang,代码行数:4,代码来源:DocReader.cs

示例12: Initialize

        internal void Initialize(IApp app)
        {
            topBorderPanel.BackColor = toolDock.BackColor = mainSplit.BackColor = UserColors.Background;
            mainSplit.SplitterDistance = mainSplit.ClientSize.Height - mainSplit.Panel2MinSize - mainSplit.SplitterWidth;

            App = app;
            documentContainer.SelectedDocumentFunc = App.Document;
            documentContainer.DocumentCaptionRedraw += (o,e) => UpdateWindowHeader();
            App.GetService<IDocumentService>().DocumentClosed += (o,e) => UpdateWindowHeader();
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:10,代码来源:MainForm.cs

示例13: Initialize

        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);
        }
开发者ID:rizwan3d,项目名称:elalang,代码行数:24,代码来源:BackgroundCompilerService.cs

示例14: CodeSamplesReader

 internal CodeSamplesReader(IApp app)
 {
     this.baseDir = Path.Combine(app.GetService<IPathService>().GetPath(PlatformPath.Docs), "samples");
 }
开发者ID:rizwan3d,项目名称:elalang,代码行数:4,代码来源:CodeSamplesReader.cs

示例15: SwiftPaymentStatusUpdateFactoryEngine

 public SwiftPaymentStatusUpdateFactoryEngine(IApp app)
     : base(app, AppEvents.Initialize | AppEvents.PostRun | AppEvents.PreStop)
 {
     app.GetService<ILogProvider>().System.Info("Constructing SWIFT payment status update engine...");
 }
开发者ID:keenkid,项目名称:BankReportService,代码行数:5,代码来源:SwiftPaymentStatusUpdateFactoryEngine.cs


注:本文中的IApp.GetService方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。