We welcome contributions from the community. See Issues for a list of open bugs and enhancements. Contributors looking for something fun to work on should look at issues taged as:
Terminal.Gui follows the Mono Coding Guidelines. ../.editorconfig
uses Visual Studio to help enforce these.
Terminal.Gui, as a UI framework, heavily influences how console graphical user interfaces (GUIs) work. We use the following tenets to guide us:
NOTE: Like all tenets, these are up for debate. If you disagree, have questions, or suggestions about these tenets and guideliens submit an Issue using the design tag.
ctrl/command-c
, ctrl/command-v
, and ctrl/command-x
keyboard shortcuts for cut, copy, and paste versus defining new shortcuts.ctrl/command-q
quits/exits all modal views. See Issue #456 as a counter example that should be fixed.alt
key in a Terminal.Gui app will activate the MenuBar
, but in Unix the user has to press the full hotkey (e.g. alt-f
) or F9
.Terminal.Gui provides an API that is used by many. As the project evolves contributors should follow these tenets to ensure consistency and backwards compatabiltiy.
NOTE: Like all tenets, these are up for debate. If you disagree, have questions, or suggestions about these tenets and guideliens submit an Issue using the design tag.
Great care has been provided thus far in ensuring Terminal.Gui has great API Documentation. Contributors have a responsibility for continuously improving the API Documentation.
<summary></summary>
terse.<see cref=""/>
liberally to cross-link topics.<remarks></remarks>
to add more context and explanation.docfx/articles
folder as a .md
file. It will automatically get picked up and be added to Conceptual Documentation.The Microsoft .NET Framework Design Guidelines provides these guideliens for defining events:
Events always refer to some action, either one that is happening or one that has occurred. Therefore, as with methods, events are named with verbs, and verb tense is used to indicate the time when the event is raised.
✔️ DO name events with a verb or a verb phrase.
Examples include Clicked, Painting, DroppedDown, and so on.
✔️ DO give events names with a concept of before and after, using the present and past tenses.
For example, a close event that is raised before a window is closed would be called Closing, and one that is raised after the window is closed would be called Closed.
❌ DO NOT use "Before" or "After" prefixes or postfixes to indicate pre- and post-events. Use present and past tenses as just described.
✔️ DO name event handlers (delegates used as types of events) with the "EventHandler" suffix, as shown in the following example:
public delegate void ClickedEventHandler(object sender, ClickedEventArgs e);
✔️ DO use two parameters named sender and e in event handlers.
The sender parameter represents the object that raised the event. The sender parameter is typically of type object, even if it is possible to employ a more specific type.
✔️ DO name event argument classes with the "EventArgs" suffix.
We are not currently consistent along these lines in Terminal.Gui
at all. This leads to friction for adopters and bugs. As we take on fixing this we use the following guidelines:
Action<T>
idiom for internal APIs, not for public APIs. For public APIs we use the event/EventHandler
model.virtual
event raising function, named as OnEventToRaise
. Typical implementations will simply do a EventToRaise?.Invoke(this, eventArgs)
.event
as in public event EventHandler<EventToRaiseArgs> EventToRaise
theobject.EventToRaise += (sender, e) => {};
EventToRaise
can override OnEventToRaise
as needed.EventArgs
should be provided and the old and new state should be included. By doing this, event handler methods do not have to query the sender for state.See also: https://www.codeproject.com/Articles/20550/C-Event-Implementation-Fundamentals-Best-Practices
View
classesAbsolute Layout
).var foo = new Foo() { a = b };
).UICatalog
demo for the new class illustrates both Absolutle Layout
and Computed Layout
.<remark></remark>
to the XML Documentation to the code describing the breaking change. These will get picked up in the API Documentation.Terminal.Gui has an automated unit or regression test suite. See the Testing wiki
In addition UI Catalog is a great sample app for manual testing.
When adding new functionality, fixing bugs, or changing things, please either add a new Scenario
to UICatalog or update an existing Scenario
to fully illustrate your work and provide a test-case.