-
Notifications
You must be signed in to change notification settings - Fork 4
/
Interfaces.cs
101 lines (75 loc) · 2.4 KB
/
Interfaces.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
namespace Menees.Windows.Forms
{
#region Using Directives
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
#endregion
#region public IFindDialog
/// <summary>
/// Provides a generic interface to a Find dialog.
/// </summary>
public interface IFindDialog : IDisposable
{
/// <summary>
/// Used to display the find dialog with the given data.
/// </summary>
/// <param name="owner">The dialog owner.</param>
/// <param name="data">The find data.</param>
/// <returns>True if OK was pressed.</returns>
bool Execute(IWin32Window owner, FindData data);
}
#endregion
#region public IFindTarget
/// <summary>
/// Provides a generic interface to a find target (e.g., a custom control or a window).
/// </summary>
public interface IFindTarget
{
/// <summary>
/// Gets whether the <see cref="Find"/> method can be used.
/// </summary>
bool CanFind { get; }
/// <summary>
/// Gets the caption to use for dialogs displayed for this find target.
/// </summary>
string? FindCaption { get; }
/// <summary>
/// Finds the specified text in the target.
/// </summary>
/// <param name="findData">The text to search for.</param>
/// <param name="findMode">Whether to find next, previous, or display a dialog.</param>
/// <returns>True if the find text was found and selected. False otherwise.</returns>
bool Find(FindData findData, FindMode findMode);
}
#endregion
#region internal IOutputWindow
// This is only implemented once for now, but it could also be
// implemented by an HtmlOutputWindow if we ever need one.
internal interface IOutputWindow : IFindTarget
{
bool HasSelection { get; }
bool HasText { get; }
bool IsFocused { get; }
IWin32Window OwnerWindow { get; set; }
string SelectedText { get; }
bool WordWrap { get; set; }
void Append(string message, Color color, int indentLevel, bool highlight, Guid outputId);
void Clear();
void Copy();
bool FindNextHighlightPosition(bool searchForward, bool moveCurrentPosition);
bool FindOutput(Guid outputId, bool moveCurrentPosition);
void Focus();
void SaveContent(string fileName, bool asRichText);
void SelectAll();
}
#endregion
}