mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +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
@@ -0,0 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Artemis.Storage.Entities.Profile.DataBindings
|
||||
{
|
||||
public class ConditionalDataBindingEntity : IDataBindingModeEntity
|
||||
{
|
||||
public ConditionalDataBindingEntity()
|
||||
{
|
||||
Values = new List<DataBindingConditionValueEntity>();
|
||||
}
|
||||
|
||||
public List<DataBindingConditionValueEntity> Values { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Artemis.Storage.Entities.Profile.Conditions;
|
||||
|
||||
namespace Artemis.Storage.Entities.Profile.DataBindings
|
||||
{
|
||||
public class DataBindingConditionValueEntity
|
||||
{
|
||||
public string Value { get; set; }
|
||||
public DisplayConditionGroupEntity RootGroup { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,23 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Artemis.Storage.Entities.Profile.DataBindings
|
||||
{
|
||||
public class DataBindingEntity
|
||||
{
|
||||
public DataBindingEntity()
|
||||
{
|
||||
Modifiers = new List<DataBindingModifierEntity>();
|
||||
}
|
||||
|
||||
public string TargetExpression { get; set; }
|
||||
public Guid? SourceDataModelGuid { get; set; }
|
||||
public string SourcePropertyPath { get; set; }
|
||||
public int DataBindingMode { get; set; }
|
||||
public TimeSpan EasingTime { get; set; }
|
||||
public int EasingFunction { get; set; }
|
||||
|
||||
public List<DataBindingModifierEntity> Modifiers { get; set; }
|
||||
|
||||
public IDataBindingModeEntity DataBindingMode { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Artemis.Storage.Entities.Profile.DataBindings
|
||||
{
|
||||
public class DirectDataBindingEntity : IDataBindingModeEntity
|
||||
{
|
||||
public DirectDataBindingEntity()
|
||||
{
|
||||
Modifiers = new List<DataBindingModifierEntity>();
|
||||
}
|
||||
|
||||
public Guid? SourceDataModelGuid { get; set; }
|
||||
public string SourcePropertyPath { get; set; }
|
||||
|
||||
public List<DataBindingModifierEntity> Modifiers { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Artemis.Storage.Entities.Profile.DataBindings
|
||||
{
|
||||
public interface IDataBindingModeEntity
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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