Changeset 12495 for branches/GBT/HeuristicLab.CodeEditor/3.4/CodeEditor.cs
- Timestamp:
- 06/23/15 12:50:05 (9 years ago)
- Location:
- branches/GBT
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GBT
- Property svn:mergeinfo changed
/trunk/sources merged: 12392-12393,12397-12401,12422,12424,12428-12435,12442-12443,12445,12455-12458,12461,12463-12465,12470-12476,12478-12482,12485,12488,12490-12494 -
Property
svn:global-ignores
set to
*.nuget
packages
- Property svn:mergeinfo changed
-
branches/GBT/HeuristicLab.CodeEditor/3.4/CodeEditor.cs
r12012 r12495 27 27 using System.Threading.Tasks; 28 28 using System.Windows.Documents; 29 using HeuristicLab.Common;30 29 using ICSharpCode.AvalonEdit; 31 30 using ICSharpCode.AvalonEdit.AddIn; … … 37 36 using ICSharpCode.AvalonEdit.Search; 38 37 using ICSharpCode.NRefactory.Editor; 39 using ICSharpCode.NRefactory.TypeSystem;40 38 using ICSharpCode.SharpDevelop.Editor; 41 39 using Forms = System.Windows.Forms; … … 44 42 45 43 namespace HeuristicLab.CodeEditor { 46 public partial class CodeEditor : Forms.UserControl{44 public partial class CodeEditor : CodeEditorBase { 47 45 private static readonly Media.Color WarningColor = Media.Colors.Blue; 48 46 private static readonly Media.Color ErrorColor = Media.Colors.Red; … … 73 71 private ITextMarker prefixMarker; 74 72 private string prefix = string.Empty; 75 public string Prefix {73 public override string Prefix { 76 74 get { return prefix; } 77 75 set { … … 91 89 private ITextMarker suffixMarker; 92 90 private string suffix = string.Empty; 93 public string Suffix {91 public override string Suffix { 94 92 get { return suffix; } 95 93 set { … … 108 106 } 109 107 110 public string UserCode {108 public override string UserCode { 111 109 get { return Doc.GetText(prefix.Length, Doc.TextLength - suffix.Length - prefix.Length); } 112 110 set { … … 163 161 #endregion 164 162 165 public bool ReadOnly {163 public override bool ReadOnly { 166 164 get { return TextEditor.IsReadOnly; } 167 165 set { TextEditor.IsReadOnly = value; } … … 259 257 260 258 #region Assembly Management 261 public void AddAssembly(Assembly a) {259 public override void AddAssembly(Assembly a) { 262 260 assemblyLoader.AddAssembly(a); 263 261 } 264 262 265 public void AddAssemblies(IEnumerable<Assembly> assemblies) {263 public override void AddAssemblies(IEnumerable<Assembly> assemblies) { 266 264 assemblyLoader.AddAssemblies(assemblies); 267 265 } 268 266 269 public async Task AddAssembliesAsync(IEnumerable<Assembly> assemblies) {267 public override async Task AddAssembliesAsync(IEnumerable<Assembly> assemblies) { 270 268 await assemblyLoader.AddAssembliesAsync(assemblies); 271 269 } 272 270 273 public void RemoveAssembly(Assembly a) {271 public override void RemoveAssembly(Assembly a) { 274 272 assemblyLoader.RemoveAssembly(a); 275 273 } 276 274 #endregion 277 275 278 public void ScrollToPosition(int line, int column) {276 public override void ScrollToPosition(int line, int column) { 279 277 var segment = GetSegmentAtLocation(line, column); 280 278 TextEditor.CaretOffset = segment.Offset + segment.Length; … … 282 280 } 283 281 284 public void ScrollAfterPrefix() {282 public override void ScrollAfterPrefix() { 285 283 var location = Doc.GetLocation(prefix.Length); 286 284 ScrollToPosition(location.Line, location.Column); … … 399 397 400 398 #region Compiler Errors 401 public void ShowCompileErrors(CompilerErrorCollection compilerErrors) {399 public override void ShowCompileErrors(CompilerErrorCollection compilerErrors) { 402 400 if (compilerErrors == null) return; 403 401 … … 446 444 } 447 445 } 448 449 #region Events450 public event EventHandler TextEditorTextChanged;451 private void OnTextEditorTextChanged() {452 var handler = TextEditorTextChanged;453 if (handler != null) handler(this, EventArgs.Empty);454 }455 456 public event EventHandler<EventArgs<IEnumerable<Assembly>>> AssembliesLoading;457 private void OnAssembliesLoading(IEnumerable<Assembly> args) {458 var handler = AssembliesLoading;459 if (handler != null) handler(this, new EventArgs<IEnumerable<Assembly>>(args));460 }461 462 public event EventHandler<EventArgs<IEnumerable<Assembly>>> AssembliesLoaded;463 private void OnAssembliesLoaded(IEnumerable<Assembly> args) {464 var handler = AssembliesLoaded;465 if (handler != null) handler(this, new EventArgs<IEnumerable<Assembly>>(args));466 }467 468 public event EventHandler<EventArgs<IEnumerable<IUnresolvedAssembly>>> InternalAssembliesLoaded;469 private void OnInternalAssembliesLoaded(IEnumerable<IUnresolvedAssembly> args) {470 var handler = InternalAssembliesLoaded;471 if (handler != null) handler(this, new EventArgs<IEnumerable<IUnresolvedAssembly>>(args));472 }473 474 public event EventHandler<EventArgs<IEnumerable<Assembly>>> AssembliesUnloading;475 private void OnAssembliesUnloading(IEnumerable<Assembly> args) {476 var handler = AssembliesUnloading;477 if (handler != null) handler(this, new EventArgs<IEnumerable<Assembly>>(args));478 }479 480 public event EventHandler<EventArgs<IEnumerable<Assembly>>> AssembliesUnloaded;481 private void OnAssembliesUnloaded(IEnumerable<Assembly> args) {482 var handler = AssembliesUnloaded;483 if (handler != null) handler(this, new EventArgs<IEnumerable<Assembly>>(args));484 }485 486 public event EventHandler<EventArgs<IEnumerable<IUnresolvedAssembly>>> InternalAssembliesUnloaded;487 private void OnInternalAssembliesUnloaded(IEnumerable<IUnresolvedAssembly> args) {488 var handler = InternalAssembliesUnloaded;489 if (handler != null) handler(this, new EventArgs<IEnumerable<IUnresolvedAssembly>>(args));490 }491 #endregion492 446 } 493 447 }
Note: See TracChangeset
for help on using the changeset viewer.