Beispiel #1
0
        public static void SaveMyStandard(List <PrintPageLayerInfo> infoList)
        {
            int count = infoList.Count;

            PrintPageLayerInfo[] myStdInfoArray = new PrintPageLayerInfo[count];
            for (int i = 0; i < count; i++)
            {
                myStdInfoArray[i] = infoList[i];
            }
            Properties.Settings.Default.MyStandardPrintPageLayerString = MbeMyStd.SaveMyStdInfoArray(myStdInfoArray);
            Properties.Settings.Default.Save();
        }
Beispiel #2
0
        private void SetPrintLayer_Load(object sender, EventArgs e)
        {
            ppLayerListCtrl.EnablePaint = true;
            //panel2.LayerMask = 0xFFFFFFFFFFFFFFFF;
            ppLayerListCtrl.infoList = PrintPageLayerInfo.LoadMyStandard();;
            //layerListCtrl.EnablePaint = true;
            //layerListCtrl.Size = new Size(200, 300);
            ppLayerListCtrl.InitDrawParam();
            panel1.font       = ppLayerListCtrl.DiplayFont;
            panel1.TitleWidth = ppLayerListCtrl.titleWidth;
            SetVScrollParam();

            vScrollBar1.SmallChange = 1;
            vScrollBar1.LargeChange = 1;
        }
Beispiel #3
0
        private void AddPage(int index)
        {
            EditTitleEnd();
            PrintPageLayerInfo info = new PrintPageLayerInfo();

            if (index < 0 || index >= infoList.Count)
            {
                infoList.Add(info);
            }
            else
            {
                infoList.Insert(index + 1, info);
            }
            Refresh();
            if (PageCountChanged != null)
            {
                PageCountChanged(this, null);
            }
        }
Beispiel #4
0
        private void InsertPage(int index)
        {
            EditTitleEnd();
            if (index < 0)
            {
                index = 0;
            }
            else if (index >= infoList.Count)
            {
                index = infoList.Count - 1;
            }
            PrintPageLayerInfo info = new PrintPageLayerInfo();

            infoList.Insert(index, info);
            Refresh();
            if (PageCountChanged != null)
            {
                PageCountChanged(this, null);
            }
        }
Beispiel #5
0
 private void IDOK_Click(object sender, EventArgs e)
 {
     ppLayerListCtrl.EditTitleEnd();
     PrintPageLayerInfo.SaveMyStandard(ppLayerListCtrl.infoList);
     DialogResult = DialogResult.OK;
 }
Beispiel #6
0
        public static MbeMyStd[] LoadMyStdInfoArray(string str)
        {
            LinkedList <MbeMyStd> infoLList = new LinkedList <MbeMyStd>();

            if (str != null)
            {
                StringReader     stringReader = new StringReader(str);
                ReadCE3.RdStatus result       = ReadCE3.RdStatus.NoError;
                try {
                    ReadCE3 readMb3 = new ReadCE3(stringReader);
                    string  str1;
                    string  str2;
                    while (readMb3.GetRecord(out str1, out str2))
                    {
                        if (str1[0] == '-')
                        {
                            break;
                        }
                        else
                        {
                            MbeMyStd info = null;
                            if (str1 == "")
                            {
                                continue;
                            }
                            else if (str1 == "+PAD_INFO")
                            {
                                info = new PadInfo();
                            }
                            else if (str1 == "+PTH_INFO")
                            {
                                info = new PthInfo();
                            }
                            else if (str1 == "+LINE_INFO")
                            {
                                info = new LineInfo();
                            }
                            else if (str1 == "+ARC_INFO")
                            {
                                info = new ArcInfo();
                            }
                            else if (str1 == "+HOLE_INFO")
                            {
                                info = new HoleInfo();
                            }
                            else if (str1 == "+GRID_INFO")
                            {
                                info = new GridInfo();
                            }
                            else if (str1 == "+TEXT_INFO")
                            {
                                info = new TextInfo();
                            }
                            else if (str1 == "+POLYGON_INFO")
                            {
                                info = new PolygonInfo();
                            }
                            else if (str1 == "+LIB_INFO")
                            {
                                info = new LibInfo();
                            }
                            else if (str1 == "+PPAGE_INFO")
                            {
                                info = new PrintPageLayerInfo();
                            }
                            if (info != null)
                            {
                                result = info.RdMb3(readMb3);
                                if (result == ReadCE3.RdStatus.NoError)
                                {
                                    infoLList.AddLast(info);
                                }
                                else
                                {
                                    break;
                                }
                            }
                        }
                    }
                }
                catch {
                }
                finally {
                    stringReader.Dispose();
                }
            }
            MbeMyStd[] infoArray = new MbeMyStd[infoLList.Count];
            int        index     = 0;

            foreach (MbeMyStd info in infoLList)
            {
                infoArray[index] = info;
                index++;
            }

            return(infoArray);
        }