void IConfigurationControl.Initialize(ConfigurationManager configManager, ConfigurationTreeItem configTreeItem)
        {
            ConfigManager = configManager;
            ConfigTreeItem = configTreeItem;

            NodeSelectionManager = new NodeSelectionManager(uiNodePropertiesContainer, ConfigManager);

            Messageflow = ConfigManager.Configuration.GetMessageFlow();
            MessageflowGraphPresenter = new MessageflowGraphPresenter(Messageflow, NodeSelectionManager);
            NodeSelectionManager.MessageflowGraphPresenter = MessageflowGraphPresenter;
            
            graphCanvas = MessageflowGraphPresenter.CreateGraphCanvas();
            uiDesignerContainer.Child = graphCanvas;
            uiDesignerContainer.ContextMenu = CreateGraphCanvasContextMenu();

            PrepareLayoutConfiguration();
        }
Ejemplo n.º 2
0
        public Node(IInternalNodePresenter preseneter, GraphCanvas graphCanvas, object nodeObject)
        {
            Presenter = preseneter;
            GraphCanvas = graphCanvas;
            NodeObject = nodeObject;

            ContentControl border = new ContentControl();
            border.Content = Presenter.Content;

            UIFrame = border;
            Canvas.SetZIndex(UIFrame, Presenter.ZIndex);

            #region Prepare dragging
            dragArea = Presenter.DragArea;
            if (dragArea == null) {
                dragArea = UIFrame;
            }
            dragArea.MouseLeftButtonDown += DragArea_MouseLeftButtonDown;
            dragArea.MouseMove += DragArea_MouseMove;
            dragArea.MouseLeftButtonUp += DragArea_MouseLeftButtonUp;
            #endregion
        }
        private void uiImport_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.Filter = "Messageflow configuration|*.xmf";
            dialog.DefaultExt = ".xmf";
            dialog.CheckFileExists = true;
            if (dialog.ShowDialog() == true) {
                using (var fs = new FileStream(dialog.FileName, FileMode.Open)) {
                    Messageflow = MessageFlowConfiguration.Read(fs);
                }
                NodeSelectionManager = new NodeSelectionManager(uiNodePropertiesContainer, ConfigManager);
                uiNodePropertiesContainer.Child = null;
                MessageflowGraphPresenter = new MessageflowGraphPresenter(Messageflow, NodeSelectionManager);
                NodeSelectionManager.MessageflowGraphPresenter = MessageflowGraphPresenter;
                graphCanvas = MessageflowGraphPresenter.CreateGraphCanvas();
                uiDesignerContainer.Child = graphCanvas;

                PrepareLayoutConfiguration();
            }
        }