本文整理汇总了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);
}
}
示例2: Validate
public bool Validate(IDataConnector genericData)
{
if (genericData.GetUniverseVersion (MigrationName) != Version)
return false;
return DoValidate(genericData);
}
示例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 ();
}
}
}
示例4: Validate
public bool Validate(DataSessionProvider sessionProvider, IDataConnector genericData)
{
if (genericData.GetAuroraVersion() != Version)
{
return false;
}
return DoValidate(sessionProvider, genericData);
}
示例5: Validate
public bool Validate(IDataConnector genericData)
{
if (genericData.GetAuroraVersion(MigrationName) != Version)
{
return false;
}
return DoValidate(genericData);
}
示例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()));
}
示例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;
}
}
示例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());
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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
}
示例13: Save
public override void Save(IDataConnector conn)
{
throw new NotImplementedException();
}
示例14: TestThatAllTablesValidate
protected bool TestThatAllTablesValidate(IDataConnector genericData)
{
foreach (var s in schema)
{
if (!genericData.VerifyTableExists(s.X1, s.X2))
{
return false;
}
}
return true;
}
示例15: EnsureAllTablesInSchemaExist
protected void EnsureAllTablesInSchemaExist(IDataConnector genericData)
{
foreach (var s in schema)
{
genericData.EnsureTableExists(s.X1, s.X2);
}
}