Esempio n. 1
0
 public static bool TryReadVisibility(XmlReader reader, ContainerNode container)
 {
     if (reader.LocalName == ThemeNode.VisibleField) container.Visible = Convert.ToBoolean(reader.Value);
     else if (reader.LocalName == ContainerNode.MinScaleField) container.MinScale = double.Parse(reader.Value, NumberFormatInfo.InvariantInfo);
     else if (reader.LocalName == ContainerNode.MaxScaleField) container.MaxScale = double.Parse(reader.Value, NumberFormatInfo.InvariantInfo);
     else
         return false;
     return true;
 }
Esempio n. 2
0
        public virtual void MoveTo(ContainerNode destination, int index)
		{
            var oldParent = Node.Parent;
            if (oldParent != null)
                oldParent.Nodes.Remove(Node);
            else
                Debug.Fail("Parent is null before move");
            Debug.Assert(Node.Parent == null);
            Debug.Assert(CanMoveTo(destination, -1, index));
            
            destination.Nodes.Insert(index, Node);
            Debug.Assert(Node.Parent == destination);
        }
Esempio n. 3
0
        public override bool CanMoveTo(ContainerNode destination, int oldIndex, int newIndex)
		{
            if (destination is Case)
            {
                var prev = newIndex > 0 ? destination.Nodes[newIndex -1] : null;
                var next = newIndex < destination.Nodes.Count ? destination.Nodes[newIndex] : null;

                if(Node is Else)
                    return !(prev is Else) && next == null;
                else //when
                    return !(prev is Else);
            }
            return false;
		}
Esempio n. 4
0
 public override bool CanMoveTo(ContainerNode target, int oldIndex, int newIndex)
 {
     return false;
 }
Esempio n. 5
0
 public ContainerNodeWrapper(ContainerNode containerNode)
     :base(containerNode)
 {
     _containerNode = containerNode;
 }
Esempio n. 6
0
        public CaseItemWrapper(ContainerNode node)
            : base(node)
		{
		}
Esempio n. 7
0
        public virtual bool CanMoveTo(ContainerNode destination, int oldIndex, int newIndex)
		{
			return destination != null;
		}
Esempio n. 8
0
        private void TuneMap(ContainerNode layerGroup)
		{
			foreach (ThemeNode child in layerGroup.Nodes)
			{
                var childGroup = child as ContainerNode;
				if (childGroup != null)
					TuneMap(childGroup);
			}
			
			if (layerGroup.Visible = layerGroup.TotalFeatureCount > 0)
			{
				if ((layerGroup.BoundingBox != null) && (layerGroup.BoundingBox.Area > 0.0))
				{
				}
				if (layerGroup.AvgBoundingBoxArea > 0.0)
				{
					layerGroup.MinScale = 20.0 / Math.Sqrt(layerGroup.AvgBoundingBoxArea * 2.0);
				}
				else
				{
					layerGroup.MinScale = 1.0;
				}
				if (layerGroup.MinBoundingBoxArea > 0.0)
				{
					layerGroup.MinScale = Math.Max(layerGroup.MinScale, 1.0 / layerGroup.MinBoundingBoxArea);
				}
				if (layerGroup.MaxBoundingBoxArea > 0.0)
				{
					layerGroup.MaxScale = Math.Sqrt(layerGroup.MaxBoundingBoxArea * 2.0) * 10.0;
				}
			}
		}
Esempio n. 9
0
 public ContainerNodeRenderer(Renderer renderer, ContainerNode node, IBaseRenderer parent)
     : base(renderer, node, parent)
 {
     _containerNode = node;
     _containerNode.PropertyChanged += _containerNode_PropertyChanged;
 }
Esempio n. 10
0
        public override bool CanMoveTo(ContainerNode destination, int oldIndex, int newIndex)
		{
			return destination is Group;
		}