コード例 #1
0
        // TODO: FIX
        private void ImagePanel_SelectedIconsChanged(object sender, EventArgs e)
        {
            IImagePanel imagePanel = (IImagePanel)sender;
            string      imageKey   = View.ImagePanels[imagePanel];

            if (LastSelectedFrames.ContainsKey(imageKey) && Originals.ContainsKey(imageKey))
            {
                foreach (int frame in LastSelectedFrames[imageKey].Except(imagePanel.SelectedIcons))
                {
                    if (frame < Repository[imageKey].Count && frame < Originals[imageKey].Count)
                    {
                        Originals[imageKey][frame].EndPixelWorking();
                        Originals[imageKey][frame].CloneTo(Repository[imageKey][frame]);
                    }
                }
            }

            if (LastSelectedFrames.ContainsKey(imageKey))
            {
                LastSelectedFrames[imageKey] = imagePanel.SelectedIcons;
            }
            else
            {
                LastSelectedFrames.Add(imageKey, imagePanel.SelectedIcons);
            }

            IToolPanel toolPanel    = View.ToolPanels.SelectedPanel;
            object     selectedTool = toolPanel?.SelectedTool;

            if (selectedTool is ICustomFramesSupport && TuningCondition())
            {
                ToolPanel_Tuning(toolPanel, e);
            }
        }
コード例 #2
0
        private void ImagePanel_SelectedAreaChanged(object sender, EventArgs e)
        {
            IToolPanel toolPanel = View.ToolPanels.SelectedPanel;
            object     tool      = toolPanel?.SelectedTool;

            if (tool is ICustomAreaSupport && TuningCondition())
            {
                ToolPanel_Tuning(toolPanel, e);
            }
        }
コード例 #3
0
ファイル: DBClickDockTab.cs プロジェクト: zyouhua/weilai
        public override void _runCommand()
        {
            IDockPanel dockPanel_ = this._getOwner() as IDockPanel;
            IForm      form_      = dockPanel_._contain() as IForm;
            IToolPanel toolPanel_ = form_._childControl("toolPanel") as IToolPanel;

            if (dockPanel_._padsInHide() && toolPanel_._inHide())
            {
                toolPanel_._runShow();
            }
            else
            {
                dockPanel_._padsHide();
                toolPanel_._runHide();
            }
        }
コード例 #4
0
        private void panelFocused(object sender, PanelActionEventArgs args)
        {
            if (args.Panel.Content is IDocumentPanel || args.Panel.Content is WelcomePage)
            {
                mostRecentDocumentPanel      = args.Panel.Content as IDocumentPanel;
                mostRecentDocumentTabControl = args.TabControl;
            }
            else if (args.Panel.Content is IToolPanel)
            {
                mostRecentToolPanel      = args.Panel.Content as IToolPanel;
                mostRecentToolTabControl = args.TabControl;
            }

            if (args.Panel.Content is ISceneEditor)
            {
                var editor = args.Panel.Content as ISceneEditor;
                SceneExplorer.Scene = editor.Scene;
            }
        }
コード例 #5
0
        private void ToolPanel_SelectedToolChanged(object sender, EventArgs e)
        {
            IToolPanel toolPanel = (IToolPanel)sender;
            object     tool      = toolPanel.SelectedTool;

            ICustomFramesSupport framesSupport = tool as ICustomFramesSupport;
            ICustomAreaSupport   areaSupport   = tool as ICustomAreaSupport;
            ITunerSupport        tunerSupport  = tool as ITunerSupport;

            toolPanel.SetTuner(tunerSupport?.Tuner);

            foreach (IImagePanel imagePanel in View.ImagePanels)
            {
                imagePanel.MultiSelection = framesSupport != null;
                imagePanel.AreaSelection  = areaSupport != null;
            }

            foreach (string imageKey in Originals.Keys)
            {
                Originals[imageKey].CloneTo(Repository[imageKey]);
                Repository.OnItemChanged(imageKey);
            }
        }