本文整理汇总了C#中Procedure类的典型用法代码示例。如果您正苦于以下问题:C# Procedure类的具体用法?C# Procedure怎么用?C# Procedure使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Procedure类属于命名空间,在下文中一共展示了Procedure类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetImageFromGoogleCharts
Image GetImageFromGoogleCharts(Dimensions dimensions)
{
var chl = "&chl=" + Uri.EscapeDataString(GetValue<string>("text"));
var chs = string.Format("&chs={0}x{1}", dimensions.Width,
dimensions.Height);
var choe = "&choe=" + GetEncodingString();
var chld = string.Format("&chld={0}|{1}", GetValue<string>("error_correction"),
GetValue<int>("margin"));
var url = "http://chart.apis.google.com/chart?cht=qr"
+ chl + chs + choe + chld;
var procedure = new Procedure("file-uri-load");
try
{
var returnArgs = procedure.Run(url, url);
return returnArgs[0] as Image;
}
catch (GimpSharpException e)
{
new Message(e.Message);
return null;
}
}
示例2: Transform
public void Transform(Procedure proc)
{
foreach (var stm in proc.Statements)
{
stm.Instruction.Accept(this);
}
}
示例3: Add
public void Add(Procedure proc)
{
++procCount;
Program.Procedures[Address.Ptr32(procCount * 0x1000u)] = proc;
Program.CallGraph.AddProcedure(proc);
nameToProcedure[proc.Name] = proc;
}
示例4: LiveCopyInserter
public LiveCopyInserter(Procedure proc, SsaIdentifierCollection ssaIds)
{
this.proc = proc;
this.ssaIds = ssaIds;
this.sla = new SsaLivenessAnalysis(proc, ssaIds);
this.doms = proc.CreateBlockDominatorGraph();
}
示例5: GetParameters
public IEnumerable<Parameter> GetParameters(Procedure storedProcedure)
{
var parameters = _sqlReflection.ProcedureArguments
.Where(p => p.Item1.InvariantEquals(storedProcedure.Name))
.Select(p => new Parameter(p.Item2, p.Item3, p.Item4));
return parameters;
}
示例6: Test_Constructor
public void Test_Constructor()
{
Procedure procedure = new Procedure();
DocumentationProcedureStep procedureStep = new DocumentationProcedureStep(procedure);
Assert.AreEqual(procedure, procedureStep.Procedure);
}
示例7: GetServices
public static Schema.KRPC.Services GetServices()
{
var services = new Schema.KRPC.Services ();
foreach (var serviceSignature in Services.Instance.Signatures.Values) {
var service = new Schema.KRPC.Service ();
service.Name = serviceSignature.Name;
foreach (var procedureSignature in serviceSignature.Procedures.Values) {
var procedure = new Procedure ();
procedure.Name = procedureSignature.Name;
if (procedureSignature.HasReturnType)
{
procedure.HasReturnType = true;
procedure.ReturnType = TypeUtils.GetTypeName (procedureSignature.ReturnType);
}
foreach (var parameterSignature in procedureSignature.Parameters) {
var parameter = new Parameter ();
parameter.Name = parameterSignature.Name;
parameter.Type = TypeUtils.GetTypeName (parameterSignature.Type);
if (parameterSignature.HasDefaultArgument)
{
parameter.HasDefaultArgument = true;
parameter.DefaultArgument = parameterSignature.DefaultArgument;
}
procedure.Parameters.Add (parameter);
}
foreach (var attribute in procedureSignature.Attributes) {
procedure.Attributes.Add (attribute);
}
if (procedureSignature.Documentation != "")
procedure.Documentation = procedureSignature.Documentation;
service.Procedures.Add (procedure);
}
foreach (var clsSignature in serviceSignature.Classes.Values) {
var cls = new Class ();
cls.Name = clsSignature.Name;
if (clsSignature.Documentation != "")
cls.Documentation = clsSignature.Documentation;
service.Classes.Add (cls);
}
foreach (var enmSignature in serviceSignature.Enumerations.Values) {
var enm = new Enumeration ();
enm.Name = enmSignature.Name;
if (enmSignature.Documentation != "")
enm.Documentation = enmSignature.Documentation;
foreach (var enmValueSignature in enmSignature.Values) {
var enmValue = new EnumerationValue ();
enmValue.Name = enmValueSignature.Name;
enmValue.Value = enmValueSignature.Value;
if (enmValueSignature.Documentation != "")
enmValue.Documentation = enmValueSignature.Documentation;
enm.Values.Add (enmValue);
}
service.Enumerations.Add (enm);
}
if (serviceSignature.Documentation != "")
service.Documentation = serviceSignature.Documentation;
services.Services_.Add (service);
}
return services;
}
示例8: ApplySignatureToProcedure
public void ApplySignatureToProcedure(Address addr, ProcedureSignature sig, Procedure proc)
{
proc.Signature = sig;
int i = 0;
var stmts = proc.EntryBlock.Succ[0].Statements;
var linAddr = addr.ToLinear();
foreach (var param in sig.Parameters)
{
var starg = param.Storage as StackArgumentStorage;
if (starg != null)
{
proc.Frame.EnsureStackArgument(
starg.StackOffset + sig.ReturnAddressOnStack,
param.DataType,
param.Name);
}
else
{
var paramId = proc.Frame.EnsureIdentifier(param.Storage);
paramId.DataType = param.DataType;
// Need to take an extra step with parameters being passed
// in a register. It's perfectly possible for a user to
// create a variable which they want to call 'r2' but which
// the calling convention of the machine wants to call 'r1'.
// To avoid this, we create a temporary identifier for
// the formal parameter, and inject an copy statement in the
// entry block that moves the parameter value into the
// register.
stmts.Insert(i, linAddr, NewMethod(param, paramId));
++i;
}
}
}
示例9: DisplayProcedure
public void DisplayProcedure(Procedure proc)
{
if (proc == null)
return;
ShowWindow("codeViewerWindow", "Code Viewer", pane);
pane.DisplayProcedure(proc);
}
示例10: Test_Constructor_Procedure
public void Test_Constructor_Procedure()
{
Procedure procedure = new Procedure();
InterpretationStep procedureStep = new InterpretationStep(procedure);
Assert.IsNull(procedureStep.ReportPart);
}
示例11: GetParameters
public IEnumerable<Parameter> GetParameters(Procedure storedProcedure)
{
var list = new List<Parameter>();
using (var connection = _connectionProvider.CreateConnection())
{
connection.Open();
var command = connection.CreateCommand();
command.CommandType = CommandType.Text;
command.CommandText =
string.Format("SELECT * FROM information_schema.parameters WHERE SPECIFIC_NAME = '{0}';",
storedProcedure.Name);
using (var reader = command.ExecuteReader())
{
while (reader.Read())
{
list.Add(new Parameter
(
reader["PARAMETER_NAME"].ToString(),
SqlTypeResolver.GetClrType(reader["DATA_TYPE"].ToString()),
GetParameterDirection(reader["PARAMETER_MODE"].ToString()),
MysqlColumnInfo.GetDbType(reader["DATA_TYPE"].ToString()),
Convert.IsDBNull(reader["CHARACTER_MAXIMUM_LENGTH"]) ? -1 : Convert.ToInt32(reader["CHARACTER_MAXIMUM_LENGTH"])
));
}
}
connection.Close();
return list;
}
}
示例12: Test_Name
public void Test_Name()
{
Procedure procedure = new Procedure();
InterpretationStep procedureStep = new InterpretationStep(procedure);
Assert.AreEqual("Interpretation", procedureStep.Name);
}
示例13: TryAutoTerminateProcedureSteps
protected void TryAutoTerminateProcedureSteps(Procedure procedure, DateTime? time, IWorkflow workflow)
{
foreach (var mps in procedure.ModalityProcedureSteps)
{
// if the MPS is not terminated and has some MPPS
if(!mps.IsTerminated && !mps.PerformedSteps.IsEmpty)
{
var allMppsDiscontinued = CollectionUtils.TrueForAll(mps.PerformedSteps,
(PerformedProcedureStep pps) => pps.State == PerformedStepStatus.DC);
var allMppsTerminated = CollectionUtils.TrueForAll(mps.PerformedSteps,
(PerformedProcedureStep pps) => pps.IsTerminated);
if (allMppsDiscontinued)
{
// discontinue MPS, since all MPPS are discontinued
mps.Discontinue(time);
}
else if (allMppsTerminated)
{
// all MPPS are terminated, and at least one MPPS must be completed, so complete MPS
mps.Complete(time);
}
}
}
}
示例14: SegmentedAccessClassifier
public SegmentedAccessClassifier(Procedure proc, SsaIdentifierCollection ssaIds)
{
this.proc = proc;
this.ssaIds = ssaIds;
assocs = new Dictionary<Identifier,Identifier>();
consts = new Dictionary<Identifier, Constant>();
}
示例15: Test_Name
public void Test_Name()
{
Procedure procedure = new Procedure();
DocumentationProcedureStep procedureStep = new DocumentationProcedureStep(procedure);
Assert.AreEqual("Documentation", procedureStep.Name);
}