Inheritance: System.Windows.Forms.Form
コード例 #1
0
ファイル: StaticBrushForm.cs プロジェクト: Elof3/Treefrog
 public LocalPointerEventResponder(StaticBrushForm form)
 {
     _form = form;
 }
コード例 #2
0
ファイル: StaticBrushForm.cs プロジェクト: Elof3/Treefrog
 public LocalLayerContext(StaticBrushForm form)
 {
     _form = form;
     _history = new CommandHistory();
     _annots = new ObservableCollection<Annotation>();
 }
コード例 #3
0
        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)) {
                    PresenterManager manager = new PresenterManager();
                    manager.Register<EditorPresenter>(_editor);

                    using (TilePoolListPresenter tilePoolList = new TilePoolListPresenter()) {
                        tilePoolList.Initialize(manager);
                        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)) {
                    PresenterManager manager = new PresenterManager();
                    manager.Register<EditorPresenter>(_editor);

                    using (TilePoolListPresenter tilePoolList = new TilePoolListPresenter()) {
                        tilePoolList.Initialize(manager);
                        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);
                        }
                    }
                }
            }
        }
コード例 #4
0
        private void CommandCreateStaticBrush()
        {
            if (CommandCanCreateStaticBrush()) {
                using (StaticBrushForm form = new StaticBrushForm()) {
                    PresenterManager manager = new PresenterManager();
                    manager.Register<EditorPresenter>(_editor);

                    using (TilePoolListPresenter tilePoolList = new TilePoolListPresenter()) {
                        tilePoolList.Initialize(manager);
                        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.StaticBrushCollections.Count(c => c.GetBrush(form.Brush.Uid) != null) == 0)
                                TileBrushManager.DefaultStaticBrushCollection.Brushes.Add(form.Brush);

                            OnSyncTileBrushCollection(EventArgs.Empty);
                            SelectBrush(form.Brush.Uid);
                            OnTileBrushSelected(EventArgs.Empty);
                        }
                    }
                }
            }
        }
コード例 #5
0
 public LocalPointerEventResponder(StaticBrushForm form)
 {
     _form = form;
 }
コード例 #6
0
 public LocalLayerContext(StaticBrushForm form)
 {
     _form    = form;
     _history = new CommandHistory();
     _annots  = new ObservableCollection <Annotation>();
 }