private void InsertAndSavePreset(OperatorPreset newPreset) { PresetImageManager.RenderAndSaveThumbnail(newPreset); AddPreset(newPreset, 0); FindAndShowPresetsForSelectedOp(); SaveAllPresets(); }
public void RerenderThumbnails() { PresetImageManager.ReleasePreviousImages(); var keepList = CurrentOperatorPresets.ToArray(); CurrentOperatorPresets.Clear(); // We rebuild the list to trigger update notification of the observable collection foreach (var preset in keepList) { PreviewPreset(preset); if (!LivePreviewEnabled) { PresetImageManager.RenderAndSaveThumbnail(preset); } else { PresetImageManager.RenderImageForPreset(preset); } RestorePreviewPreset(); CurrentOperatorPresets.Add(preset); } }
/** Called when pressing the "save local preset"-button in preview region of parameter view */ public void SavePresetFromCurrentlyShownOperatorInstance() { var newPreset = TryToCreatePresetFromCurrentOperator(); if (newPreset == null) { return; } var op = App.Current.MainWindow.XParameterView.ShownOperator; // todo: remove access to parameter view! if (op == null) { return; } newPreset.IsInstancePreset = true; newPreset.OperatorInstanceID = op.ID; PresetImageManager.RenderAndSaveThumbnail(newPreset); InsertAndSavePreset(newPreset); }