public void Build_Plugin_Finish(EngineState s, Dictionary <string, string> localVars) { if (s.DisableLogger) { return; } if (s.DelayedLogging) { DB.InsertAll(BuildLogPool); BuildLogPool.Clear(); } if (s.DisableLogger == false) { long buildId = s.BuildId; long pluginId = s.PluginId; // Plugins pluginDict.TryRemove(pluginId, out Tuple <DB_Plugin, Stopwatch> tuple); if (tuple == null) { throw new KeyNotFoundException($"Unable to find DB_Plugin Instance, id = {pluginId}"); } DB_Plugin dbPlugin = tuple.Item1; Stopwatch watch = tuple.Item2; watch.Stop(); dbPlugin.ElapsedMilliSec = watch.ElapsedMilliseconds; if (localVars != null) { List <DB_Variable> varLogs = new List <DB_Variable>(localVars.Count); foreach (var kv in localVars) { DB_Variable dbVar = new DB_Variable() { BuildId = buildId, PluginId = pluginId, Type = VarsType.Local, Key = kv.Key, Value = kv.Value, }; varLogs.Add(dbVar); // Fire Event VariableUpdated?.Invoke(this, new VariableUpdateEventArgs(dbVar)); } DB.InsertAll(varLogs); } DB.Update(dbPlugin); // Fire Event if (s.DelayedLogging) { PluginUpdated?.Invoke(this, new PluginUpdateEventArgs(dbPlugin)); } } }
private void ColorPickerDrawing_control_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs <Color?> e) { ColorPicker picker = (sender as ColorPicker); if (picker.SelectedColor == null) { picker.SelectedColor = Color.FromArgb(0, 0, 0, 0); } SetValue(VariableObjectProperty, Utils.ColorUtils.MediaColorToDrawingColor(picker.SelectedColor.Value)); VariableUpdated?.Invoke(this, VariableObject); }
public long Build_Init(EngineState s, string name) { if (s.DisableLogger) { return(0); } // Build Id DB_BuildInfo dbBuild = new DB_BuildInfo() { StartTime = DateTime.UtcNow, Name = name, }; DB.Insert(dbBuild); buildDict[dbBuild.Id] = dbBuild; s.BuildId = dbBuild.Id; // Fire Event BuildInfoUpdated?.Invoke(this, new BuildInfoUpdateEventArgs(dbBuild)); // Variables - Fixed, Global, Local List <DB_Variable> varLogs = new List <DB_Variable>(); foreach (VarsType type in Enum.GetValues(typeof(VarsType))) { Dictionary <string, string> dict = s.Variables.GetVarDict(type); foreach (var kv in dict) { DB_Variable dbVar = new DB_Variable() { BuildId = dbBuild.Id, Type = type, Key = kv.Key, Value = kv.Value, }; varLogs.Add(dbVar); // Fire Event VariableUpdated?.Invoke(this, new VariableUpdateEventArgs(dbVar)); } } DB.InsertAll(varLogs); System_Write(new LogInfo(LogState.Info, $"Build [{name}] started")); return(dbBuild.Id); }
public void EditVariable(Variable variable, string newName, double newValue) { variable.Name = newName; variable.Value = newValue; if (PendingVariables.Contains(variable)) { if (IsVariableValid(variable)) { PendingVariables.Remove(variable); Field.AddVariable(variable); } } else { if (!IsVariableValid(variable)) { Field.RemoveVariable(variable); PendingVariables.Add(variable); } } VariableUpdated?.Invoke(this, variable); }
private void Chkbx_control_VarChanged(object sender, RoutedEventArgs e) { SetValue(VariableObjectProperty, (sender as CheckBox).IsChecked.Value); VariableUpdated?.Invoke(this, VariableObject); }
private void Txtbx_control_TextChanged(object sender, TextChangedEventArgs e) { SetValue(VariableObjectProperty, (sender as TextBox).Text); VariableUpdated?.Invoke(this, VariableObject); }
private void IntUpDown_control_ValueChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { SetValue(VariableObjectProperty, (sender as IntegerUpDown).Value ?? 0); VariableUpdated?.Invoke(this, VariableObject); }
private void FloatUpDown_control_ValueChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { SetValue(VariableObjectProperty, (float)((sender as DoubleUpDown).Value ?? 0.0f)); VariableUpdated?.Invoke(this, VariableObject); }
private void ColorPickerMedia_control_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs <Color?> e) { SetValue(VariableObjectProperty, (sender as ColorPicker).SelectedColor.Value); VariableUpdated?.Invoke(this, VariableObject); }
private void keySequenceControlValueChanged(object sender, EventArgs e) { SetValue(VariableObjectProperty, ((Aurora.Controls.KeySequence)sender).Sequence); VariableUpdated?.Invoke(this, VariableObject); }
private void CmbbxEnum_control_SelectionChanged(object sender, SelectionChangedEventArgs e) { SetValue(VariableObjectProperty, (sender as ComboBox).SelectedValue); VariableUpdated?.Invoke(this, VariableObject); }
private void ColorPickerDrawing_control_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs <Color?> e) { SetValue(VariableObjectProperty, Utils.ColorUtils.MediaColorToDrawingColor((sender as ColorPicker).SelectedColor.Value)); VariableUpdated?.Invoke(this, VariableObject); }