本文整理汇总了C#中ITerminal类的典型用法代码示例。如果您正苦于以下问题:C# ITerminal类的具体用法?C# ITerminal怎么用?C# ITerminal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITerminal类属于命名空间,在下文中一共展示了ITerminal类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ZeroOrOne
private static IEnumerable<IProduction> ZeroOrOne(INonTerminal identifier, ITerminal[] terminals)
{
// NonTerminal -> Terminal | <null>
return new[]{
new Production(identifier, terminals),
new Production(identifier) };
}
示例2: Shell
public Shell(ITerminal Term)
{
timer = timerReset;
term = Term;
allPrograms = new List<Program>();
editMode = false;
}
示例3: SubscriptionToTerminalEvents
public override void SubscriptionToTerminalEvents(ITerminal terminal)
{
terminal.OutgoingRequest += (sender, info) =>
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(info.ToString());
Console.ForegroundColor = ConsoleColor.Gray;
};
terminal.IncomingRequest += (sender, info) =>
{
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine(info.ToString());
Console.ForegroundColor = ConsoleColor.Gray;
};
terminal.StateChanged += (sender, state) => { Console.WriteLine(sender.ToString() + " - " + state); };
terminal.AnsweredTheCall += (sender, args) =>
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(sender.ToString() + " answered the call");
Console.ForegroundColor = ConsoleColor.Gray;
};
terminal.DroppedTheCall += (sender, args) =>
{
Console.ForegroundColor = ConsoleColor.Blue;
Console.WriteLine(sender.ToString() + " dropped the call");
Console.ForegroundColor = ConsoleColor.Gray;
};
}
示例4: AddTerminal
public void AddTerminal(ITerminal terminal)
{
if (terminal == null) throw new ArgumentNullException(nameof(terminal));
RegisterTerminal(terminal);
_terminals.Add(terminal);
}
示例5: DisplayTcpServerInfo
private void DisplayTcpServerInfo(TcpServer server, ITerminal output)
{
this.DisplayListenerInfo(server, output);
if(!server.IsListening)
return;
output.WriteLine();
output.Write(TerminalColor.DarkMagenta, "ID\t");
output.Write(TerminalColor.DarkMagenta, ResourceUtility.GetString("${LastReceivedTime}") + "\t\t");
output.Write(TerminalColor.DarkMagenta, ResourceUtility.GetString("${LastSendTime}") + "\t\t");
output.Write(TerminalColor.DarkMagenta, ResourceUtility.GetString("${LocalEndPoint}") + "\t\t");
output.WriteLine(TerminalColor.DarkMagenta, ResourceUtility.GetString("${RemoteEndPoint}") + "\t");
var channels = server.ChannelManager.GetActivedChannels();
foreach(TcpServerChannel channel in channels)
{
if(channel == this.Channel)
output.Write(TerminalColor.Magenta, "* ");
output.WriteLine(
"{0}\t{1:yyyy-MM-dd HH:mm:ss}\t{2:yyyy-MM-dd HH:mm:ss}\t{3}\t\t{4}",
channel.ChannelId,
channel.LastReceivedTime,
channel.LastSendTime,
channel.LocalEndPoint,
channel.RemoteEndPoint);
}
output.WriteLine();
}
示例6: Deployer
public Deployer(ITerminal terminal)
{
if(terminal == null)
throw new ArgumentNullException("terminal");
_terminal = terminal;
}
示例7: CommandBase
protected CommandBase(
ICommandProcessor ParentCommandProcessor,
ITerminal Terminal)
{
_CommandProcessor = ParentCommandProcessor;
_Terminal = Terminal;
}
示例8: TerminalCommandExecutor
public TerminalCommandExecutor(ITerminal terminal, ICommandLineParser parser)
{
if(terminal == null)
throw new ArgumentNullException("terminal");
_terminal = terminal;
this.Parser = parser;
}
示例9: BlackJack
/// <summary>
/// Constructor for BlackJack game
/// </summary>
/// <param name="terminal"></param>
public BlackJack(ITerminal terminal)
: base(terminal)
{
_terminal = terminal;
user = new Player(100);
dealer = new Player(9999999);
_cardGame = new CardGame(terminal);
}
示例10: Initialize
public override void Initialize(IHostContext hostContext)
{
base.Initialize(hostContext);
Trace.Verbose("Creating _store");
_store = hostContext.GetService<IConfigurationStore>();
Trace.Verbose("store created");
_term = hostContext.GetService<ITerminal>();
}
示例11: WritePluginNode
public static void WritePluginNode(ITerminal terminal, PluginTreeNode node, ObtainMode obtainMode, int maxDepth)
{
if(node == null)
return;
terminal.Write(TerminalColor.DarkYellow, "[{0}]", node.NodeType);
terminal.WriteLine(node.FullPath);
terminal.Write(TerminalColor.DarkYellow, "Plugin File: ");
if(node.Plugin == null)
terminal.WriteLine(TerminalColor.Red, "N/A");
else
terminal.WriteLine(node.Plugin.FilePath);
terminal.Write(TerminalColor.DarkYellow, "Node Properties: ");
terminal.WriteLine(node.Properties.Count);
if(node.Properties.Count > 0)
{
terminal.WriteLine(TerminalColor.Gray, "{");
foreach(PluginExtendedProperty property in node.Properties)
{
terminal.Write(TerminalColor.DarkYellow, "\t" + property.Name);
terminal.Write(" = ");
terminal.Write(property.RawValue);
if(property.Value != null)
{
terminal.Write(TerminalColor.DarkGray, " [");
terminal.Write(TerminalColor.Blue, property.Value.GetType().FullName);
terminal.Write(TerminalColor.DarkGray, "]");
}
terminal.WriteLine();
}
terminal.WriteLine(TerminalColor.Gray, "}");
}
terminal.WriteLine(TerminalColor.DarkYellow, "Children: {0}", node.Children.Count);
if(node.Children.Count > 0)
{
terminal.WriteLine();
foreach(var child in node.Children)
{
terminal.WriteLine(child);
}
}
object value = node.UnwrapValue(obtainMode, null);
if(value != null)
{
terminal.WriteLine();
Zongsoft.Runtime.Serialization.Serializer.Text.Serialize(terminal.OutputStream, value);
}
}
示例12: PayBill
public bool PayBill(ITerminal terminal)
{
foreach (var c in this.CallHistory.Where(x => x.source.Number == terminal.Number)) {
if (c.Paid == false) {
c.Paid = true;
}
}
return true;
}
示例13: Shell
public Shell(ITerminal Term)
{
//timer = timerReset;
term = Term;
allPrograms = new List<Program>();
editMode = false;
programLog = new StringBuilder();
sinceLastRun = TimeSpan.Zero;
}
示例14: RedirectedProcess
public RedirectedProcess( ITerminal ClientTerminal, ICommandClient CommandClient )
{
_InputHandler = new InputHandler();
_TerminalClient = ClientTerminal;
_ProcessExit = new ManualResetEvent( false );
_CommandClient = CommandClient;
}
示例15: ZeroOrMany
private static IEnumerable<IProduction> ZeroOrMany(INonTerminal identifier, ITerminal[] terminals)
{
var recursiveProductionSymbols = new List<ISymbol>();
recursiveProductionSymbols.Add(identifier);
recursiveProductionSymbols.AddRange(terminals);
// NonTerminal -> NonTerminal Terminal | <null>
return new[]{
new Production(identifier, recursiveProductionSymbols.ToArray()),
new Production(identifier)};
}