本文整理汇总了C#中Step.GetParameterValue方法的典型用法代码示例。如果您正苦于以下问题:C# Step.GetParameterValue方法的具体用法?C# Step.GetParameterValue怎么用?C# Step.GetParameterValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Step
的用法示例。
在下文中一共展示了Step.GetParameterValue方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
string first = step.GetParameterValue<string>("String", 1);
string second = step.GetParameterValue<string>("String", 2);
ServiceAgent.Currency from = (ServiceAgent.Currency)Enum.Parse(typeof(ServiceAgent.Currency), first, true);
ServiceAgent.Currency to = (ServiceAgent.Currency)Enum.Parse(typeof(ServiceAgent.Currency), second, true);
ConfigurationChannelFactory<ServiceAgent.CurrencyConvertorSoap> channelFactory = null;
double rate;
try
{
channelFactory = new ConfigurationChannelFactory<ServiceAgent.CurrencyConvertorSoap>("CurrencyConvertorSoap", conf.Configuration, null);
var client = channelFactory.CreateChannel();
rate = client.ConversionRate(from, to);
}
catch (Exception)
{
rate = double.NaN;
}
finally
{
if (channelFactory != null)
channelFactory.Close();
}
context.AddPublishedItem("Number", step.Id, rate);
}
示例2: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
Action<IDataReader> action = step.GetParameterValue<Action<IDataReader>>("Row Action");
string connString = step.GetParameterValue<string>("Connection String");
Query query = step.GetParameterValue<Query>("Query Definition");
var parameters = query.Parameters == null ? null : query.Parameters.ToSqlParameterArray();
var dal = new DataAccess(connString);
dal.ForEachRow(action, query.Sql, query.Type, parameters);
}
示例3: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
IExecutable action = step.GetParameterValue<IExecutable>("Configuration Info");
Logger.DebugFormat("action = {0}", action.GetType().Name);
string queryName = step.GetParameterValue<string>("String");
Logger.DebugFormat("query name = {0}", queryName);
var conf = new ConfigurationHelper(new ConfigurationManagerWrapper(action.GetType()));
var query = conf.GetSection<Query>(queryName);
Logger.DebugFormat("query retrieved = {0}", query.ToXml());
context.AddPublishedItem(new Public("Query Definition"), step.Id, query);
}
示例4: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
const string number = "Number";
const string integer = "Integer";
double first = step.GetParameterValue<int>(integer, 100);
double second = step.GetParameterValue<int>(integer, 200);
context.AddPublishedItem(number, 4, step.Id, second == 0.0 ? double.NaN : first / second);
context.AddPublishedItem(number, 5, step.Id, second == 0.0 ? double.NaN : first % second);
context.AddPublishedItem(number, 1, step.Id, first + second);
context.AddPublishedItem(number, 2, step.Id, first - second);
context.AddPublishedItem(number, 3, step.Id, first * second);
}
示例5: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
string name = step.GetParameterValue<string>("String");
Logger.DebugFormat("connection string name = {0}", name);
string returnValue = conf.ConnectionString(name);
Logger.DebugFormat("connection string retrieved = {0}", returnValue);
context.AddPublishedItem(new Public("Connection String"), step.Id, returnValue);
}
示例6: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
string cs = step.GetParameterValue<string>("Connection String");
if (string.IsNullOrEmpty(cs))
throw new ExecutionInterruptedException("cs is null");
var builder = new SqlConnectionStringBuilder(cs);
context.AddPublishedItem("Connection String Parts", step.Id, builder);
}
示例7: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
var builder = step.GetParameterValue<SqlConnectionStringBuilder>("Connection String Parts");
if (builder == null)
throw new ExecutionInterruptedException("builder is null");
string user = builder.IntegratedSecurity ? "<current>" :
string.IsNullOrEmpty(builder.UserID) ? "<empty>" : builder.UserID;
string question = string.Format("Connect to server {0}, database {1} as {2} ?",
builder.DataSource, builder.InitialCatalog, user);
context.AddPublishedItem("String", step.Id, question);
}
示例8: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
string str = step.GetParameterValue<string>("String");
if (!Common.UIHelper.Confirm(str))
throw new ExecutionInterruptedException("Stopped by the user");
}
示例9: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
Common.UIHelper.DisplayMessage(step.GetParameterValue<string>("String"));
}
示例10: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
double number = step.GetParameterValue<double>("Number");
context.AddPublishedItem("String", step.Id, string.Format("Result = {0:G}", number));
}
示例11: ExecuteAction
protected override void ExecuteAction(Context context, Step step)
{
string actual = step.GetParameterValue<string>("something");
if (actual != "test string")
throw new ExecutionInterruptedException();
}