상속: INamedResource, IPropertyProvider, ICloneable
예제 #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;
        }
예제 #2
0
파일: Layer.cs 프로젝트: Elof3/Treefrog
        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;
        }
예제 #3
0
 public static LevelLayerPresenter CreateTileLayerPresenter3(Layer layer, ILayerContext context)
 {
     return new TileGridLayerPresenter(context, layer as TileGridLayer);
 }
예제 #4
0
 private void BindLayerEvents(Layer layer)
 {
 }
예제 #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);
        }
예제 #6
0
 private void UnbindLayerEvents(Layer layer)
 {
 }
예제 #7
0
 public LevelLayerPresenter(ILayerContext layerContext, Layer layer)
 {
     _layerContext = layerContext;
     _layer = layer;
 }
예제 #8
0
 public LayerProperties (Layer parent)
     : base(_reservedPropertyNames)
 {
     _parent = parent;
 }
예제 #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);
        }
예제 #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; };
 }
예제 #11
0
        private void AddLayer(Layer layer)
        {
            LevelLayerPresenter layerp = LayerPresenterFactory.Default.Create(layer, this);

            _layerPresenters[layer.Uid] = layerp;
            _rootContentLayer.Layers.Add(layerp);
        }
예제 #12
0
 public static LevelLayerPresenter CreateObjectLayerPresenter(Layer layer, ILayerContext context)
 {
     return new ObjectLayerPresenter(context, layer as ObjectLayer);
 }
예제 #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);
        }