Implement Cue Properties Updating

This commit is contained in:
Joel Wetzell
2020-06-19 19:02:05 -05:00
parent f6c1cdf70a
commit 60e43e4193
11 changed files with 49 additions and 90 deletions
+17 -3
View File
@@ -22,6 +22,8 @@ namespace QSharp
public bool ignoreUpdates;
public event QCuePropertiesUpdatedHandler CuePropertiesUpdated;
public QCue()
{
init();
@@ -540,6 +542,7 @@ namespace QSharp
//TODO
JObject dictObj = (JObject)dict;
List<string> propertiesUpdated = new List<string>();
foreach (var obj in dictObj)
{
JToken value = obj.Value;
@@ -553,16 +556,17 @@ namespace QSharp
{
bool didSetProptery = setProperty(value, obj.Key, false);
if (didSetProptery)
{
cueUpdated = true;
propertiesUpdated.Add(obj.Key);
}
}
}
if (!cueUpdated)
return false;
Log.Debug($"[cue] <{nonEmptyName}> has been updated.");
//something about notifying cueUpdated ? OnCueUpdated event handler maybe?
OnCuePropertiesUpdated(propertiesUpdated);
return true;
}
@@ -820,6 +824,16 @@ namespace QSharp
#endregion
#region Event Handling
void OnCuePropertiesUpdated(List<string> properties)
{
Log.Debug($"[cue] <{nonEmptyName}> properties have been updated.");
CuePropertiesUpdated?.Invoke(this, new QCuePropertiesUpdatedArgs { properties = properties });
}
#endregion
#region Printing
public void Print()
{