本文整理汇总了C#中IDataSource类的典型用法代码示例。如果您正苦于以下问题:C# IDataSource类的具体用法?C# IDataSource怎么用?C# IDataSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IDataSource类属于命名空间,在下文中一共展示了IDataSource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TransactionEventArgs
public TransactionEventArgs(IDataSource dataSource, IsolationLevel isolationLevel, bool autoPersistAllOnCommit)
: base()
{
m_DataSource = dataSource;
m_IsolationLevel = isolationLevel;
m_AutoPersistAllOnCommit = autoPersistAllOnCommit;
}
示例2: ExecutionToken
/// <summary>
/// Initializes a new instance of the <see cref="ExecutionToken" /> class.
/// </summary>
/// <param name="dataSource">The data source.</param>
/// <param name="operationName">Name of the operation.</param>
/// <param name="commandText">The command text.</param>
/// <param name="commandType">Type of the command.</param>
protected ExecutionToken(IDataSource dataSource, string operationName, string commandText, CommandType commandType)
{
DataSource = dataSource;
OperationName = operationName;
CommandText = commandText;
CommandType = commandType;
}
示例3: notifyLocalDataSorceSetup
internal void notifyLocalDataSorceSetup(IDataSource localDataSource)
{
if (this.LocalDataSourceAdded != null)
{
this.LocalDataSourceAdded(this, new LocalDataSourceAddedEventArgs() { dataSource = localDataSource });
}
}
示例4: AcquisitionEngine
public AcquisitionEngine(IDataSource source)
{
samplesOverflowSink = new List<float>();
overviewWfLastCapture = DateTime.Now;
overviewWf = new Waveform(1, 6000000);
TriggerSources = new List<ITrigger>();
TriggerSources.Add(new FreeRunning());
TriggerSources.Add(new Edge());
Trigger = new Edge(); // TODO: Temporary trigger
Source = source;
Source.Data += ProcessWaveform;
Source.Data += Source_Data;
Source.HighresVoltage += Source_HighresVoltage;
Source.Connect(null);
var dummyCfg = new NetStreamConfiguration();
dummyCfg.AdcSpeed = 0;
dummyCfg.AfeGain = 0;
dummyCfg.UseFastAdc = false;
Source.Configure(dummyCfg);
}
示例5: ExecuteScalar
public virtual object ExecuteScalar(string sql, IDataSource dataSource, IList parameters)
{
this.Context.LogManager.Info(this, "Executing scalar sql query", "Sql: " + sql); // do not localize
IDbConnection connection;
IDbCommand cmd;
object result;
ITransaction transaction;
SqlExecutorCancelEventArgs e = new SqlExecutorCancelEventArgs(sql, dataSource, parameters);
this.Context.EventManager.OnExecutingSql(this, e);
if (e.Cancel)
{
this.Context.LogManager.Warn(this, "Executing scalar sql query canceled by observer!", "Sql: " + sql); // do not localize
return 0;
}
sql = e.Sql;
dataSource = e.DataSource;
parameters = e.Parameters;
connection = dataSource.GetConnection();
cmd = connection.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = sql;
AddParametersToCommand(cmd, parameters);
transaction = this.Context.GetTransaction(connection);
if (transaction != null)
{
cmd.Transaction = transaction.DbTransaction;
}
result = cmd.ExecuteScalar();
dataSource.ReturnConnection();
SqlExecutorEventArgs e2 = new SqlExecutorEventArgs(sql, dataSource, parameters);
this.Context.EventManager.OnExecutedSql(this, e2);
return result;
}
示例6: GetTableWithFullFallback
internal static MetaTable GetTableWithFullFallback(IDataSource dataSource, HttpContextBase context) {
MetaTable table = GetTableFromMapping(context, dataSource);
if (table != null) {
return table;
}
IDynamicDataSource dynamicDataSource = dataSource as IDynamicDataSource;
if (dynamicDataSource != null) {
table = GetTableFromDynamicDataSource(dynamicDataSource);
if (table != null) {
return table;
}
}
table = DynamicDataRouteHandler.GetRequestMetaTable(context);
if (table != null) {
return table;
}
Control c = dataSource as Control;
string id = (c != null ? c.ID : String.Empty);
throw new InvalidOperationException(String.Format(CultureInfo.CurrentCulture,
DynamicDataResources.MetaTableHelper_CantFindTable,
id));
}
示例7: Transaction
public Transaction(IDbTransaction dbTransaction, IDataSource dataSource, IContext ctx) : base(ctx)
{
m_DbTransaction = dbTransaction;
m_DataSource = dataSource;
m_OriginalKeepOpen = m_DataSource.KeepConnectionOpen;
m_DataSource.KeepConnectionOpen = true;
}
示例8: ExecuteBool
public bool? ExecuteBool(IDataSource dataSource)
{
var val = _root.GetValue(dataSource);
var valType = val.GetValueType();
if (valType != ValueType.Bool) throw new Exception("Return value is not boolean");
return val.AsBool();
}
示例9: InternalDiscoverSpParameterSet
/// <summary>
/// Discover at run time the appropriate set of Parameters for a stored procedure
/// </summary>
/// <param name="session">An IDalSession object</param>
/// <param name="spName">Name of the stored procedure.</param>
/// <param name="includeReturnValueParameter">if set to <c>true</c> [include return value parameter].</param>
/// <returns>The stored procedure parameters.</returns>
private IDataParameter[] InternalDiscoverSpParameterSet(
IDataSource dataSource,
string spName,
bool includeReturnValueParameter)
{
IDbCommand dbCommand = dataSource.DbProvider.CreateCommand();
dbCommand.CommandType = CommandType.StoredProcedure;
using (dbCommand)
{
cmd.CommandText = spName;
// The session connection object is always created but the connection is not alwys open
// so we try to open it in case.
session.OpenConnection();
DeriveParameters(session.DataSource.DbProvider, cmd);
if (cmd.Parameters.Count > 0) {
IDataParameter firstParameter = (IDataParameter)cmd.Parameters[0];
if (firstParameter.Direction == ParameterDirection.ReturnValue) {
if (!includeReturnValueParameter) {
cmd.Parameters.RemoveAt(0);
}
}
}
IDataParameter[] discoveredParameters = new IDataParameter[cmd.Parameters.Count];
cmd.Parameters.CopyTo(discoveredParameters, 0);
return discoveredParameters;
}
}
示例10: DataAccessIntentHandler
/// <summary>
/// Initializes a new instance of the <see cref="DataAccessIntentHandler"/> class.
/// </summary>
public DataAccessIntentHandler(IIntentManager intentManager,
INetworkSearchConfigBuilder networkSearchConfigBuilder,
IDataSourcesAndSchema dataSourcesAndSchema,
IExploreConfigBuilder exploreConfigBuilder,
INotificationService notificationService,
IExplorationIntentFactory explorationIntentFactory,
IAcxiomConstants acxiomConstants)
{
mIntentManager = intentManager;
mNetworkSearchConfigBuilder = networkSearchConfigBuilder;
mDataSourcesAndSchema = dataSourcesAndSchema;
mExploreConfigBuilder = exploreConfigBuilder;
mNotificationService = notificationService;
mExplorationIntentFactory = explorationIntentFactory;
mAcxiomConstants = acxiomConstants;
mDataSource = mDataSourcesAndSchema.DataSources.SingleOrDefault(x => x.Id.Equals(mAcxiomConstants.AcxiomDaodExternalContextRoot));
if (mDataSource == null)
{
string extractDataSourceNotFound = string.Format(AcxiomStringResources.ErrorExternalDataSourceNotFound, mAcxiomConstants.AcxiomDaodExternalContextRoot);
mNotificationService.PresentInformationNotificationWithoutDiagnosticsToTheUser(extractDataSourceNotFound);
throw new ArgumentException(string.Format(CultureInfo.InvariantCulture,
AcxiomStringResources.ErrorExternalDataSourceNotFound,
mAcxiomConstants.AcxiomDaodExternalContextRoot));
}
}
示例11: ContainsListCollection
public static bool ContainsListCollection(IDataSource dataSource) {
ICollection viewNames = dataSource.GetViewNames();
if (viewNames != null && viewNames.Count > 0) {
return true;
}
return false;
}
示例12: SetDataSource
private void SetDataSource(IDataSource dataSource, ILayer layer)
{
this.Clear();
this.activeDataSources.Add(dataSource);
this.videoControl.AddLayer(layer);
dataSource.Start();
}
示例13: RemoteDataService
public RemoteDataService(IDataSource dataSource, IAppSettings appSettings)
{
_appSettings = appSettings;
_dataSource = dataSource;
_httpClient = new HttpClient();
}
示例14: GetDataParams
private DataParams GetDataParams(DataId dataId, string folder, IDataSource dataSource)
{
var fileName = String.Format("{0}{1}.csv", dataId.Symbol, (int) dataId.Period);
var path = Path.Combine(folder, "Data", dataId.Source, fileName);
var dataParams = new DataParams
{
DataSourceName = dataId.Source,
Symbol = dataId.Symbol,
Period = dataId.Period,
DataId = dataId,
Path = path,
StartDate = dataSource.StartDate,
EndDate = dataSource.EndDate,
IsUseStartDate = dataSource.IsUseStartDate,
IsUseEndDate = dataSource.IsUseEndDate,
MaximumBars = dataSource.MaximumBars,
MaxIntrabarBars = dataSource.MaxIntrabarBars,
MinimumBars = dataSource.MinimumBars,
IsCheckDataAtLoad = dataSource.IsCheckDataAtLoad,
IsCutOffBadData = dataSource.IsCutOffBadData,
IsCutOffSatSunData = dataSource.IsCutOffSatSunData,
IsFillInDataGaps = dataSource.IsFillInDataGaps,
IsCacheData = dataSource.IsCacheDataFiles,
IsLongData = false
};
return dataParams;
}
示例15: HomeController
public HomeController(IDataSource dataSource, IDomainFactory domainFactory)
{
Contract.Requires(dataSource != null);
Contract.Requires(domainFactory != null);
domain = domainFactory.Create(dataSource);
}