/// <summary> /// Export data from represented <see cref="Instance" /> by using given drawer. /// <remarks>Note that only instances which are forced to display are displayed in root of <see cref="MEFEditor.Drawing.DiagramCanvas" /></remarks>. /// </summary> /// <param name="drawer">The drawer.</param> protected override void draw(InstanceDrawer drawer) { var isComposed = Composed.Get(); drawer.PublishField("AssemblyPath", AssemblyPath); drawer.PublishField("Composed", Composed); var slot = drawer.AddSlot(); var context = CompositionContext.Get(); if (context != null) { foreach (var component in CompositionContext.Get().InputInstances) { var drawing = drawer.GetInstanceDrawing(component); drawing.SetProperty("Composed", isComposed.ToString()); slot.Add(drawing.Reference); } var compositionResult = CompositionResult.Get(); foreach (var point in compositionResult.Points) { var joinPoint = getConnector(point, drawer); } foreach (var join in compositionResult.Joins) { var fromPoint = getConnector(join.Export, drawer); var toPoint = getConnector(join.Import, drawer); var joinDefinition = drawer.DrawJoin(fromPoint, toPoint); //TODO set properties of joinDefinition } } drawer.ForceShow(); }
protected override void draw(InstanceDrawer drawer) { //přidáme definici slotu, ve kterém se budou //zobrazovat uložené instance var instanceSlot = drawer.AddSlot(); //vytvořený slot naplníme instancemi foreach (var instance in Instances.Value) { //pro každou instanci musíme získat reprezentaci //jejího zobrazení var instanceDrawing = drawer.GetInstanceDrawing(instance); //do slotu patří pouze reference na vytvořené zobrazení instanceSlot.Add(instanceDrawing.Reference); } //předáme informace které vypíšeme uživateli drawer.PublishField("message", Message); drawer.SetProperty("time", Watch.Value.ElapsedMilliseconds + "ms"); //vynutíme zobrazení této instance //ve schématu kompozice drawer.ForceShow(); }
/// <summary> /// Draws the specified services. /// </summary> /// <param name="services">The services.</param> protected override void draw(InstanceDrawer services) { services.PublishField("Import", Import); services.PublishField("PreImport", PreImport); services.ForceShow(); }
/// <summary> /// Draws the specified services. /// </summary> /// <param name="services">The services.</param> protected override void draw(InstanceDrawer services) { services.PublishField("Import", Import); services.SetProperty("ImportValue", Import.Value.Value.Wrapped.ToString()); services.ForceShow(); }
/// <summary> /// Draws the specified services. /// </summary> /// <param name="services">The services.</param> protected override void draw(InstanceDrawer services) { services.PublishField("TestProperty", TestProperty); services.ForceShow(); }