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


C# IDataSource类代码示例

本文整理汇总了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;
 }
开发者ID:BackupTheBerlios,项目名称:puzzle-svn,代码行数:7,代码来源:TransactionEventArgs.cs

示例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;
 }
开发者ID:docevaad,项目名称:Chain,代码行数:14,代码来源:ExecutionToken.cs

示例3: notifyLocalDataSorceSetup

 internal void notifyLocalDataSorceSetup(IDataSource localDataSource)
 {
     if (this.LocalDataSourceAdded != null)
     {
         this.LocalDataSourceAdded(this, new LocalDataSourceAddedEventArgs() { dataSource = localDataSource });
     }
 }
开发者ID:NoamShaish,项目名称:AcronymsHighlightsPlugin,代码行数:7,代码来源:AddInManager.cs

示例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);
        }
开发者ID:nlhans,项目名称:DigitalPhosphorDisplay,代码行数:26,代码来源:AcquisitionEngine.cs

示例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;
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:35,代码来源:SqlExecutor.cs

示例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));
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:25,代码来源:MetaTableHelper.cs

示例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;
		}
开发者ID:Dawn-of-Light,项目名称:Puzzle.NET,代码行数:7,代码来源:Transaction.cs

示例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();
 }
开发者ID:jordanwallwork,项目名称:jello,代码行数:7,代码来源:ParseResult.cs

示例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;
			}
		}
开发者ID:techvenky,项目名称:mybatisnet,代码行数:40,代码来源:DBHelperParameterCache.cs

示例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));
            }
        }
开发者ID:jscully,项目名称:Data-Acquisition-Accelerators,代码行数:30,代码来源:DataAccessIntentHandler.cs

示例11: ContainsListCollection

 public static bool ContainsListCollection(IDataSource dataSource) {
     ICollection viewNames = dataSource.GetViewNames();
     if (viewNames != null && viewNames.Count > 0) {
         return true;
     }
     return false;
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ListSourceHelper.cs

示例12: SetDataSource

 private void SetDataSource(IDataSource dataSource, ILayer layer)
 {
     this.Clear();
     this.activeDataSources.Add(dataSource);
     this.videoControl.AddLayer(layer);
     dataSource.Start();
 }
开发者ID:an83,项目名称:KinectTouch2,代码行数:7,代码来源:MainForm.cs

示例13: RemoteDataService

        public RemoteDataService(IDataSource dataSource, IAppSettings appSettings)
        {
            _appSettings = appSettings;
            _dataSource = dataSource;

            _httpClient = new HttpClient();
        }
开发者ID:Rob-Kachmar,项目名称:Bootcamp,代码行数:7,代码来源:RemoteDataService.cs

示例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;
        }
开发者ID:dsimba,项目名称:FSB_Pro_Indicators,代码行数:29,代码来源:DataLoader.cs

示例15: HomeController

        public HomeController(IDataSource dataSource, IDomainFactory domainFactory)
        {
            Contract.Requires(dataSource != null);
            Contract.Requires(domainFactory != null);

            domain = domainFactory.Create(dataSource);
        }
开发者ID:bumblebeetuna,项目名称:Sudoku,代码行数:7,代码来源:HomeController.cs


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