当前位置: 首页>>代码示例>>C#>>正文


C# Step.GetParameterValue方法代码示例

本文整理汇总了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);
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:28,代码来源:GetExchangeRate.cs

示例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);
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:11,代码来源:PerformActionOnEveryRow.cs

示例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);
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:14,代码来源:PublishQuery.cs

示例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);
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:14,代码来源:DoArithmetic.cs

示例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);
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:8,代码来源:PublishConnectionString.cs

示例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);
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:9,代码来源:ParseConnectionString.cs

示例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);
        }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:12,代码来源:PublishSanitisedConnectionStringForVerification.cs

示例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");
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:6,代码来源:Confirm.cs

示例9: ExecuteAction

 protected override void ExecuteAction(Context context, Step step)
 {
     Common.UIHelper.DisplayMessage(step.GetParameterValue<string>("String"));
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:4,代码来源:DisplayString.cs

示例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));
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:5,代码来源:FormatNumber.cs

示例11: ExecuteAction

 protected override void ExecuteAction(Context context, Step step)
 {
     string actual = step.GetParameterValue<string>("something");
     if (actual != "test string")
         throw new ExecutionInterruptedException();
 }
开发者ID:panos-parisis,项目名称:Hypatia,代码行数:6,代码来源:ContextFactory.cs


注:本文中的Step.GetParameterValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。