1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
| using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Workflow.ComponentModel.Design;
namespace WorkflowDesigner.Workflow
{
internal class WorkflowLoader : WorkflowDesignerLoader
{
public override string FileName
{
get {
return string.Empty;
}
}
public override System.IO.TextReader GetFileReader(string filePath)
{
return null;
}
public override System.IO.TextWriter GetFileWriter(string filePath)
{
return null;
}
protected override void
PerformLoad(System.ComponentModel.Design.Serialization.IDesignerSerializationManager
serializationManager)
{
base.PerformLoad(serializationManager);
//Obtention du designer associé à ce loader
IDesignerHost designerHost = (IDesignerHost)GetService(typeof(IDesignerHost));
if (designerHost == null)
throw new Exception("Impossible d'obtenir le service de design");
Activity rootActivity = new SequentialWorkflowActivity();
designerHost.Container.Add(rootActivity, "root");
designerHost.Activate();
}
}
} |
Partager