• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDataProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: Load

        public async Task Load(string rootFolder)
        {
            var createTables = false;

            if (!_databaseFile.Exists)
            {
                SQLiteConnection.CreateFile(_databaseFile.FullName);
                createTables = true;
            }

            var dataProvider = new IDataProvider[] {Images, Artists, Albums, Tracks, Playlists};

            _connection = new SQLiteConnection($"Data Source={_databaseFile.FullName};Version=3;");
            await _connection.OpenAsync();

            if(createTables)
                foreach (var provider in dataProvider)
                    await provider.CreateTables(_connection);

            foreach (var data in dataProvider)
                await data.Load(_connection);
           
            var userDataFileInfo = new FileInfo(Path.Combine(rootFolder, UserDataFilename));

            if (userDataFileInfo.Exists)
                await UserData.LoadFromFile(userDataFileInfo.FullName);

            LoadSettings();
        }
开发者ID:caesay,项目名称:Hurricane,代码行数:29,代码来源:MusicDataManager.cs


示例2: RegisterDataProvider

        private void RegisterDataProvider(IDataProvider provider)
        {
            if (provider == null)
            {
                throw new ArgumentNullException("provider");
            }

            Type type = provider.GetType();
            List<MethodInfo> methods = type.GetMethods()
                                           .Where(IsEvaluator)
                                           .ToList();

            foreach (MethodInfo method in methods)
            {
                string key = GetArgumentName(method);
                Func<double> evaluator = CreateEvaluator(method, provider);

                if (_evaluators.ContainsKey(key))
                {
                    throw new InvalidOperationException(String.Format("Formula argument duplicate {0}", key));
                }

                _evaluators[key] = evaluator;
            }
        }
开发者ID:v-zubritsky,项目名称:MilitaryFaculty,代码行数:25,代码来源:ReportDataProvider.cs


示例3: Database

 public Database(IDataProvider provider, string connectionString)
 {
     Timeout = -1;
     Provider = provider;
     ConnectionString = connectionString;
     LogDatabaseProviderName(provider.ToString());
 }
开发者ID:philous,项目名称:sharpmigrations,代码行数:7,代码来源:Database.cs


示例4: HandlesDegenerateCaseWithMoreThanOneProviderButOneIsEmpty

        public void HandlesDegenerateCaseWithMoreThanOneProviderButOneIsEmpty()
        {
            DataBinding[][] bindingsPerProvider = new DataBinding[][] {
                new DataBinding[] { new DataBinding(0, null) },
                new DataBinding[] { new DataBinding(0, null) },
            };

            IDataProvider[] providers = new IDataProvider[] {
                Mocks.StrictMock<IDataProvider>(),
                Mocks.StrictMock<IDataProvider>()
            };

            IDataItem[][] itemsPerProvider = new IDataItem[][] {
                new IDataItem[] {
                    new ScalarDataItem<int>(1, null, true),
                    new ScalarDataItem<int>(2, null, false)
                },
                new IDataItem[0]
            };

            using (Mocks.Record())
            {
                SetupResult.For(providers[0].GetItems(bindingsPerProvider[0], true)).Return(itemsPerProvider[0]);
                SetupResult.For(providers[1].GetItems(bindingsPerProvider[1], true)).Return(itemsPerProvider[1]);
            }

            using (Mocks.Playback())
            {
                List<IList<IDataItem>> items = new List<IList<IDataItem>>(PairwiseJoinStrategy.Instance.Join(providers, bindingsPerProvider, true));
                Assert.Count(0, items);
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:32,代码来源:PairwiseJoinStrategyTest.cs


示例5: HandlesDegenerateCaseWithOneProvider

        public void HandlesDegenerateCaseWithOneProvider()
        {
            DataBinding[] bindings = new DataBinding[] {
                new DataBinding(0, null)
            };
            IDataProvider[] providers = new IDataProvider[] {
                Mocks.StrictMock<IDataProvider>()
            };

            using (Mocks.Record())
            {
                Expect.Call(providers[0].GetItems(bindings, true)).Return(new IDataItem[] {
                    new ScalarDataItem<int>(1, null, true),
                    new ScalarDataItem<int>(2, null, false),
                    new ScalarDataItem<int>(3, null, true)
                });
            }

            using (Mocks.Playback())
            {
                List<IDataItem> items = new List<IDataItem>(IntersectionMergeStrategy.Instance.Merge(providers, bindings, true));
                Assert.Count(3, items);

                Assert.AreEqual(1, items[0].GetValue(bindings[0]));
                Assert.IsTrue(items[0].IsDynamic);

                Assert.AreEqual(2, items[1].GetValue(bindings[0]));
                Assert.IsFalse(items[1].IsDynamic);

                Assert.AreEqual(3, items[2].GetValue(bindings[0]));
                Assert.IsTrue(items[2].IsDynamic);
            }
        }
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:33,代码来源:IntersectionMergeStrategyTest.cs


示例6: QueryConditional

 protected QueryConditional(Type[] dbtypes, Expression expr, IDataProvider dataProvider)
 {
     LoadObjects(dbtypes);
     DataProvider = dataProvider;
     string conditional = TranslateExtendtion.TranslateConditional(expr, DataProvider);
     this.strConditional = new StringBuilder(conditional);
 }
开发者ID:yaozd,项目名称:YOYOFx,代码行数:7,代码来源:QueryConditional.cs


示例7: SimpleRepositoryTests

        public SimpleRepositoryTests(IDataProvider provider)
        {
            _provider = provider;

            _repo = new SimpleRepository(_provider, SimpleRepositoryOptions.RunMigrations);
            try
            {
                var qry = new CodingHorror(_provider, "DROP TABLE Shwerkos").Execute();
            }
            catch { }

            try
            {
                new CodingHorror(_provider, "DROP TABLE DummyForDeletes").Execute();
            }
            catch { }

            try
            {
                new CodingHorror(_provider, "DROP TABLE Shwerko2s").Execute();
            }
            catch { }

            try
            {
                new CodingHorror(_provider, "DROP TABLE NonAutoIncrementingIdWithDefaultSettings").Execute();
            }
            catch { }
        }
开发者ID:andrecarlucci,项目名称:SubSonic-3.0,代码行数:29,代码来源:SimpleRepositoryTests.cs


示例8: Subscribe

 public void Subscribe(IDataProvider provider, InstrumentList instruments)
 {
     if (provider.Status != ProviderStatus.Connected)
     {
         provider.Connect();
     }
     InstrumentList instrumentList = new InstrumentList();
     for (int i = 0; i < instruments.Count; i++)
     {
         Instrument byIndex = instruments.GetByIndex(i);
         if (!this.subscriptions.ContainsKey((int)provider.Id))
         {
             this.subscriptions[(int)provider.Id] = new Dictionary<Instrument, int>();
         }
         if (!this.subscriptions[(int)provider.Id].ContainsKey(byIndex) || this.subscriptions[(int)provider.Id][byIndex] == 0)
         {
             this.subscriptions[(int)provider.Id][byIndex] = 0;
             instrumentList.Add(byIndex);
         }
         Dictionary<Instrument, int> dictionary;
         Instrument key;
         (dictionary = this.subscriptions[(int)provider.Id])[key = byIndex] = dictionary[key] + 1;
     }
     if (instrumentList.Count > 0)
     {
         provider.Subscribe(instrumentList);
     }
 }
开发者ID:ForTrade,项目名称:CSharp,代码行数:28,代码来源:SubscriptionManager.cs


示例9: CommandsTable

        public CommandsTable(IDataProvider provider)
            : base("Commands",provider)
        {
            ClassName = "Command";
                SchemaName = "";

                Columns.Add(new DatabaseColumn("CommandName", this)
                {
                    IsPrimaryKey = false,
                    DataType = DbType.AnsiString,
                    IsNullable = true,
                    AutoIncrement = false,
                    IsForeignKey = false,
                    MaxLength = 2147483647
                });

                Columns.Add(new DatabaseColumn("File", this)
                {
                    IsPrimaryKey = false,
                    DataType = DbType.AnsiString,
                    IsNullable = true,
                    AutoIncrement = false,
                    IsForeignKey = false,
                    MaxLength = 2147483647
                });
        }
开发者ID:rench,项目名称:PCRemote,代码行数:26,代码来源:Structs.cs


示例10: AddTaskViewModel

        public AddTaskViewModel(IDataProvider batchService, string jobId)
        {
            this.batchService = batchService;
            this.IsBusy = false;

            this.JobId = jobId;
        }
开发者ID:haricr,项目名称:azure-batch-samples,代码行数:7,代码来源:AddTaskViewModel.cs


示例11: Sample

 public Sample(string fileName, string fullPath, IDataProvider dataProvider)
 {
     _fileName = fileName;
     FullPath = fullPath;
     _dataProvider = dataProvider;
     dataProviderTypeId = dataProvider.TypeId;
 }
开发者ID:pol,项目名称:MassSpecStudio,代码行数:7,代码来源:Sample.cs


示例12: SimplestsTable

            public SimplestsTable(IDataProvider provider):base("Simplests",provider){
                ClassName = "Simplest";
                SchemaName = "dbo";
                

                Columns.Add(new DatabaseColumn("Id", this)
                {
	                IsPrimaryKey = true,
	                DataType = DbType.Int64,
	                IsNullable = false,
	                AutoIncrement = false,
	                IsForeignKey = false,
	                MaxLength = 0
                });

                Columns.Add(new DatabaseColumn("Value", this)
                {
	                IsPrimaryKey = false,
	                DataType = DbType.Int64,
	                IsNullable = false,
	                AutoIncrement = false,
	                IsForeignKey = false,
	                MaxLength = 0
                });
                    
                
                
            }
开发者ID:jogibear9988,项目名称:ormbattle,代码行数:28,代码来源:Structs.cs


示例13: AUSaleService

        public AUSaleService(
            IRepository<AULotRecord> lotRepo,
            IConsignorService consignorService,
            IAuthenticationService authenticationService,
            IRepository<AUConsignmentLotRecord> consignmentlotRepo,
            IRepository<AUCountryLotRecord> countrylotRepo,
            IRepository<AUStateProvinceLotRecord> stateprovincelotRepo,
            IRepository<AULotLotRecord> lotlotRepo,
            IRepository<AUSaleRecord> saleRepo,
            IProductService productService,
            IDataProvider dataProvider,
            IDbContext dbContext,
            ICategoryService categoryService

            )
        {
            this._lotRepo = lotRepo;
            this._consignorService = consignorService;
            this._authenticationService = authenticationService;
            this._consignmentlotRepo = consignmentlotRepo;
            this._countrylotRepo = countrylotRepo;
            this._stateprovincelotRepo = stateprovincelotRepo;
            this._lotlotRepo = lotlotRepo;
            this._saleRepo = saleRepo;
            this._productService = productService;
            this._dataProvider = dataProvider;
            this._dbContext = dbContext;
            this._categoryService = categoryService;
        }
开发者ID:HumanSystems,项目名称:nopcommerce-dev,代码行数:29,代码来源:AUSaleService.cs


示例14: ArticleStructs

        public ArticleStructs(IDataProvider provider)
            : base("Article",provider)
        {
            ClassName = "Article";
                SchemaName = "dbo";

                Columns.Add(new DatabaseColumn("Id", this)
                {
                    IsPrimaryKey = true,
                    DataType = DbType.Int64,
                    IsNullable = false,
                    AutoIncrement = true,
                    IsForeignKey = true,
                    MaxLength = 0,
                    PropertyName = "Id"
                });

                Columns.Add(new DatabaseColumn("ArticleName", this)
                {
                    IsPrimaryKey = false,
                    DataType = DbType.String,
                    IsNullable = false,
                    AutoIncrement = false,
                    IsForeignKey = false,
                    MaxLength = 255,
                    PropertyName = "ArticleName"
                });
        }
开发者ID:shjko,项目名称:SpeciesSolution,代码行数:28,代码来源:ArticleStructs.cs


示例15: Parser

 /// <summary>
 /// Creates a new Parser instance
 /// </summary>
 /// <param name="dataProvider">The provider of the screen data</param>
 public Parser(IDataProvider dataProvider, ILocatorFinder locatorFinder = null, INameFinder nameFinder = null, params ITool[] tools)
 {
     this.dataProvider = dataProvider;
     this.locatorFinder = locatorFinder;
     this.nameFinder = nameFinder;
     this.tools = tools;
 }
开发者ID:TA-Gen,项目名称:TA-Gen,代码行数:11,代码来源:Parser.cs


示例16: VotingController

        public VotingController(IConferenceLoader conferenceLoader, IDataProvider dataProvider, IDnsLookup dnsLookup, IChartDataConverter chartDataConverter)
        {
            if (conferenceLoader == null)
            {
                throw new ArgumentNullException("conferenceLoader");
            }

            if (dataProvider == null)
            {
                throw new ArgumentNullException("dataProvider");
            }

            if (dnsLookup == null)
            {
                throw new ArgumentNullException("dnsLookup");
            }

            if (chartDataConverter == null)
            {
                throw new ArgumentNullException("chartDataConverter");
            }

            this.conferenceLoader = conferenceLoader;
            this.dataProvider = dataProvider;
            this.dnsLookup = dnsLookup;
            this.chartDataConverter = chartDataConverter;
        }
开发者ID:philpursglove,项目名称:DDDEastAnglia,代码行数:27,代码来源:VotingController.cs


示例17: SocketWriter

 public SocketWriter(IDataProvider Idp, Socket s)
 {
     SocketForClient = s;
     this.ns = new NetworkStream(s);
     this.Idp = Idp;
     Idp.DataChanged += new EventHandler(Idp_DataChanged);
 }
开发者ID:tordf,项目名称:CameraServer,代码行数:7,代码来源:SocketWriter.cs


示例18: ScanManager

 /// <summary>
 /// Initializes a new instance of the <see cref="ScanManager"/> class.
 /// </summary>
 /// <param name="storageProvider">
 /// The storage provider to use.
 /// </param>
 /// <param name="dataProvider">
 /// The data provider to use. 
 /// </param>
 internal ScanManager(IStorageProvider storageProvider, IDataProvider dataProvider)
 {
     this.storageProvider = storageProvider;
     this.dataProvider = dataProvider;
     this.settings = Settings.LoadSettings(storageProvider);
     this.tvShows = TvShow.GetTvShows(storageProvider).ToList();
 }
开发者ID:a-jackson,项目名称:tvsorter,代码行数:16,代码来源:ScanManager.cs


示例19: Run

        public TemplateCrawlResult Run(IDataProvider provider)
        {
            if (_phases.Count == 0)
            {
                String msg = "No phases configured for this template, aborting";
                throw new InvalidOperationException(msg);
            }

            Context.ParameterProvider = provider;

            RunInternal();

            TemplateCrawlResult result = new TemplateCrawlResult();
            result.JsonResult = _context.JsonResult;
            result.Succeed = true;

            // 如果存在Gecko浏览器则将它释放
            if (UseBrowser)
            {
                GeckoWebBrowser browser = (GeckoWebBrowser)Context.GetService(typeof(GeckoWebBrowser));
                if (browser != null)
                {
                    browser.Dispose();
                }
            }

            return result;
        }
开发者ID:TaikorInc,项目名称:FalcoA,代码行数:28,代码来源:GeneralTemplate.cs


示例20: MushroomRule

 public MushroomRule(IDataProvider dataProvider, int generacion, char classValue)
 {
     DataProvider = dataProvider;
     Generation = generacion;
     ClassValue = classValue;
     solution = null;
 }
开发者ID:jruano30,项目名称:FinalMetaheuristica,代码行数:7,代码来源:MushroomRule.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDataReader类代码示例发布时间:2022-05-24
下一篇:
C# IDataParameter类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap