Inheritance: INamedResource, IPropertyProvider, ICloneable
Ejemplo n.º 1
0
        protected Layer (string name, Layer layer)
            : this(name)
        {
            foreach (Property prop in layer._properties) {
                _properties.Add(prop.Clone() as Property);
            }

            _opacity = layer._opacity;
            _visible = layer._visible;
            _rasterMode = layer._rasterMode;
        }
Ejemplo n.º 2
0
        protected Layer (string name, Layer layer)
            : this(name)
        {
            foreach (Property prop in layer._propertyManager.CustomProperties) {
                _propertyManager.CustomProperties.Add(prop.Clone() as Property);
            }

            _opacity = layer._opacity;
            _visible = layer._visible;
            _rasterMode = layer._rasterMode;
            _gridWidth = layer._gridWidth;
            _gridHeight = layer._gridHeight;
            _gridColor = layer._gridColor;
        }
Ejemplo n.º 3
0
 public static LevelLayerPresenter CreateTileLayerPresenter3(Layer layer, ILayerContext context)
 {
     return new TileGridLayerPresenter(context, layer as TileGridLayer);
 }
Ejemplo n.º 4
0
 private void BindLayerEvents(Layer layer)
 {
 }
Ejemplo n.º 5
0
        private void AddLayer(Layer layer)
        {
            LevelLayerPresenter layerp = LayerPresenterFactory.Default.Create(layer, this);
            layerp.Info = _info;

            _layerPresenters[layer.Uid] = layerp;
            _rootContentLayer.Layers.Add(layerp);

            //BindingHelper.TryBind<TilePoolListPresenter>(layerp, _editor.Presentation.TilePoolList);
            //BindingHelper.TryBind<TileBrushManagerPresenter>(layerp, _editor.Presentation.TileBrushes);
            //BindingHelper.TryBind<ObjectPoolCollectionPresenter>(layerp, _editor.Presentation.ObjectPoolCollection);

            BindingHelper.TryBindAny(layerp, _pm.Select(kv => new KeyValuePair<Type, object>(kv.Key, kv.Value)));

            BindLayerEvents(layer);
        }
Ejemplo n.º 6
0
 private void UnbindLayerEvents(Layer layer)
 {
 }
Ejemplo n.º 7
0
 public LevelLayerPresenter(ILayerContext layerContext, Layer layer)
 {
     _layerContext = layerContext;
     _layer = layer;
 }
Ejemplo n.º 8
0
 public LayerProperties (Layer parent)
     : base(_reservedPropertyNames)
 {
     _parent = parent;
 }
Ejemplo n.º 9
0
        private void RenameLayer(Layer layer, Property property)
        {
            AttachEvents(layer);

            layer.NameChanged += (s, e) =>
            {
                Assert.AreEqual("layer", e.OldName);
                Assert.AreEqual("tiles", e.NewName);
                Assert.AreEqual(e.NewName, layer.Name);
            };

            Assert.NotNull(property);
            Assert.AreEqual("layer", layer.Name);

            property.Parse("tiles");

            property = layer.LookupProperty("Name");
            Assert.NotNull(property);
            Assert.AreEqual("tiles", property.ToString());

            Assert.AreEqual(EventFlags.NameChanged, _eventsFired);
        }
Ejemplo n.º 10
0
 private void AttachEvents(Layer layer)
 {
     layer.Modified += (s, e) => { _eventsFired |= EventFlags.Modified; };
     layer.NameChanged += (s, e) => { _eventsFired |= EventFlags.NameChanged; };
     layer.OpacityChanged += (s, e) => { _eventsFired |= EventFlags.OpacityChanged; };
     layer.VisibilityChanged += (s, e) => { _eventsFired |= EventFlags.VisibilityChanged; };
 }
Ejemplo n.º 11
0
        private void AddLayer(Layer layer)
        {
            LevelLayerPresenter layerp = LayerPresenterFactory.Default.Create(layer, this);

            _layerPresenters[layer.Uid] = layerp;
            _rootContentLayer.Layers.Add(layerp);
        }
Ejemplo n.º 12
0
 public static LevelLayerPresenter CreateObjectLayerPresenter(Layer layer, ILayerContext context)
 {
     return new ObjectLayerPresenter(context, layer as ObjectLayer);
 }
Ejemplo n.º 13
0
        private void AddLayer(Layer layer)
        {
            LevelLayerPresenter layerp = LayerPresenterFactory.Default.Create(layer, this);
            layerp.Info = _info;

            _layerPresenters[layer.Uid] = layerp;
            _rootContentLayer.Layers.Add(layerp);

            BindingHelper.TryBind<ITilePoolListPresenter>(layerp, _editor.Presentation.TilePoolList);
            BindingHelper.TryBind<ITileBrushManagerPresenter>(layerp, _editor.Presentation.TileBrushes);
            BindingHelper.TryBind<IObjectPoolCollectionPresenter>(layerp, _editor.Presentation.ObjectPoolCollection);

            BindLayerEvents(layer);
        }