mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Data bindings - Added the option for different data binding modes
This commit is contained in:
1 parent
906efdac98
commit
f270d786f0
32 files changed
+940
-497
No files matched your search
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
using Artemis.Storage.Migrations.Interfaces;
|
||||
using LiteDB;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
using Artemis.Storage.Migrations.Interfaces;
|
||||
using LiteDB;
|
||||
|
||||
namespace Artemis.Storage.Migrations
|
||||
{
|
||||
public class M5DataBindingTypes : IStorageMigration
|
||||
{
|
||||
public int UserVersion => 5;
|
||||
|
||||
public void Apply(LiteRepository repository)
|
||||
{
|
||||
var collection = repository.Database.GetCollection("ProfileEntity");
|
||||
foreach (var bsonDocument in collection.FindAll())
|
||||
{
|
||||
foreach (var bsonLayer in bsonDocument["Layers"].AsArray)
|
||||
{
|
||||
foreach (var bsonPropertyEntity in bsonLayer["PropertyEntities"].AsArray)
|
||||
bsonPropertyEntity["DataBindingEntities"].AsArray.Clear();
|
||||
}
|
||||
|
||||
foreach (var bsonLayer in bsonDocument["Folders"].AsArray)
|
||||
{
|
||||
foreach (var bsonPropertyEntity in bsonLayer["PropertyEntities"].AsArray)
|
||||
bsonPropertyEntity["DataBindingEntities"].AsArray.Clear();
|
||||
}
|
||||
|
||||
collection.Update(bsonDocument);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user