本文整理汇总了C#中ICommandProcessor类的典型用法代码示例。如果您正苦于以下问题:C# ICommandProcessor类的具体用法?C# ICommandProcessor怎么用?C# ICommandProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICommandProcessor类属于命名空间,在下文中一共展示了ICommandProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Open
public void Open(Lifetime lifetime, IShellLocks shellLocks, ChangeManager changeManager, ISolution solution, DocumentManager documentManager, IActionManager actionManager, ICommandProcessor commandProcessor, TextControlChangeUnitFactory changeUnitFactory, JetPopupMenus jetPopupMenus)
{
Debug.Assert(!IsOpened);
_solution = solution;
DocumentManager = documentManager;
_jetPopupMenus = jetPopupMenus;
changeManager.Changed2.Advise(lifetime, Handler);
lifetime.AddAction(Close);
var expandAction = actionManager.Defs.TryGetActionDefById(GotoDeclarationAction.ACTION_ID);
if (expandAction != null)
{
var postfixHandler = new GotoDeclarationHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);
lifetime.AddBracket(
FOpening: () => actionManager.Handlers.AddHandler(expandAction, postfixHandler),
FClosing: () => actionManager.Handlers.RemoveHandler(expandAction, postfixHandler));
}
var findUsagesAction = actionManager.Defs.GetActionDef<FindUsagesAction>();
var findUsagesHandler = new FindUsagesHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);
lifetime.AddBracket(
FOpening: () => actionManager.Handlers.AddHandler(findUsagesAction, findUsagesHandler),
FClosing: () => actionManager.Handlers.RemoveHandler(findUsagesAction, findUsagesHandler));
}
示例2: JavaScriptRunner
public JavaScriptRunner(IFeedback<LogEntry> log, ICommandProcessor commandProcessor, IEntityContextConnection entityContextConnection)
{
if (log == null)
throw new ArgumentNullException("log");
if (commandProcessor == null)
throw new ArgumentNullException("commandProcessor");
if (entityContextConnection == null)
throw new ArgumentNullException("entityContextConnection");
Log = log;
CommandProcessor = commandProcessor;
EntityContextConnection = entityContextConnection;
log.Source = "JavaScript Runner";
JintEngine = new Jint.Engine(cfg =>
{
cfg.AllowClr();
cfg.AllowDebuggerStatement(JavascriptDebugEnabled);
});
//JintEngine.Step += async (s, info) =>
//{
// await Log.ReportInfoFormatAsync(CancellationToken.None, "{1} {2}",
// info.CurrentStatement.Source.Start.Line,
// info.CurrentStatement.Source.Code.Replace(Environment.NewLine, ""));
//};
}
示例3: TransmitPipe
public TransmitPipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, GpioPin cePin)
{
_configuration = configuration;
_commandProcessor = commandProcessor;
_registerContainer = registerContainer;
_logger = loggerFactoryAdapter.GetLogger(GetType());
_cePin = cePin;
}
示例4: CommandBase
protected CommandBase(
ICommandProcessor ParentCommandProcessor,
ITerminal Terminal)
{
_CommandProcessor = ParentCommandProcessor;
_Terminal = Terminal;
}
示例5: FindUsagesHandler
public FindUsagesHandler(Lifetime lifetime, IShellLocks shellLocks, ICommandProcessor commandProcessor, TextControlChangeUnitFactory changeUnitFactory, XXLanguageXXSolution nitraSolution)
{
_lifetime = lifetime;
_shellLocks = shellLocks;
_commandProcessor = commandProcessor;
_changeUnitFactory = changeUnitFactory;
_nitraSolution = nitraSolution;
}
示例6: RegisterProcessor
public void RegisterProcessor (CommandType type, ICommandProcessor processor)
{
if (processors.ContainsKey (type))
throw new ArgumentException (string.Format ("Command processor for type {0} is already registered", type));
if (processor != null)
processors [type] = processor;
}
示例7: ArduinoDetails
public ArduinoDetails(IRadio radio, ILoggerFactoryAdapter loggerFactory, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer)
{
_radio = radio;
_logger = loggerFactory.GetLogger(GetType());
_configuration = configuration;
_commandProcessor = commandProcessor;
_registerContainer = registerContainer;
}
示例8: Serialize
public static FFprobeSerializerResult Serialize(ICommandProcessor processor)
{
if (processor.Status == CommandProcessorStatus.Faulted)
{
return null;
}
var standardOutputString = processor.StdOut;
var serializerResult = FFprobeSerializerResult.Create();
var serializers = new List<IFFprobeSerializer>
{
new FFprobeStreamSerializer(),
new FFprobeFormatSerializer()
};
serializers.ForEach(serializer =>
{
var serializerStartIndex = 0;
while (serializerStartIndex > -1)
{
var searchingStartTag = string.Format("[{0}]", serializer.Tag);
var searchingEndTag = string.Format("[/{0}]", serializer.Tag);
var startTagIndex = standardOutputString.IndexOf(searchingStartTag, serializerStartIndex, StringComparison.OrdinalIgnoreCase);
if (startTagIndex == -1)
{
break;
}
var endTagIndex = standardOutputString.IndexOf(searchingEndTag, startTagIndex + 1, StringComparison.OrdinalIgnoreCase);
if (endTagIndex == -1)
{
break;
}
var startAt = startTagIndex + searchingStartTag.Length;
var lengthOf = endTagIndex - startAt;
var unserializedValueString = standardOutputString.Substring(startAt, lengthOf);
var rawSerializedValues = FFprobeGeneralSerializer.Serialize(unserializedValueString);
var serializedValues = serializer.Serialize(rawSerializedValues);
if (serializedValues != null)
{
var serializerResultItem = FFprobeSerializerResultItem.Create(serializer.Tag, serializedValues);
serializerResult.Results.Add(serializerResultItem);
}
serializerStartIndex = endTagIndex;
}
});
return serializerResult;
}
示例9: ProductsController
public ProductsController(IProductTasks productTasks, ICategoryTasks categoryTasks, IProductsQuery productsQuery,
ICommandProcessor commandProcessor, ICaptchaTasks captchaTasks)
{
_productTasks = productTasks;
_categoryTasks = categoryTasks;
_productsQuery = productsQuery;
_commandProcessor = commandProcessor;
_captchaTasks = captchaTasks;
}
示例10: Register
public void Register(ICommandProcessor commandProcessor)
{
var cmd = commandProcessor.Key.ToUpper();
if (_processors.ContainsKey(cmd))
throw new Exception(string.Format("The processor for command '{0}' is already registered", cmd));
_processors.Add(cmd, commandProcessor);
}
示例11: OnSuccessAction
public static void OnSuccessAction(ICommandFactory factory, ICommand command, ICommandProcessor results)
{
//results.StdOut
// - contains the results ffmpeg command line
System.Console.ForegroundColor = System.ConsoleColor.DarkMagenta;
System.Console.WriteLine("Succcess");
System.Console.WriteLine(results.StdOut);
System.Console.ForegroundColor = System.ConsoleColor.White;
}
示例12: PipeRegisterBase
protected PipeRegisterBase(ILoggerFactoryAdapter loggerFactoryAdapter, ICommandProcessor commandProcessor, byte address, byte length, byte[] defaultValue, byte pipeNumber, string name = "") :
base(loggerFactoryAdapter, commandProcessor, length, address, defaultValue, name)
{
PipeNumber = pipeNumber;
Name = string.Format("{0}{1}{2}",
GetType().Name,
PipeNumber,
string.IsNullOrEmpty(name) ? "" : string.Format(" ({0})", name));
Logger = loggerFactoryAdapter.GetLogger(Name);
}
示例13: BullsAndCowsGame
/// <summary>
/// Initializes a new instance of the BullsAndCowsGame class.
/// </summary>
/// <param name="randomNumberProvider">The randomNumberProvider used to generate random numbers.</param>
/// <param name="scoreboard">The scoreboard used to hold player's scores.</param>
/// <param name="printer">The printer used for printing messages and different objects.</param>
/// <param name="commandProcessor">The first command processor in the chain of responsibility.</param>
public BullsAndCowsGame(
IRandomNumberProvider randomNumberProvider,
ScoreBoard scoreboard,
IPrinter printer,
ICommandProcessor commandProcessor)
{
this.RandomNumberProvider = randomNumberProvider;
this.ScoreBoard = scoreboard;
this.Printer = printer;
this.CommandProcessor = commandProcessor;
}
示例14: ReceivePipe
public ReceivePipe(ILoggerFactoryAdapter loggerFactoryAdapter, IConfiguration configuration, ICommandProcessor commandProcessor, IRegisterContainer registerContainer, IReceivePipeCollection parent, int pipeId)
{
if (PipeId > 5)
throw new ArgumentOutOfRangeException(nameof(pipeId), "Invalid PipeId number for this Pipe");
_logger = loggerFactoryAdapter.GetLogger(string.Format("{0}{1}", GetType().Name, pipeId));
_configuration = configuration;
_commandProcessor = commandProcessor;
_registerContainer = registerContainer;
_parent = parent;
PipeId = pipeId;
}
示例15: Serialize
public static ContainerMetadata Serialize(ICommandProcessor processor)
{
if (processor.Status == CommandProcessorStatus.Faulted)
{
return null;
}
var standardOutputString = processor.StdOut;
return JsonConvert.DeserializeObject<ContainerMetadata>(standardOutputString);
}