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


C# IShellContext.SetVariable方法代码示例

本文整理汇总了C#中IShellContext.SetVariable方法的典型用法代码示例。如果您正苦于以下问题:C# IShellContext.SetVariable方法的具体用法?C# IShellContext.SetVariable怎么用?C# IShellContext.SetVariable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IShellContext的用法示例。


在下文中一共展示了IShellContext.SetVariable方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DoRun

 protected override void DoRun(IShellContext context)
 {
     var dbs = GetDatabaseStructure(context);
     var model = new DataSetModel(dbs, context, GetConnectionProvider(context).Factory);
     model.KeepUndefinedReferences = KeepUndefinedReferences;
     context.SetVariable(GetDataSetVariableName(context), model);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:DataSet.cs

示例2: DoRun

 protected override void DoRun(IShellContext context)
 {
     string file = context.ResolveFile(context.Replace(File), ResolveFileMode.Input);
     var model = ExcelModel.OpenFile(file);
     model.DataFormat = DataFormat;
     context.SetVariable(GetExcelVariableName(context), model);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:Open.cs

示例3: DoRun

 protected override void DoRun(IShellContext context)
 {
     context.OutputMessage("Opening MS Excel");
     var model = ExcelModel.CreateNewWindow();
     model.DataFormat = DataFormat;
     context.SetVariable(GetExcelVariableName(context), model);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:NewWindow.cs

示例4: DoRun

 protected override void DoRun(IShellContext context)
 {
     string file = context.ResolveFile(context.Replace(File), ResolveFileMode.Input);
     var model = ShapeFileModel.OpenFile(file, SpatialTool.GetProjection(Projection, context));
     model.DataFormat = DataFormat;
     model.AddFileIdentifier = AddFileIdentifier;
     context.SetVariable(GetShpVariableName(context), model);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:8,代码来源:ShpOpen.cs

示例5: DoRun

 protected override void DoRun(IShellContext context)
 {
     string file = context.ResolveFile(context.Replace(File), ResolveFileMode.Output);
     context.OutputMessage("Writing file " + Path.GetFullPath(file));
     var model = ExcelModel.CreateFile(file);
     model.DataFormat = DataFormat;
     context.SetVariable(GetExcelVariableName(context), model);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:8,代码来源:Create.cs

示例6: DoRun

 protected override void DoRun(IShellContext context)
 {
     string file = Path.GetTempFileName();
     context.SetVariable(context.Replace(Variable), file);
     context.AddDisposableItem(new TempFileHolder
     {
         File = file,
     });
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:9,代码来源:TempFile.cs

示例7: DoRun

 protected override void DoRun(IShellContext context)
 {
     using (var conn = GetConnectionProvider(context).Connect())
     {
         var cmd = conn.CreateCommand();
         cmd.CommandText = context.Replace(Text);
         object value = cmd.ExecuteScalar();
         context.SetVariable(context.Replace(Name), value);
     }
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:10,代码来源:QueryValue.cs

示例8: CreateColumnValues

 private void CreateColumnValues(ICdlRecord record, IShellContext context)
 {
     if (NeedColumnValues)
     {
         context.CreateScope();
         for (int i = 0; i < record.FieldCount; i++)
         {
             context.SetVariable(record.GetName(i), record.GetValue(i));
         }
     }
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:11,代码来源:MapValue.cs

示例9: DoRun

 protected override void DoRun(IShellContext context)
 {
     if (Value != null && Expression != null) throw new Exception("DBSH-00006 Both Value and Expression is set");
     if (Value != null)
     {
         if (Value is string)
         {
             context.SetVariable(context.Replace(Name), context.Replace(Value.ToString()));
         }
         else
         {
             context.SetVariable(context.Replace(Name), Value);
         }
     }
     if (Expression != null)
     {
         context.SetVariable(context.Replace(Name), context.Evaluate(Expression));
     }
     if (Expression == null && Value == null)
     {
         context.SetVariable(context.Replace(Name), null);
     }
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:23,代码来源:SetVariable.cs

示例10: DoRun

 protected override void DoRun(IShellContext context)
 {
     context.SetVariable(GetSyncModelVariableName(context), this);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:4,代码来源:SyncModel.cs


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