本文整理汇总了C#中ProcessState类的典型用法代码示例。如果您正苦于以下问题:C# ProcessState类的具体用法?C# ProcessState怎么用?C# ProcessState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ProcessState类属于命名空间,在下文中一共展示了ProcessState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
/// <summary>
/// Creates a processing result with the specified state.
/// </summary>
/// <param name="state">The state.</param>
/// <param name="message">The message.</param>
/// <returns></returns>
public static ProcessResult Create(ProcessState state, string message)
{
var result = new ProcessResult();
result.State = state;
result.Message = message;
return result;
}
示例2: ProcessReturnValue
public ProcessReturnValue()
{
this.fileName = "result";
this.status = ProcessState.Accepted;
this.statusMessage = "";
this.returnValues = new List<OutputData>();
this.responseForm = new ResponseFormType("wps:ResponseForm");
}
示例3: Start
public void Start()
{
thread = new Thread(new ThreadStart(Run));
thread.IsBackground = true;
isRun = true;
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
state = ProcessState.Stared;
}
示例4: Fail
public void Fail()
{
if (State == ProcessState.Running || State == ProcessState.Paused)
{
State = ProcessState.Succeeded;
return;
}
throw new InvalidOperationException("Invalid process transition. Process must be either running or paused to fail.");
}
示例5: FireStateChange
public void FireStateChange(int processId, ProcessState newState)
{
try
{
vertexScheduler.ProcessChangeState(processId, newState);
}
catch (Exception e)
{
DryadLogger.LogError(0, e, "Failed to change state to {0} for process {1}", newState.ToString(), processId);
}
}
示例6: DownloadDialogModel
public DownloadDialogModel(Encoder encoder, Video video)
{
this.encoder = encoder;
this.encoder.OnEncodeProgress += EncoderOnEncodeProgress;
this.encoder.OnEncodeFinished += EncoderOnEncodeFinished;
this.video = video;
title = TitleDownloading;
active = true;
state = ProcessState.Downloading;
}
示例7: DistributedProcessModel
public DistributedProcessModel(string host, string process, string path, int portNum, bool local)
{
hostName = host;
processName = process;
processPath = path;
port = portNum;
arguments.Add(host);
arguments.Add(port.ToString());
procState = ProcessState.Stopped;
routing = new RouteModel(host, port - 10000, local);
routing.openServerSocket();
}
示例8: DoInstruction
public override void DoInstruction(ExpressionMediator exm, InstructionLine func, ProcessState state)
{
ExpressionArrayArgument intExpArg = (ExpressionArrayArgument)func.Argument;
Int64 integer = -1;
foreach (IOperandTerm int64Term in intExpArg.TermList)
{
integer = int64Term.GetIntValue(exm);
if(isDel)
exm.VEvaluator.DelCharacter(integer);
else
exm.VEvaluator.AddCharacter(integer, isSp);
}
}
示例9: Debug
public void Debug(int processID)
{
debugger = new CorDebugger(CorDebugger.GetDefaultDebuggerVersion());
process = debugger.DebugActiveProcess(processID, false);
process.OnException += OnException;
process.OnCreateAppDomain += OnNewAppDomain;
process.OnProcessExit += OnExit;
process.OnModuleLoad += OnModuleLoad;
process.OnBreakpoint += OnBreakpoint;
process.OnStepComplete += OnStepComplete;
process.Continue(false);
state = ProcessState.Started;
subscriber.Published(string.Format("Successfully attached to Process with ID [{0}]", processID));
}
示例10: StartProcess
public void StartProcess()
{
State = ProcessState.Running;
_programData.Lot.LotProgress = 0;
for (int w = 0; w < 5; w++)
{
_programData.Lot.WaferProgress = 0;
_programData.Lot.WaferId = (w + 1).ToString();
for (int d = 0; d < 100; d++)
{
Thread.Sleep(20);
_programData.Lot.WaferProgress = d;
}
_programData.Lot.WaferProgress = 100;
_programData.Lot.WaferId = "";
Thread.Sleep(100);
_programData.Lot.LotProgress = 20 * (w + 1);
}
_programData.Lot.LotProgress = 100;
State = ProcessState.Idle;
}
示例11: LoadModuleFromFile
public void LoadModuleFromFile(string fileName)
{
GBDebug.Assert(prState == ProcessState.NotLoaded, "Process state error. It is " + prState + ". It must be " + ProcessState.NotLoaded);
name = fileName;
completeFileName = GBFileSystem.CompleteFileNameForFile(baseDir, fileName + "." + ModuleExtension);
if (GBFileSystem.FileExists(completeFileName))
{
assembly = Assembly.LoadFrom(completeFileName);
GBDebug.Assert(assembly != null, "Assembly " + fileName + " cannot be loaded");
prState = ProcessState.PendingValidation;
}
else
{
prState = ProcessState.InitError;
throw new GBException(GBException.Reason.FileNotFound);
}
}
示例12: LoadMetadata
public void LoadMetadata(string fileName)
{
GBDebug.Assert(prState == ProcessState.NotLoaded, "Process state error. It is " + prState + ". It must be " + ProcessState.NotLoaded);
completePropertiesFileName = GBFileSystem.CompleteFileNameForFile(baseDir, fileName + "." + MetaDataExtension);
if (GBFileSystem.FileExists(completePropertiesFileName))
{
metadata = GBXMLContainer.LoadOrNull(completePropertiesFileName);
GBDebug.WriteLine(metadata);
}
else
{
prState = ProcessState.InitError;
throw new GBException(GBException.Reason.FileNotFound);
}
}
示例13: DownloaderRunWorkerCompleted
private void DownloaderRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
title = TitleEncoding;
state = ProcessState.Encoding;
SetChanged();
}
示例14: CloneParentOperation
CommandResult CloneParentOperation(SingleSteppingEngine new_thread)
{
if (parent.current_state == ProcessState.SingleThreaded) {
current_state = ProcessState.SingleThreaded;
return new ThreadCommandResult (new_thread.Thread);
}
if (parent.current_state != ProcessState.Running)
throw new InternalError ();
current_state = ProcessState.Running;
if ((parent.current_operation.ThreadingModel & ThreadingModel.ThreadingMode) == ThreadingModel.Global)
current_operation = parent.current_operation;
else if ((parent.current_operation.ThreadingModel & ThreadingModel.ThreadingMode) == ThreadingModel.Process)
current_operation = new ProcessCommandResult (this, parent.current_operation.ThreadingModel);
else
throw new InternalError ();
return current_operation;
}
示例15: StartOperation
internal CommandResult StartOperation(ThreadingModel model, SingleSteppingEngine caller)
{
if (!ThreadManager.InBackgroundThread)
throw new InternalError ();
if ((current_state != ProcessState.Stopped) && (current_state != ProcessState.SingleThreaded))
throw new TargetException (TargetError.NotStopped);
if ((model & ThreadingModel.ThreadingMode) == ThreadingModel.Single) {
current_state = ProcessState.SingleThreaded;
if ((model & ThreadingModel.ResumeThreads) != 0)
ResumeUserThreads (model, caller);
return new ThreadCommandResult (caller.Thread);
} else if ((model & ThreadingModel.ThreadingMode) != ThreadingModel.Process) {
throw new ArgumentException ();
}
lock (this) {
current_state = ProcessState.Running;
stopped_event.Reset ();
current_operation = new ProcessCommandResult (this, model);
}
ResumeUserThreads (model, caller);
return current_operation;
}