示例#1
0
        public void Draw()
        {
            if (RedrawMap)
            {
                if (!toggleSwitch_view.Checked)
                {
                    lastImage = core.OriginalMap.Draw(gridPanel.Width, gridPanel.Height);
                }
                else
                {
                    lastImage = core.CurrentMap.Draw(gridPanel.Width, gridPanel.Height);
                }

                RedrawMap = false;
            }

            Image image = lastImage.Clone() as Image;

            if (USelection != null && USelection.Attached)
            {
                image = USelection.Draw(gridPanel.Width, gridPanel.Height, image);
            }

            image = AreasManager.Draw(gridPanel.Width, gridPanel.Height, image);

            gridPanel.BackgroundImage = image;

            gridPanel.Refresh();
        }
示例#2
0
 private void button_invert_Click(object sender, EventArgs e)
 {
     if (USelection.InvertSelection())
     {
         ReDraw();
     }
     else
     {
         Logger.AppendText("No selection to invert.");
     }
 }
示例#3
0
        private void button_select_Click(object sender, EventArgs e)
        {
            if (!USelection.Attached)
            {
                USelection.Attach();
                button_select.FlatStyle = FlatStyle.Flat;
            }
            else
            {
                USelection.Dettach();

                button_select.FlatStyle = FlatStyle.Standard;
                ReDraw();
            }
        }
示例#4
0
        private void button_export_Click(object sender, EventArgs e)
        {
            List <Point> selectPoints = USelection.GetSelectedPoints();

            if (selectPoints.Count == 0)
            {
                Logger.AppendText("No selection, exporting entire solution.");
                APIClass.SaveMapFile(core.CurrentMap);
                core.ReloadLOG();
            }
            else
            {
                Logger.AppendText("Exporting solution.");
                APIClass.ExportSelection(core.CurrentMap, core.OriginalMap, selectPoints);
                core.ReloadLOG();
            }
        }
示例#5
0
        public UUCoder(IRenderer renderer)
        {
            this.mRenderer    = renderer;
            this.mCodeManager = new UCodeManager(this);

            this.mCodeRenderer     = new UCodeRenderer(this);
            this.mIntelligentSence = new UIntelligentSence(this);

            this.mLineNumber = new ULineNumber(this);

            this.mSelection = new USelection(this);

            this.mPluginManager = new UPluginManager(this);
            // 默认的插件,顺序不能变
            this.mPluginManager.AddPlugin(this.mSelection);        // 0
            this.mPluginManager.AddPlugin(this.mCodeRenderer);     // 1
            this.mPluginManager.AddPlugin(this.mIntelligentSence); // 2
            this.mPluginManager.AddPlugin(this.mLineNumber);       // 3

            this.mPluginManager.Initialize();
            this.mPluginManager.Reset();

            this.mIsBlankWindow = true;
        }
示例#6
0
        /*********************************************************************************/
        /******************--------------SELECTION---------------*************************/
        /*********************************************************************************/

        #region Selection

        private void button_clear_Click(object sender, EventArgs e)
        {
            USelection.ClearSelection();
            ReDraw();
        }