Exemplo n.º 1
0
        private void dataGridView2_MouseDown(object sender, MouseEventArgs e)
        {
            if (dataGridView2.SelectedRows.Count < 1)
            {
                return;
            }

            Data.MvPart     part   = new Data.MvPart(dataGridView2.SelectedRows[0]);
            DragDropEffects effect = DoDragDrop(part, DragDropEffects.Copy);
        }
Exemplo n.º 2
0
        private void panel_Graphics_DragDrop(object sender, DragEventArgs e)
        {
            if (!e.Data.GetDataPresent(typeof(Data.MvPart)))
            {
                return;
            }

            Data.MvPart part = e.Data.GetData(typeof(Data.MvPart)) as Data.MvPart;
            if (part == null)
            {
                return;
            }

            Point point = panel_Graphics.PointToClient(new Point(e.X, e.Y));

            point = GetCurrentLocation(point.X, point.Y);

            string type    = comboBox2.Text;
            int    variant = (int)panel_Symbol.Tag;


            using (UndoStep undoStep = new UndoManager().CreateUndoStep())
            {
                string   name3     = string.Empty;
                Function function1 = null;
                Function function3 = null;
                Function functiond = null;

                function1 = Util.eplan.GetBoxedDevice(this._singleline.Page, point);
                if (function1 == null)
                {
                    function1 = Util.eplan.AddSinglelineSymbol(_singleline, type, part.PartNr, point, variant);
                    function1.IsMainFunction = false;

                    name3     = function1.Name.ToUpper().Replace("+G-", "+R-");
                    function3 = Util.eplan.AddThreelineSymbol(_threeline, name3, part.PartNr, variant);
                    if (function3 == null)
                    {
                        MessageBox.Show("ERROR: Threeline에 심볼을 추가하지 못했습니다:" + name3);
                        return;
                    }

                    //if (this.MvProject.IsShip)
                    //{
                    //    functiond = Util.eplan.AddDoorArrangeSymbol(this.MvProject.Project, function1.Name, part.PartNr, 0);
                    //}
                }

                name3     = function1.Name.ToUpper().Replace("+G-", "+R-");
                function3 = Util.eplan.RemoveARFromThreeline(_threeline, name3);
                if (function3 == null)
                {
                    MessageBox.Show("ERROR: Threeline에서 심볼을 찾지 못했습니다:" + name3);
                }
                else
                {
                    function3 = Util.eplan.AddArticleReference(function3, part.PartNr, 0);
                }

                if (this.MvProject.IsShip)
                {
                    functiond = Util.eplan.RemoveARFromPanel(this.MvProject.Project, function1.Name);
                    if (functiond == null)
                    {
                        //MessageBox.Show("ERROR: Door Arrange에서 심볼을 찾지 못했습니다: " + function1.Name);
                    }

                    functiond = Util.eplan.AddArticleReference(functiond, part.PartNr, 0);
                }

                undoStep.CloseOpenUndo();
            }

            this.RefreshSingleline(this._singleline);
        }