Exemplo n.º 1
0
 public MarkdownToHtmlRenderer(MarkdownParser parser, ITokenizerFactory <IMdToken> tokenizer,
                               INodeRenderer nodeRenderer)
 {
     Parser       = parser;
     Tokenizer    = tokenizer;
     NodeRenderer = nodeRenderer;
     Modificators = new List <INodeVisitor>();
 }
Exemplo n.º 2
0
 public Converter(INodesProcessor nodesProcessor, IWaysProcessor waysProcessor, IRelationsProcessor relationsProcessor, IPolygonFeaturesLoader polygonFeaturesLoader, INodeRenderer nodeRenderer, IWaysRenderer waysRenderer, IRelationRenderer relationRenderer)
 {
     _nodesProcessor     = nodesProcessor;
     _waysProcessor      = waysProcessor;
     _relationsProcessor = relationsProcessor;
     _nodeRenderer       = nodeRenderer;
     _waysRenderer       = waysRenderer;
     _relationRenderer   = relationRenderer;
 }
Exemplo n.º 3
0
        protected override void OnNodePositionUpdating(object sender, EventArgs e)
        {
            INodeRenderer nodeRenderer = (INodeRenderer)sender;

            if (nodeRenderer != null)
            {
                CurrentView.RelationshipRenderers.UpdateRelationship(nodeRenderer);
            }
        }
Exemplo n.º 4
0
        public void RendererInsertClassInTags()
        {
            Renderer = new NodeHtmlRenderer(new HtmlRenderContext(
                                                new NodeToHtmlEntityConverter(new HtmlAttribute("class", "test"))
                                                ));
            var node = StrongModificator(Text("test"));

            Render(node).Should().Be(@"<strong class=""test"">test</strong>");
        }
Exemplo n.º 5
0
        public void RegisterNodeRenderer(INodeRenderer renderer)
        {
            var existing = renderers.FindIndex(x => x.Name == renderer.Name);

            if (existing >= 0)
            {
                renderers.RemoveAt(existing);
            }
            this.renderers.Add(renderer);
        }
Exemplo n.º 6
0
        private void SaveMediaInformation(string nodeId, string source, string markerName, TimeSpan position)
        {
            var                nodeRenderers = ViewManager.Nodes.Where(n => n.Node.Id.ToString() == nodeId);
            INodeRenderer      nodeRenderer  = nodeRenderers.First() as INodeRenderer;
            IMetadataTypeProxy timeSpanType  = TypeManager.GetMetadataType("timespan");
            IMetadataTypeProxy stringType    = TypeManager.GetMetadataType("string");

            Navigator.UpdateNodeMetadataAsync(nodeRenderer.Node, Guid.Empty, null, "Video." + markerName, position.ToString(), timeSpanType);
            Navigator.UpdateNodeMetadataAsync(nodeRenderer.Node, Guid.Empty, null, "Video.Source", source, stringType);
        }
Exemplo n.º 7
0
        public TimelineView(ITimelineModel model, INodeRenderer renderer)
        {
            m_model = model;
            m_renderer = renderer;

            foreach (INode node in m_model.Nodes)
            {
                Widget widget = m_renderer.Render(node);
                if (widget == null)
                    throw new NotImplementedException("Renderer returned null");
                widget.Show();
                Console.WriteLine("{0}, {1}", node.Position.X, node.Position.Y);
                Put(widget, (int) node.Position.X, (int) node.Position.Y);
            }
        }
Exemplo n.º 8
0
        public TimelineView(ITimelineModel model, INodeRenderer renderer)
        {
            m_model    = model;
            m_renderer = renderer;

            foreach (INode node in m_model.Nodes)
            {
                Widget widget = m_renderer.Render(node);
                if (widget == null)
                {
                    throw new NotImplementedException("Renderer returned null");
                }
                widget.Show();
                Console.WriteLine("{0}, {1}", node.Position.X, node.Position.Y);
                Put(widget, (int)node.Position.X, (int)node.Position.Y);
            }
        }
 public void RegisterSurface(INodeRenderer surface)
 {
     _registeredSurfaces.Add(surface);
 }
Exemplo n.º 10
0
        private void CompendiumMapDepthMap_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            _isLeftMouseButtonDown = false;
            INodeRenderer          nr  = ViewManager.GetNodeRenderer(_currentMousePosition);
            NodeRelationshipHelper nrh = IoC.IoCContainer.GetInjectionInstance().GetInstance <NodeRelationshipHelper>();

            if (nrh != null)
            {
                if (nrh.IsEditting)
                {
                    if (nr != null)
                    {
                        IRelationshipProxy originalRelationship = nrh.Relationship.DataContext as IRelationshipProxy;
                        _nodeService.DeleteRelationship(Navigator.DomainId, originalRelationship.Id);

                        IDescriptorTypeProxy toDescriptorTypeProxy       = _typeManager.GetDescriptorType("To");
                        IDescriptorTypeProxy fromDescriptorTypeProxy     = _typeManager.GetDescriptorType("From");
                        IDescriptorTypeProxy transMapDescriptorTypeProxy = _typeManager.GetDescriptorType("TransclusionMap");

                        Dictionary <IDescriptorTypeProxy, Guid> nodes = new Dictionary <IDescriptorTypeProxy, Guid>();
                        INodeProxy fromNode = null, toNode = null;

                        switch (nrh.EdittingSide)
                        {
                        case RelationshipSide.From:
                            fromNode = nr.Node;
                            toNode   = originalRelationship.Descriptors.GetByDescriptorTypeName("To").First().Node;

                            break;

                        case RelationshipSide.To:
                            fromNode = originalRelationship.Descriptors.GetByDescriptorTypeName("From").First().Node;
                            toNode   = nr.Node;

                            break;

                        default:
                            break;
                        }

                        nodes.Add(toDescriptorTypeProxy, toNode.Id);
                        nodes.Add(fromDescriptorTypeProxy, fromNode.Id);
                        IRelationshipTypeProxy relationshipTypeProxy = null;

                        if (fromNode.ParentMapNodeUid != this.Navigator.FocalNodeId || toNode.ParentMapNodeUid != this.Navigator.FocalNodeId)
                        {
                            nodes.Add(transMapDescriptorTypeProxy, this.Navigator.FocalNodeId);
                            relationshipTypeProxy = _typeManager.GetRelationshipType("TransclusionRelationship");
                        }
                        else
                        {
                            relationshipTypeProxy = _typeManager.GetRelationshipType("FromToRelationship");
                        }

                        _navigator.ConnectNodesAsync(nodes, relationshipTypeProxy, originalRelationship.Id.ToString());
                        _navigator.GetCurrentNodesAsync();
                    }
                    else
                    {
                        nrh.Relationship.UpdateArrow();
                    }
                }
                nrh.IsEditting = false;
            }

            if (_selectionRectangle != null)
            {
                this.uxMapSurface.Children.Remove(_selectionRectangle);
                double topLeftX     = (double)_selectionRectangle.GetValue(Canvas.LeftProperty);
                double topLeftY     = (double)_selectionRectangle.GetValue(Canvas.TopProperty);
                double bottomRightX = _selectionRectangle.Width + topLeftX;
                double bottomRightY = _selectionRectangle.Height + topLeftY;
                _selectionRectangle = null;
                if (!(Double.IsNaN(bottomRightX) && Double.IsNaN(bottomRightY)))
                {
                    ViewManager.SelectAllWithinBounds(new Point(topLeftX, topLeftY), new Point(bottomRightX, bottomRightY));
                }
                else
                {
                    ViewManager.UnselectAllNodes();
                    ViewManager.UnselectAllRelationships();
                }
            }
        }
Exemplo n.º 11
0
 public void RegisterSurface(INodeRenderer surface)
 {
     _registeredSurfaces.Add(surface);
 }
Exemplo n.º 12
0
 public void RegisterSurface(INodeRenderer surface)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 13
0
 public void RegisterSurface(INodeRenderer surface)
 {
     throw new NotImplementedException();
 }