aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Logging/IGlobalExceptionTrapper.cs
blob: 6ef59ec4d3373425476150a7a3b01602f8f8ca2d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Logging
{
    /// <summary>
    /// Represents a global exception trapper.
    /// </summary>
    public interface IGlobalExceptionTrapper
    {
        /// <summary>
        /// Occurs when the global exception trapper has detected an unhandled exception.
        /// </summary>
        event EventHandler<ApplicationCrashedEventArgs> ApplicationCrashed;
    }
}
> System.Windows; using System.Windows.Media.Imaging; using Tango.Scripting.Editors.Document; using Tango.Scripting.Editors.Editing; namespace Tango.Scripting.Editors.Intellisense { public abstract class CompletionItem : DependencyObject, ICompletionItem { public abstract string Text { get; } public object Description { get; set; } public double Priority { get; set; } public abstract CompletionItemPopupControl PopupControl { get; } public bool IsSelected { get { return (bool)GetValue(IsSelectedProperty); } set { SetValue(IsSelectedProperty, value); } } public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register("IsSelected", typeof(bool), typeof(CompletionItem), new PropertyMetadata(false)); public virtual void Complete(ScriptEditor editor) { var word = editor.GetCurrentWord(); int index = editor.GetCurrentWordStartIndex(); int max = editor.GetCurrentLine().EndOffset; editor.Document.Replace(index, word.Length,Text); } public abstract BitmapSource Image { get; } protected static BitmapSource GetImage(String name) { return new BitmapImage(new Uri($"pack://application:,,,/Tango.Scripting.Editors;component/Images/{name}", UriKind.Absolute)); } public override string ToString() { return Text; } } }