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


C# IShellContext类代码示例

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


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

示例1: DoRun

        protected override void DoRun(IShellContext context)
        {
            var db = GetDatabaseStructure(context);
            if (Table != null && Tables != null) throw new Exception("DBSH-00085 SetTableProperty: both of Table and tables attribute is set");
            if (Table == null && Tables == null) throw new Exception("DBSH-00086 SetTableProperty: none of Table and tables attribute is set");

            string value = context.Replace(Value);
            if (Table != null)
            {
                var table = db.FindTableLike(Table);
                if (table != null)
                {
                    table.Properties[Name] = value;
                }
            }
            if (Tables != null)
            {
                foreach (var table in db.Tables)
                {
                    if (Regex.Match(table.Name, Tables).Success)
                    {
                        table.Properties[Name] = value;
                    }
                }
            }
        }
开发者ID:dbshell,项目名称:dbshell,代码行数:26,代码来源:SetTableProperty.cs

示例2: DoRun

 protected override void DoRun(IShellContext context)
 {
     using (var conn = GetConnectionProvider(context).Connect())
     {
         GetModel(context).Prepare(conn);
     }
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:Prepare.cs

示例3: CdlFileWriter

 ICdlWriter ITabularDataTarget.CreateWriter(TableInfo rowFormat, CopyTableTargetOptions options, IShellContext context, DataFormatSettings sourceDataFormat)
 {
     string file = GetName(context);
     file = context.ResolveFile(file, ResolveFileMode.Output);
     context.OutputMessage("Writing file " + Path.GetFullPath(file));
     return new CdlFileWriter(file, rowFormat);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:CdlFile.cs

示例4: CdlFileReader

 ICdlReader ITabularDataSource.CreateReader(IShellContext context)
 {
     TableInfo table;
     BinaryReader br;
     OpenRead(out table, out br, context);
     return new CdlFileReader(table, br);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:CdlFile.cs

示例5: 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

示例6: 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

示例7: 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

示例8: DataSetModel

 public DataSetModel(DatabaseInfo targetDatabase, IShellContext context, IDatabaseFactory factory)
 {
     _targetDatabase = targetDatabase;
     _context = context;
     _factory = factory;
     _dda = _factory.CreateDataAdapter();
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:DataSetModel.cs

示例9: DoRun

 protected override void DoRun(IShellContext context)
 {
     GetModel(context).LoadReference(
         new NameWithSchema(context.Replace(Schema), context.Replace(Table)),
         context.Replace(Column), 
         new NameWithSchema(context.Replace(RefSchema), context.Replace(RefTable)));
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:LoadReference.cs

示例10: CreateWriter

 public ICdlWriter CreateWriter(TableInfo rowFormat, CopyTableTargetOptions options, IShellContext context, DataFormatSettings sourceDataFormat)
 {
     string file = context.ResolveFile(context.Replace(File), ResolveFileMode.Output);
     var fw = new StreamWriter(file);
     var provider = GetConnectionProvider(context);
     return new SqlFileWriter(fw, provider.Factory);
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:SqlDataWriter.cs

示例11: DoRun

 protected override void DoRun(IShellContext context)
 {
     string file = context.ResolveFile(context.Replace(File), ResolveFileMode.Output);
     if (Expression != null && Value != null) throw new Exception("DBSH-00078 SaveToFile: both Expression and Value is set");
     if (Expression == null && Value == null) throw new Exception("DBSH-00079 SaveToFile: none of Expression and Value is set");
     if (Expression != null)
     {
         object obj = context.Evaluate(Expression);
         if (obj is byte[])
         {
             var bytes = (byte[]) obj;
             using (var fw = System.IO.File.OpenWrite(file))
             {
                 fw.Write(bytes, 0, bytes.Length);
             }
         }
         else
         {
             using (var fw = new StreamWriter(file, false, Encoding))
             {
                 fw.Write(obj.ToString());
             }
         }
     }
     if (Value!=null)
     {
         string val = context.Replace(Value);
         using (var fw = new StreamWriter(file, false, Encoding))
         {
             fw.Write(val);
         }
     }
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:33,代码来源:SaveToFile.cs

示例12: RunContainer

        //public override void EnumChildren(Action<IShellElement> enumFunc)
        //{
        //    base.EnumChildren(enumFunc);
        //    foreach (var item in Commands) YieldChild(enumFunc, item);
        //}

        protected void RunContainer(IShellContext context)
        {
            foreach(var item in Commands)
            {
                item.Run(context);
            }
        }
开发者ID:dbshell,项目名称:dbshell,代码行数:13,代码来源:RunnableContainer.cs

示例13: OpenDbfRead

 private SocialExplorer.IO.FastDBF.DbfFile OpenDbfRead(IShellContext context)
 {
     var dbf = new SocialExplorer.IO.FastDBF.DbfFile(Encoding);
     var name = context.ResolveFile(context.Replace(Name), ResolveFileMode.Input);
     dbf.Open(name, System.IO.FileMode.Open);
     return dbf;
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:7,代码来源:DbfFile.cs

示例14: 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

示例15: ColumnMapperReader

 public ColumnMapperReader(ICdlReader source, TableInfo outputFormat, List<IColumnMapping> columnMap, List<int> counts, IShellContext context )
     : base(outputFormat)
 {
     _source = source;
     _columnMap = columnMap;
     _counts = counts;
     _context = context;
 }
开发者ID:dbshell,项目名称:dbshell,代码行数:8,代码来源:ColumnMapperReader.cs


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