本文整理汇总了C#中IProcess类的典型用法代码示例。如果您正苦于以下问题:C# IProcess类的具体用法?C# IProcess怎么用?C# IProcess使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IProcess类属于命名空间,在下文中一共展示了IProcess类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: StopProcessAsync
public static Task StopProcessAsync(IProcess process)
{
if (process == null)
return Task.FromResult<object>(null);
return Task.Run(() => process.Kill());
}
开发者ID:stefanschneider,项目名称:IronFrame,代码行数:7,代码来源:StopProcessHandler.cs
示例2: ArgumentNullException
void IProcessMonitor.Output(IProcess process, string line)
{
if (line == null)
throw new ArgumentNullException(nameof(line));
_Events.Add(new ProcessStandardOutputEvent(process.ExecutionDuration, DateTime.Now, line));
}
开发者ID:modulexcite,项目名称:commander,代码行数:7,代码来源:ProcessCollectOutputMonitor.cs
示例3: Init
public void Init()
{
_createPositionMock = new Mock<IProcess<CreatePositionParams, PositionDisplayViewModel>>();
_createPositionMock.Setup(x => x.Execute(It.IsAny<CreatePositionParams>())).Returns(new PositionDisplayViewModel());
_verifyTokenMock = new Mock<IProcess<VerifyUserLinkedInAccessTokenParams, UserAccessTokenResultViewModel>>();
_verifyTokenMock.Setup(x => x.Execute(It.IsAny<VerifyUserLinkedInAccessTokenParams>())).Returns(new UserAccessTokenResultViewModel { AccessTokenValid = true });
_createCompanyCmdMock = CommandTestUtils.GenerateCreateCompanyCommandMock();
_createCompanyCmdMock.Setup(x => x.Execute()).Returns(new Company { Id = NEW_COMPANY_ID });
_companyQueryMock = QueryTestUtils.GenerateCompanyByIdQueryMock();
_process = new LinkedInPositionSearchProcesses(_context, _verifyTokenMock.Object, _createCompanyCmdMock.Object, _createPositionMock.Object, _companyQueryMock.Object);
// Initialize user with test (but valid) access token data
_user = new User { LastVisitedJobSearch = new JobSearch() };
var oauth = new OAuthData
{
Token = "bfcf3fe4-b4d4-4f37-9d32-292ae9d45347",
Secret = "f66673b2-5877-4fbf-80e0-3826ca9f7eed",
TokenProvider = TokenProvider.LinkedIn,
TokenType = TokenType.AccessToken,
};
oauth.LinkedInUsers.Add(_user);
_user.LinkedInOAuthData = oauth;
_context.Users.Add(_user);
_context.OAuthData.Add(oauth);
_context.SaveChanges();
}
开发者ID:KallDrexx,项目名称:MyJobLeads,代码行数:30,代码来源:AddLinkedInPositionTests.cs
示例4: PowerShellConsole
public PowerShellConsole(IPackage package, IProcess process, IFileSystem fileSystem, IPackageFile packageFile)
{
this.fileSystem = fileSystem;
this.package = package;
this.process = process;
this.packageFile = packageFile;
}
开发者ID:alexfalkowski,项目名称:NuGet.AdvancedPackagingTool,代码行数:7,代码来源:PowerShellConsole.cs
示例5: CommunicationViewModel
public CommunicationViewModel(
IProcess process, PacketListViewModel packetList, PacketDetailsViewModel packetDetails, IBus bus)
: base(bus)
{
Contract.Requires<ArgumentNullException>(process != null);
Contract.Requires<ArgumentNullException>(packetList != null);
Contract.Requires<ArgumentNullException>(packetDetails != null);
Contract.Requires<ArgumentNullException>(bus != null);
this.process = process;
this.packetList = packetList;
this.packetDetails = packetDetails;
Func<string> getTitle =
() =>
"Communication: " + (this.process.Player != null ? this.process.Player.Name : this.process.DisplayName);
this.Title = getTitle();
PropertyChangedEventManager.AddHandler(
this.process, (sender, args) => this.Title = getTitle(), string.Empty);
PropertyChangedEventManager.AddHandler(
this.packetList,
(sender, args) => this.packetDetails.Packet = this.packetList.SelectedPacket,
"SelectedPacket");
this.Bus.Subscribe(this.packetList);
}
开发者ID:gordonc64,项目名称:AO-Workbench,代码行数:25,代码来源:CommunicationViewModel.cs
示例6: Init
public void Init()
{
_verifyTokenMock = new Mock<IProcess<VerifyUserLinkedInAccessTokenParams,UserAccessTokenResultViewModel>>();
_verifyTokenMock.Setup(x => x.Execute(It.IsAny<VerifyUserLinkedInAccessTokenParams>())).Returns(new UserAccessTokenResultViewModel { AccessTokenValid = true });
_createPositionMock = new Mock<IProcess<CreatePositionParams, PositionDisplayViewModel>>();
var createCompanyCmd = new CreateCompanyCommand(_serviceFactory.Object);
_process = new LinkedInPositionSearchProcesses(_context, _verifyTokenMock.Object, createCompanyCmd, _createPositionMock.Object, null);
// Initialize user with test (but valid) access token data
_user = new User();
var oauth = new OAuthData
{
Token = "bfcf3fe4-b4d4-4f37-9d32-292ae9d45347",
Secret = "f66673b2-5877-4fbf-80e0-3826ca9f7eed",
TokenProvider = TokenProvider.LinkedIn,
TokenType = TokenType.AccessToken,
};
oauth.LinkedInUsers.Add(_user);
_user.LinkedInOAuthData = oauth;
_context.Users.Add(_user);
_context.OAuthData.Add(oauth);
_context.SaveChanges();
}
开发者ID:KallDrexx,项目名称:MyJobLeads,代码行数:26,代码来源:LinkedInPositionDetailsTests.cs
示例7: Restart
public static Unit Restart()
{
ObservableRouter.Restart();
ActorConfig config = ActorConfig.Default;
if (system != null)
{
system.Shutdown();
}
Store = Map(Tuple("", (IProcess)new NullProcess()));
// Root
root = new Actor<Unit, object>(new ProcessId(), config.RootProcessName, Process.pub);
// Top tier
system = new Actor<Unit, object>(root.Id, config.SystemProcessName, Process.pub);
self = user = new Actor<Unit, object>(root.Id, config.UserProcessName, Process.pub);
// Second tier
deadLetters = new Actor<Unit, object>(system.Id, config.DeadLettersProcessName, Process.pub);
noSender = new Actor<Unit, object>(system.Id, config.NoSenderProcessName, Process.pub);
registered = new Actor<Unit, object>(system.Id, config.RegisteredProcessName, Process.pub);
return unit;
}
开发者ID:antonioj-mattos,项目名称:language-ext,代码行数:28,代码来源:ActorContext.cs
示例8: TestController
public TestController(IProcess _Process)
: base(_Process)
{
ui = new UserInterface();
reference = 2.5;
ui.textBox1.Text = reference.ToString();
}
开发者ID:robert-fekete,项目名称:ControllerArchitect,代码行数:7,代码来源:TestController.cs
示例9: SpawnTrinket
public void SpawnTrinket(IProcess targetProcess, TrinketSpawnConfiguration trinketSpawnConfiguration)
{
var components = new List<TrinketComponent>();
if (trinketSpawnConfiguration.IsDebugEnabled) {
components.Add(new DebugComponent());
}
if (trinketSpawnConfiguration.IsFileSystemHookingEnabled) {
components.Add(new FilesystemComponent(trinketSpawnConfiguration.IsFileSystemOverridingEnabled));
}
if (trinketSpawnConfiguration.Name != null) {
components.Add(new NameComponent(trinketSpawnConfiguration.Name));
}
if (trinketSpawnConfiguration.IsLoggingEnabled) {
components.Add(new VerboseLoggerComponent());
}
if (trinketSpawnConfiguration.IsCommandingEnabled) {
components.Add(new CommandListComponent(trinketSpawnConfiguration.CommandList));
}
if (trinketSpawnConfiguration.IsProcessSuspensionEnabled) {
components.Add(new ProcessSuspensionComponent(trinketSpawnConfiguration.SuspendedProcessNames));
}
var targetProcessId = targetProcess.Id;
var startupConfiguration = new TrinketStartupConfigurationImpl(targetProcessId, components);
using (var ms = streamFactory.CreateMemoryStream()) {
pofSerializer.Serialize(ms.Writer, startupConfiguration);
exeggutorService.SpawnHatchling(
kTrinketEggName,
new SpawnConfiguration {
Arguments = ms.ToArray(),
InstanceName = kTrinketEggName + "_" + targetProcessId,
StartFlags = HatchlingStartFlags.StartAsynchronously
});
}
}
开发者ID:iboshkov,项目名称:the-dargon-project,代码行数:35,代码来源:TrinketSpawnerImpl.cs
示例10: DoNothing
public override IEnumerable<TAVerb> DoNothing()
{
IProcess[] actions = new IProcess[_host.NumWords];
for (int i = 0; i < _host.NumWords; i++)
actions[i] = _host.Ops[i].Stick(StdLogicVector.DCs(_host.WordWidth));
yield return Verb(ETVMode.Locked, actions);
}
开发者ID:venusdharan,项目名称:systemsharp,代码行数:7,代码来源:Concatenizer.cs
示例11: StopProcess
public async Task StopProcess(IProcess process)
{
string exePath = process.ExePath;
try
{
if (!await StopGracefully(process))
{
Trace.TraceInformation(
"Process has not exited gracefully or is not listening to the stop event, let's try to close the main window");
if (!await Close(process))
{
Trace.TraceInformation("The host process would not close, attempting to kill");
await process.Kill();
Trace.TraceInformation("The host process was killed");
}
else
{
Trace.TraceInformation("Process exited with CloseMainWindow");
}
}
else
{
Trace.TraceInformation("Process exited gracefully");
}
await process.ReleaseResources();
await Task.Delay(ReleaseResourcesDelayMilliseconds); // allowing the os some time to release resources
}
catch (Exception ex)
{
// there is nothing more we can do; we'll swallow the exception and log an error
Trace.TraceError("{0} host process could not be killed. Exception was: {1}", exePath, ex);
}
}
开发者ID:ReubenBond,项目名称:Yams,代码行数:33,代码来源:ProcessStopper.cs
示例12: DashboardController
public DashboardController(IServiceFactory factory,
IProcess<OrgMemberDocVisibilityByOrgAdminParams, GeneralSuccessResultViewModel> orgDocVisibilityProcess)
{
_serviceFactory = factory;
_unitOfWork = factory.GetService<IUnitOfWork>();
_orgDocVisibilityProcess = orgDocVisibilityProcess;
}
开发者ID:KallDrexx,项目名称:MyJobLeads,代码行数:7,代码来源:DashboardController.cs
示例13: CreateContext
public IActionExecutionContext CreateContext(IProcess remoteProcess)
{
Contract.Requires<ArgumentNullException>(remoteProcess != null);
Contract.Ensures(Contract.Result<IActionExecutionContext>() != null);
throw new NotImplementedException();
}
开发者ID:gordonc64,项目名称:AOtomation.Domain,代码行数:7,代码来源:IChainTriggerHandlers.cs
示例14: BackupGitRepositoriesCommandProvider
public BackupGitRepositoriesCommandProvider(IBackupGitRepositoriesConfigurationProvider backupGitRepositoriesConfigurationProvider, IGitRepositoryBackupFolderProvider gitRepositoryBackupFolderProvider, IProcess process, ILog logger)
{
_backupGitRepositoriesConfigurationProvider = backupGitRepositoriesConfigurationProvider;
_gitRepositoryBackupFolderProvider = gitRepositoryBackupFolderProvider;
_process = process;
_logger = logger;
}
开发者ID:trondr,项目名称:NMultiTool,代码行数:7,代码来源:BackupGitRepositoriesCommandProvider.cs
示例15: RemoveProcess
public static void RemoveProcess(IProcess Proc)
{
lock (SyncObject)
{
ActiveProcesses.Remove(Proc);
}
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:7,代码来源:ProcessUtils.cs
示例16: ProcessTracker
public ProcessTracker(IMessageTransport transport, JobObject jobObject, IProcess hostProcess, ProcessHelper processHelper)
{
this.transport = transport;
this.jobObject = jobObject;
this.hostProcess = hostProcess;
this.processHelper = processHelper;
}
开发者ID:stefanschneider,项目名称:IronFrame,代码行数:7,代码来源:ProcessTracker.cs
示例17: HeartContext
public HeartContext()
{
worker.DoWork += worker_DoWork;
worker.WorkerSupportsCancellation = true;
Pump = new Com();
//Pump = new RandomPump();
//Pump = new FilePump();
//Pump.Received += Pump_Received;
Analyze = new ComDataAnalyze(Pump);
Analyze.Analyzed += Analyze_Analyzed;
Rate = new DifferenceHeartRate(this);
Rate.RateAnalyzed += Rate_RateAnalyzed;
AvgFilter = new AvgFilterProcess();
//FirFilter = new MyFirFilterProcess();
//FirFilter = new LowFirFilterProcess();
FirFilter = new BandPassFirFilterProcess();
BandStopFilter = new BandStopFirFilterProcess();
MedianFilter = new MedianFilterProcess();
Processes = new List<IProcess>()
{
AvgFilter,
FirFilter,
//BandStopFilter,
MedianFilter,
};
}
开发者ID:mpguard,项目名称:BtHeart,代码行数:31,代码来源:HeartContext.cs
示例18: AddProcess
public static void AddProcess(IProcess Proc)
{
lock (SyncObject)
{
ActiveProcesses.Add(Proc);
}
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:7,代码来源:ProcessUtils.cs
示例19: PowerShellPackageFile
public PowerShellPackageFile(
IProcess process, IPackageManager manager, IFileSystem fileSystem, string configurationPath)
{
this.process = process;
this.manager = manager;
this.fileSystem = fileSystem;
this.configurationPath = configurationPath;
}
开发者ID:alexfalkowski,项目名称:NuGet.AdvancedPackagingTool,代码行数:8,代码来源:PowerShellPackageFile.cs
示例20: ExistingAcadProcess
/// <summary>
/// Creates a new <see cref="ExistingAcadProcess"/> instane.
/// </summary>
/// <param name="logger">A logger.</param>
/// <param name="commandRunner">An AutoCAD command runner.</param>
/// <param name="process">The existing AutoCAD process.</param>
/// <param name="pluginLocator">An AutoCAD plugin locator.</param>
public ExistingAcadProcess(ILogger logger, IAcadCommandRunner commandRunner, IProcess process, IAcadPluginLocator pluginLocator)
: base(logger, commandRunner, pluginLocator)
{
if (process == null)
throw new ArgumentNullException("process");
this.process = process;
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:15,代码来源:ExistingAcadProcess.cs
注:本文中的IProcess类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论