Esempio n. 1
0
        public static bool GetAttribute(MapNode node, out MapNode.Attribute attribute)
        {
            MapTree.AttributeSpec aspec = GetAttributeSpec(node.Tree);
            if (aspec != null)
            {
                if (node.GetAttribute(aspec, out attribute))
                {
                    return true;
                }
            }

            attribute = MapNode.Attribute.Empty;
            return false;
        }
Esempio n. 2
0
 internal IChange CreateChange(MapNode node, AttributeChangeEventArgs e)
 {
     switch(e.ChangeType)
     {
         case AttributeChange.Added:
             MapNode.Attribute att;
             node.GetAttribute(e.AttributeSpec, out att);
             return new AttributeAdd(node, att);
         case AttributeChange.Removed:
             return new AttributeDelete(node, new MapNode.Attribute(e.AttributeSpec, e.oldValue));
         case AttributeChange.ValueUpdated:
             return new AttributeUpdate(node, new MapNode.Attribute(e.AttributeSpec, e.oldValue));
         default:
             return null;
     }
 }