本文整理汇总了C#中IOutput.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# IOutput.Dispose方法的具体用法?C# IOutput.Dispose怎么用?C# IOutput.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOutput
的用法示例。
在下文中一共展示了IOutput.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessRowset
private RowSet ProcessRowset(IOutput outp)
{
bool ok = false;
try
{
if (outp is OutputError)
{
var ex = (outp as OutputError).CreateException();
_logger.Error(ex);
throw ex;
}
else if (outp is OutputVoid)
return null;
else if (outp is OutputSchemaChange)
return null;
else if (outp is OutputRows)
{
ok = true;
return new RowSet(outp as OutputRows, null, true);
}
else
{
var ex = new DriverInternalError("Unexpected output kind");
_logger.Error(ex);
throw ex;
}
}
finally
{
if (!ok)
outp.Dispose();
}
}
示例2: ProcessRowset
private CqlRowSet ProcessRowset(IOutput outp)
{
bool ok = false;
try
{
if (outp is OutputError)
{
var ex = (outp as OutputError).CreateException();
_logger.Error(ex);
throw ex;
}
else if (outp is OutputVoid)
return new CqlRowSet(outp as OutputVoid, this);
else if (outp is OutputSchemaChange)
return new CqlRowSet(outp as OutputSchemaChange, this);
else if (outp is OutputSetKeyspace)
{
SetKeyspace(CqlQueryTools.CqlIdentifier((outp as OutputSetKeyspace).Value));
return new CqlRowSet(outp as OutputSetKeyspace, this);
}
else if (outp is OutputRows)
{
ok = true;
return new CqlRowSet(outp as OutputRows, this, true);
}
else
{
var ex = new DriverInternalError("Unexpected output kind");
_logger.Error(ex);
throw ex;
}
}
finally
{
if (!ok)
outp.Dispose();
}
}