本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例6: DoRun
protected override void DoRun(IShellContext context)
{
string file = Path.GetTempFileName();
context.SetVariable(context.Replace(Variable), file);
context.AddDisposableItem(new TempFileHolder
{
File = file,
});
}
示例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);
}
}
示例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));
}
}
}
示例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);
}
}
示例10: DoRun
protected override void DoRun(IShellContext context)
{
context.SetVariable(GetSyncModelVariableName(context), this);
}