private void InitilizeDesigner() { // Instancition du designer _designer = new WorkflowDesigner(); // Récupération duservice de configuration var configurationService = _designer.Context.Services.GetService <DesignerConfigurationService>(); // Cibler le framework (voir constantes en haut de class) configurationService.TargetFrameworkName = new FrameworkName(FrameworkName, new Version(FrameworVersionMajor, FrameworVersionMinor)); // Activer toutes les nouvelles fonctionnalité du designer présentes de puis .net 4.5 configurationService.AutoConnectEnabled = true; configurationService.AutoSplitEnabled = true; configurationService.AutoSurroundWithSequenceEnabled = true; configurationService.BackgroundValidationEnabled = true; configurationService.LoadingFromUntrustedSourceEnabled = true; configurationService.MultipleItemsContextMenuEnabled = true; configurationService.MultipleItemsDragDropEnabled = true; configurationService.NamespaceConversionEnabled = true; configurationService.PanModeEnabled = true; configurationService.RubberBandSelectionEnabled = true; // fcontionnalité présentes à partir de .net 4.5 if (FrameworVersionMajor >= 4 && FrameworVersionMinor >= 5) { configurationService.AnnotationEnabled = true; } // Ajout du service de validation (liste d'erreurs) _validationErrorService = new ValidationErrorService(); _designer.Context.Services.Publish <IValidationErrorService>(_validationErrorService); }
public DesignerViewModel() { // Enregistrment des meta WF pour utiliser le designer new DesignerMetadata().Register(); // Instancition du designer _designer = new WorkflowDesigner(); // Récupération duservice de configuration var configurationService = _designer.Context.Services.GetService <DesignerConfigurationService>(); // Cibler le framework (voir constantes en haut de class) configurationService.TargetFrameworkName = new FrameworkName(FrameworkName, new Version(FrameworVersionMajor, FrameworVersionMinor)); // Activer toutes les nouvelles fonctionnalité du designer présentes de puis .net 4.5 configurationService.AutoConnectEnabled = true; configurationService.AutoSplitEnabled = true; configurationService.AutoSurroundWithSequenceEnabled = true; configurationService.BackgroundValidationEnabled = true; configurationService.LoadingFromUntrustedSourceEnabled = true; configurationService.MultipleItemsContextMenuEnabled = true; configurationService.MultipleItemsDragDropEnabled = true; configurationService.NamespaceConversionEnabled = true; configurationService.PanModeEnabled = true; configurationService.RubberBandSelectionEnabled = true; // fcontionnalité présentes à partir de .net 4.5 if (FrameworVersionMajor >= 4 && FrameworVersionMinor >= 5) { configurationService.AnnotationEnabled = true; } // Créer une zone de travail _designer.Load(new ActivityBuilder { Name = "Designer" }); // Ajout du service de validation (liste d'erreurs) _validationErrorService = new ValidationErrorService(); _designer.Context.Services.Publish <IValidationErrorService>(_validationErrorService); // Création de la toolbox _toolbox = new ToolboxControl(); // Activité de base AddToToolbox("Built In WF", typeof(Sequence).Assembly); _toolbox.Loaded += _toolbox_Loaded; }