- Содержание
- Часть работы
- Список литературы
1.Постановка задачи 2
2.Средства разработки 3
3.Функциональное описание программы 4
4.Структуры данных 7
5.Руководство пользователя 8
Заключение 10
Список литературы 11
Приложение 12
Фрагмент для ознакомления
Parent = null; _menu = null; return; } _menu = value; _menu.Parent = this; var stripLocation = new Point { Left = IsBorderVisible ? 1 : 0, Top = 1 }; _menu.Location = stripLocation; } } public event EventHandler ScoreboardNavigate; public event EventHandler EscapePress; public void Navigate(object data = null) where TPG : PG, new() { if (PreNavigate()) { PGContext.Navigation.Navigate(data); } } public void NavigateFromStart(object data = null) where TScoreboard : PG, new() { if (PreNavigate()) { PGContext.Navigation.NavigateFromStart(data); } } protected virtual bool PreNavigate() { return true; } public virtual void GoBack(object data = null) { if (PreGoBack()) { PGContext.Navigation.GoBack(data); } } protected virtual bool PreGoBack() { return true; } public override void PressKey(KeyPressEventArgs e) { base.PressKey(e); var focusedElement = PGContext.CurrentState.FocusedElement; if (focusedElement != null) focusedElement.PressKey(e); } protected virtual void OnScoreboardNavigated(NavigatedEventArgs e) { EventHandler handler = ScoreboardNavigate; if (handler != null) { handler(this, e); } } public void PressEscape(KeyPressEventArgs e) { EventHandler handler = EscapePress; if (handler != null) { handler(this, new KeyPressEventArgs { KeyInfo = e.KeyInfo }); } OnEscapePressed(); } protected virtual void OnEscapePressed(object data = null) { GoBack(data); } internal void InitializeInternal() { if (PreInitialize()) { Initialize(); OnInitialized(new EventArgs()); PGContext.CurrentState.Initialized(); PostInitialize(); } } internal void NavigateInternal(NavigationType navigationType, object navigationData) { var args = new NavigatedEventArgs() { Data = navigationData, NavigationType = navigationType }; OnScoreboardNavigated(args); ScoreboardNavigated(args); } protected virtual void ScoreboardNavigated(NavigatedEventArgs e) { } protected override void PostRender() { } public override void Initialize() { base.Initialize(); foreach (var rootPanelControl in RootPanel.Controls) { rootPanelControl.Initialize(); } } protected override void Dispose(bool disposing) { if (disposing) { ClearEvents(); RootPanel.Dispose(); } base.Dispose(disposing); } public override void ClearEvents() { base.ClearEvents(); EscapePress = null; ScoreboardNavigate = null;} }}TextBox.csusing System;namespace ConsoleControlLib.CUI.Elements.Controls{ public class TextBox : ControlBase, IBorderable { public TextBox() { BackgroundColor = PGContext.RenderEngine.RenderOptions.ColorScheme.BoxesBackgroundColor; ForegroundColor = PGContext.RenderEngine.RenderOptions.ColorScheme.BoxesForegroundColor; ; InputLength = 15; MaxTextSize = 30; } public int InputLength { get; set; } public int MaxTextSize { get; set; } internal override string VisibleText { get { string text = IsFocused ? Text + '_' : Text; int length = text.Length; if (length > InputLength) { int startCharIndex = length - InputLength; return text.Substring(startCharIndex, InputLength); } return text; } } public bool IsBorderVisible { get; set; } public ConsoleColor BorderBackgroundColor { get; set; } public ConsoleColor BorderForegroundColor { get; set; } public override void PressKey(KeyPressEventArgs e) { base.PressKey(e); char character = e.KeyInfo.KeyChar; int length = Text.Length; if (!Char.IsControl(character) && length <= MaxTextSize) { Text += character; } else { if (e.KeyInfo.Key == ConsoleKey.Backspace && length > 0) { Text = Text.Remove(length - 1, 1); } } ReRender();} }}RadioButton.csusing System.Collections.Generic;using System.Linq;namespace ConsoleControlLib.CUI.Elements.Controls{ public class RadioButton : ToggleButtonBase { public RadioButton() { IsCheckedInternal = false; } public override bool? IsChecked { get { return base.IsChecked; } set { if (base.IsChecked != true) { base.IsChecked = value; IEnumerable otherRadios = PGContext.CurrentState.ControlsList.OfType().Where(_ => _ != this && _.Parent == Parent); foreach (RadioButton radio in otherRadios) { if (radio.IsCheckedInternal != null) { radio.IsCheckedInternal = false;radio.ReRender(); } } } } } }}ButtonBase.csusing System;namespace ConsoleControlLib.CUI.Elements.Controls{ public abstract class ButtonBase : ControlBase, ILinearable { public ButtonBase() { Width = 10; } public int Width { get; set; } internal override string VisibleText { get { int length = Text.Length; if (length > Width) { int startCharIndex = length - Width; return Text.Substring(startCharIndex, Width); } return base.VisibleText; } } public event EventHandler Pressed; public virtual void Press(KeyPressEventArgs e) { EventHandler handler = Pressed; if (handler != null) { handler(this, new KeyPressEventArgs { KeyInfo = e.KeyInfo }); } OnPressed(e); } public override void PressKey(KeyPressEventArgs e) { base.PressKey(e); if (e.KeyInfo.Key == ConsoleKey.Spacebar || e.KeyInfo.Key == ConsoleKey.Enter) { Press(e); } } protected virtual void OnPressed(KeyPressEventArgs e) { } public override void ClearEvents() { base.ClearEvents();Pressed = null; } }}Button.csusing System;using ConsoleControlLib.CUI.Elements.PGCanvases;namespace ConsoleControlLib.CUI.Elements.Controls{ public class Button : ButtonBase { public Button() { TextAligment = TitleAligment.Center; BackgroundColor = PGContext.RenderEngine.RenderOptions.ColorScheme.ButtonsBackgroundColor; ForegroundColor = PGContext.RenderEngine.RenderOptions.ColorScheme.ButtonsForegroundColor; } public TitleAligment TextAligment { get; set; }}}
1. Троелсен, Эндрю Язык программирования C# 5.0 и платформа .NET 4.5 / Эндрю Троелсен. - М.: Вильямс, 2015. - 486 c.
2. https://en.wikipedia.org/wiki/Text-based_user_interface
3. Фримен, Адам ASP.NET MVC 3 Framework с примерами на C# для профессионалов / Адам Фримен , Стивен Сандерсон. - М.: Вильямс, 2011. - 672 c.
4. Алан Купер Алан Купер об интерфейсе. Основы проектирования взаимодействия / Алан Купер. - М.: Символ-плюс, 2006. - 765 c.
5. Джесси Рассел Интерфейс пользователя / Джесси Рассел. - М.: VSD, 2012. - 281 c.
6. Грин Дж. Изучаем C# / Дж. Грин, Э. Стиллмен. – СПб.: «Питер», 2012.
7. Кариев Ч.А. Разработка Windows-приложений на основе Visual C# [Электронный ресурс] : учебное пособие / Ч.А. Кариев. — Электрон. текстовые данные. — Москва, Саратов: Интернет-Университет Информационных Технологий (ИНТУИТ), Вузовское образование, 2017. — 768 c