Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HiveStatistics/sources/HeuristicLab.CodeEditor/3.4/CodeEditorBase.cs @ 12515

Last change on this file since 12515 was 12515, checked in by dglaser, 9 years ago

#2388: Merged trunk into HiveStatistics branch

File size: 4.1 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using System.CodeDom.Compiler;
24using System.Collections.Generic;
25using System.Reflection;
26using System.Threading.Tasks;
27using HeuristicLab.Common;
28using ICSharpCode.NRefactory.TypeSystem;
29
30namespace HeuristicLab.CodeEditor {
31  public class CodeEditorBase : System.Windows.Forms.UserControl {
32    public virtual string UserCode { get; set; }
33
34    public virtual string Prefix { get; set; }
35
36    public virtual string Suffix { get; set; }
37
38    public virtual bool ReadOnly { get; set; }
39
40    public virtual bool Locked { get; set; }
41
42    public virtual void AddAssemblies(IEnumerable<Assembly> assemblies) { }
43
44    public virtual Task AddAssembliesAsync(IEnumerable<Assembly> assemblies) {
45      return null;
46    }
47
48    public virtual void AddAssembly(Assembly assembly) { }
49
50    public virtual void RemoveAssembly(Assembly assembly) { }
51
52    public virtual void RemoveAssemblies(IEnumerable<Assembly> assemblies) { }
53
54    public virtual void ScrollAfterPrefix() { }
55
56    public virtual void ScrollToPosition(int line, int column) { }
57
58    public virtual void ShowCompileErrors(CompilerErrorCollection compileErrors) { }
59
60    #region Events
61    public event EventHandler TextEditorTextChanged;
62    protected virtual void OnTextEditorTextChanged() {
63      var handler = TextEditorTextChanged;
64      if (handler != null) handler(this, EventArgs.Empty);
65    }
66
67    public event EventHandler<EventArgs<IEnumerable<Assembly>>> AssembliesLoading;
68    protected virtual void OnAssembliesLoading(IEnumerable<Assembly> args) {
69      var handler = AssembliesLoading;
70      if (handler != null) handler(this, new EventArgs<IEnumerable<Assembly>>(args));
71    }
72
73    public event EventHandler<EventArgs<IEnumerable<Assembly>>> AssembliesLoaded;
74    protected virtual void OnAssembliesLoaded(IEnumerable<Assembly> args) {
75      var handler = AssembliesLoaded;
76      if (handler != null) handler(this, new EventArgs<IEnumerable<Assembly>>(args));
77    }
78
79    public event EventHandler<EventArgs<IEnumerable<IUnresolvedAssembly>>> InternalAssembliesLoaded;
80    protected virtual void OnInternalAssembliesLoaded(IEnumerable<IUnresolvedAssembly> args) {
81      var handler = InternalAssembliesLoaded;
82      if (handler != null) handler(this, new EventArgs<IEnumerable<IUnresolvedAssembly>>(args));
83    }
84
85    public event EventHandler<EventArgs<IEnumerable<Assembly>>> AssembliesUnloading;
86    protected virtual void OnAssembliesUnloading(IEnumerable<Assembly> args) {
87      var handler = AssembliesUnloading;
88      if (handler != null) handler(this, new EventArgs<IEnumerable<Assembly>>(args));
89    }
90
91    public event EventHandler<EventArgs<IEnumerable<Assembly>>> AssembliesUnloaded;
92    protected virtual void OnAssembliesUnloaded(IEnumerable<Assembly> args) {
93      var handler = AssembliesUnloaded;
94      if (handler != null) handler(this, new EventArgs<IEnumerable<Assembly>>(args));
95    }
96
97    public event EventHandler<EventArgs<IEnumerable<IUnresolvedAssembly>>> InternalAssembliesUnloaded;
98    protected virtual void OnInternalAssembliesUnloaded(IEnumerable<IUnresolvedAssembly> args) {
99      var handler = InternalAssembliesUnloaded;
100      if (handler != null) handler(this, new EventArgs<IEnumerable<IUnresolvedAssembly>>(args));
101    }
102    #endregion
103  }
104}
Note: See TracBrowser for help on using the repository browser.