Example #1
0
 public OverlayRenderCore(DynamicBrushForm form)
 {
     _form = form;
 }
Example #2
0
 public LocalPointerEventResponder(DynamicBrushForm form)
 {
     _form = form;
 }
        private void CommandCreateDynamicBrush()
        {
            if (CommandCanCreateDynamicBrush()) {
                using (DynamicBrushForm form = new DynamicBrushForm()) {
                    using (TilePoolListPresenter tilePoolList = new TilePoolListPresenter(_editor)) {
                        tilePoolList.BindTilePoolManager(_editor.Project.TilePoolManager);
                        form.BindTileController(tilePoolList);

                        foreach (TileBrush item in TileBrushManager.Brushes)
                            form.ReservedNames.Add(item.Name);

                        if (form.ShowDialog() == DialogResult.OK) {
                            if (TileBrushManager.DynamicBrushes.GetBrush(form.Brush.Uid) == null)
                                TileBrushManager.DynamicBrushes.Brushes.Add(form.Brush);

                            OnSyncTileBrushCollection(EventArgs.Empty);
                            SelectBrush(form.Brush.Uid);
                            OnTileBrushSelected(EventArgs.Empty);
                        }
                    }
                }
            }
        }
Example #4
0
 public LocalLayerContext(DynamicBrushForm form)
 {
     _form = form;
     _history = new CommandHistory();
     _annots = new ObservableCollection<Annotation>();
 }
        public void ActionEditBrush(Guid brushId)
        {
            TileBrush brush = TileBrushManager.GetBrush(brushId) as TileBrush;
            if (brush == null)
                return;

            if (brush is DynamicTileBrush) {
                using (DynamicBrushForm form = new DynamicBrushForm(brush as DynamicTileBrush)) {
                    using (TilePoolListPresenter tilePoolList = new TilePoolListPresenter(_editor)) {
                        tilePoolList.BindTilePoolManager(_editor.Project.TilePoolManager);
                        form.BindTileController(tilePoolList);

                        foreach (TileBrush item in TileBrushManager.Brushes)
                            if (item.Name != brush.Name)
                                form.ReservedNames.Add(item.Name);

                        if (form.ShowDialog() == DialogResult.OK) {
                            OnSyncTileBrushCollection(EventArgs.Empty);
                            SelectBrush(form.Brush.Uid);
                            OnTileBrushSelected(EventArgs.Empty);
                        }
                    }
                }
            }
            else if (brush is StaticTileBrush) {
                using (StaticBrushForm form = new StaticBrushForm(brush as StaticTileBrush)) {
                    using (TilePoolListPresenter tilePoolList = new TilePoolListPresenter(_editor)) {
                        tilePoolList.BindTilePoolManager(_editor.Project.TilePoolManager);
                        form.BindTileController(tilePoolList);

                        foreach (TileBrush item in TileBrushManager.Brushes)
                            if (item.Name != brush.Name)
                                form.ReservedNames.Add(item.Name);

                        if (form.ShowDialog() == DialogResult.OK) {
                            OnSyncTileBrushCollection(EventArgs.Empty);
                            SelectBrush(form.Brush.Uid);
                            OnTileBrushSelected(EventArgs.Empty);
                        }
                    }
                }
            }
        }