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; }
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; }
public static LevelLayerPresenter CreateTileLayerPresenter3(Layer layer, ILayerContext context) { return new TileGridLayerPresenter(context, layer as TileGridLayer); }
private void BindLayerEvents(Layer layer) { }
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); }
private void UnbindLayerEvents(Layer layer) { }
public LevelLayerPresenter(ILayerContext layerContext, Layer layer) { _layerContext = layerContext; _layer = layer; }
public LayerProperties (Layer parent) : base(_reservedPropertyNames) { _parent = parent; }
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); }
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; }; }
private void AddLayer(Layer layer) { LevelLayerPresenter layerp = LayerPresenterFactory.Default.Create(layer, this); _layerPresenters[layer.Uid] = layerp; _rootContentLayer.Layers.Add(layerp); }
public static LevelLayerPresenter CreateObjectLayerPresenter(Layer layer, ILayerContext context) { return new ObjectLayerPresenter(context, layer as ObjectLayer); }
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); }