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


C# IDataConnector类代码示例

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


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

示例1: ClearRestorePoint

 public void ClearRestorePoint(IDataConnector genericData)
 {
     foreach (var s in Schema)
     {
         DeleteTempVersion(genericData, s.Name);
     }
 }
开发者ID:VirtualReality,项目名称:Universe,代码行数:7,代码来源:Migrator.cs

示例2: Validate

        public bool Validate(IDataConnector genericData)
        {
            if (genericData.GetUniverseVersion (MigrationName) != Version)
                return false;

            return DoValidate(genericData);
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:7,代码来源:Migrator.cs

示例3: FinishedMigration

        public override void FinishedMigration(IDataConnector genericData)
        {
            if (!genericData.TableExists("estates")) return;
            DataReaderConnection dr = genericData.QueryData("WHERE `Key` = 'EstateID'", "estates",
                                                            "`ID`, `Key`, `Value`");

            if (dr != null)
            {
                try
                {
                    while (dr.DataReader.Read())
                    {
                        try
                        {
                            UUID ID = UUID.Parse(dr.DataReader["ID"].ToString());
                            string value = dr.DataReader["Value"].ToString();
                            QueryFilter filter = new QueryFilter();
                            filter.andFilters["`ID`"] = value;
                            filter.andFilters["`Key`"] = "EstateSettings";
                            List<string> results = genericData.Query(new string[1] {"`Value`"}, "estates", filter, null,
                                                                     null, null);
                            if ((results != null) && (results.Count >= 1))
                            {
                                EstateSettings es = new EstateSettings();
                                es.FromOSD((OSDMap) OSDParser.DeserializeLLSDXml(results[0]));
                                genericData.Insert("estateregions", new object[] {ID, value});

                                filter = new QueryFilter();
                                filter.andFilters["`EstateID`"] = value;

                                List<string> exist = genericData.Query(new string[1] {"`EstateID`"}, "estatesettings",
                                                                       filter, null, null, null);
                                if (exist == null || exist.Count == 0)
                                {
                                    genericData.Insert("estatesettings",
                                                       new object[]
                                                           {
                                                               value, es.EstateName, es.EstateOwner, es.ParentEstateID,
                                                               es.ToOSD()
                                                           });
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                }
                catch
                {
                }
                finally
                {
                    dr.DataReader.Close();
                    genericData.CloseDatabase(dr);
                    dr.Dispose ();
                }
            }
        }
开发者ID:EnricoNirvana,项目名称:WhiteCore-Dev,代码行数:59,代码来源:EstateMigrator_1.cs

示例4: Validate

 public bool Validate(DataSessionProvider sessionProvider, IDataConnector genericData)
 {
     if (genericData.GetAuroraVersion() != Version)
     {
         return false;
     }
     return DoValidate(sessionProvider, genericData);
 }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:8,代码来源:Migrator.cs

示例5: Validate

 public bool Validate(IDataConnector genericData)
 {
     if (genericData.GetAuroraVersion(MigrationName) != Version)
     {
         return false;
     }
     return DoValidate(genericData);
 }
开发者ID:savino1976,项目名称:Aurora-Sim,代码行数:8,代码来源:Migrator.cs

示例6: Load

        public override void Load(IDataConnector conn)
        {
            using (var sb = new SQLiteQueryBuilder(Plugin.SQLSafeName))
            {
                sb.SelectAll(TableDefinition.TableName);

                _data = conn.ExecuteArray<UserPermisison>(sb);
            }

            ProgramLog.Error.Log(this.GetType().Name + ": " + (_data == null ? "NULL" : _data.Length.ToString()));
        }
开发者ID:skylord123,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:11,代码来源:UserPermissions.cs

示例7: SetConnector

 public static void SetConnector(IDataConnector connector, bool throwWhenSet = true)
 {
     lock (_sync)
     {
         if (_connector != null && throwWhenSet)
         {
             throw new InvalidOperationException(String.Format("Attempted to load '{0}' when a '{1}' was already loaded", connector.ToString(), _connector.ToString()));
         }
         _connector = connector;
     }
 }
开发者ID:claudiofreda,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:11,代码来源:IDataConnector.cs

示例8: MigrationManager

 public MigrationManager(DataSessionProvider sessionProvider, IDataConnector genericData)
 {
     this.sessionProvider = sessionProvider;
     this.genericData = genericData;
     migrators.Add(new AuroraMigrator_2010_03_13());
     migrators.Add(new AuroraMigrator_2010_11_4());
     migrators.Add(new AuroraMigrator_2010_12_30());
     migrators.Add(new AuroraMigrator_2011_1_15());
     migrators.Add(new AuroraMigrator_2011_1_16());
     migrators.Add(new AuroraMigrator_2011_1_20());
     migrators.Add(new AuroraMigrator_2011_1_28());
     migrators.Add(new AuroraMigrator_2011_2_1());
 }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:13,代码来源:MigrationManager.cs

示例9: MigrationManager

        public MigrationManager(IDataConnector genericData, string migratorName, bool validateTables)
        {
            this.genericData = genericData;
            this.migratorName = migratorName;
            this.validateTables = validateTables;
            List<IMigrator> allMigrators = UniverseModuleLoader.PickupModules<IMigrator>();

            foreach (
                IMigrator m in allMigrators.Where(m => m.MigrationName != null).Where(m => m.MigrationName == migratorName))
            {
                migrators.Add((Migrator) m);
            }
        }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:13,代码来源:MigrationManager.cs

示例10: MigrationManager

        public MigrationManager(IDataConnector genericData, string migratorName, bool validateTables)
        {
            this.genericData = genericData;
            this.migratorName = migratorName;
            this.validateTables = validateTables;
            List<IMigrator> allMigrators = Aurora.Framework.AuroraModuleLoader.PickupModules<IMigrator>();
            foreach (IMigrator m in allMigrators)
            {
                if (m.MigrationName == null)
                    continue;
                if (m.MigrationName == migratorName)
                    migrators.Add((Migrator)m);

            }
        }
开发者ID:NickyPerian,项目名称:Aurora-Sim,代码行数:15,代码来源:MigrationManager.cs

示例11: DefaultTaskViewModel

        /// <summary>
        /// Constructor of the class
        /// </summary>
        /// <param name="taskModel"></param>
        /// <param name="targetList"></param>
        /// <param name="dataConnector"></param>
        /// <param name="mainPage"></param>
        /// <param name="state"></param>
        public DefaultTaskViewModel(ITaskModel taskModel, ObservableCollection<ITaskViewModel> targetList, IDataConnector dataConnector, MainPage mainPage, TaskState state)
        {
            TaskModel = taskModel;
            _targetList = targetList;
            _dataConnector = dataConnector;
            ItemVisualWidth = mainPage.ActualWidth;

            // Commands
            Break = new ViewModelCommand()
            {
                Command = new RelayCommand(r => BreakTask()),
                Text = "Break"
            };

            PunchOut = new ViewModelCommand
            {
                Command = new RelayCommand(r => FinishTask()),
                Text = "Finished",
                ImagePath = @"Images/finish.png"
            };

            DeleteFromList = new ViewModelCommand
            {
                Command = new RelayCommand(
                    r =>
                    {
                        if (targetList != null && targetList.Contains(this))
                        {
                            targetList.Remove(this);
                            _dataConnector.DeleteTask(taskModel.Id);
                        }
                    }),
                Text = "Delete",
                ImagePath = "Images/delete.png"
            };

            // Timer Init
            _timer = new DispatcherTimer();
            _timer.Tick += timer_Tick;
            _timer.Interval = TimeSpan.FromSeconds(1);
            _timer.Start();

            // Setstate
            State = state;
            _initLoad = false;
        }
开发者ID:nhammerl,项目名称:TaskTimeRecorder,代码行数:54,代码来源:DefaultTaskViewModel.cs

示例12: MigrationManager

        public MigrationManager(IDataConnector genericData, string migratorName, bool validateTables)
        {
            this.genericData = genericData;
            this.migratorName = migratorName;
            this.validateTables = validateTables;
            List<IMigrator> allMigrators = AuroraModuleLoader.PickupModules<IMigrator>();
#if (!ISWIN)
            foreach (IMigrator m in allMigrators)
            {
                if (m.MigrationName != null)
                {
                    if (m.MigrationName == migratorName)
                    {
                        migrators.Add((Migrator)m);
                    }
                }
            }
#else
            foreach (IMigrator m in allMigrators.Where(m => m.MigrationName != null).Where(m => m.MigrationName == migratorName))
            {
                migrators.Add((Migrator) m);
            }
#endif
        }
开发者ID:Gnu32,项目名称:Silverfin,代码行数:24,代码来源:MigrationManager.cs

示例13: Save

 public override void Save(IDataConnector conn)
 {
     throw new NotImplementedException();
 }
开发者ID:Narkun,项目名称:Terraria-s-Dedicated-Server-Mod,代码行数:4,代码来源:GroupPermissions.cs

示例14: TestThatAllTablesValidate

 protected bool TestThatAllTablesValidate(IDataConnector genericData)
 {
     foreach (var s in schema)
     {
         if (!genericData.VerifyTableExists(s.X1, s.X2))
         {
             return false;
         }
     }
     return true;
 }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:11,代码来源:Migrator.cs

示例15: EnsureAllTablesInSchemaExist

 protected void EnsureAllTablesInSchemaExist(IDataConnector genericData)
 {
     foreach (var s in schema)
     {
         genericData.EnsureTableExists(s.X1, s.X2);
     }
 }
开发者ID:NickyPerian,项目名称:Aurora,代码行数:7,代码来源:Migrator.cs


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