public override bool Load()
        {
            bool        ret    = true;
            List <long> idlist = new List <long>();

            if (Common.Conn == null)
            {
                Common.Conn = new SQLiteConnection(Common.ConnectionString);
                Common.Conn.Open();
            }
            SQLiteDataReader myReader  = null;
            SQLiteCommand    myCommand = new SQLiteCommand();

            try
            {
                myReader = null;

                myCommand.CommandText = @"SELECT * FROM [tblPolyline]  WHERE [DisplayID]= " + m_DisplayID_tblDisplay.DisplayID + " order by oIndex;";

                myCommand.Connection = Common.Conn;
                myReader             = myCommand.ExecuteReader();
                while (myReader.Read())
                {
                    idlist.Add(myReader.GetInt64(myReader.GetOrdinal("ID")));
                }

                myReader.Close();
                myCommand.Dispose();


                foreach (long id in idlist)// (int i = 0; i < count ; i++)
                {
                    tblPolyline tblpolyline = new tblPolyline();
                    tblpolyline.ID = id;
                    tblpolyline.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                    tblpolyline.Select();
                    //tblpolyline.m_tblPointsPolylineCollection.Load();
                    Add(tblpolyline);
                }
            }
            catch (SQLiteException ae)
            {
                System.Windows.Forms.MessageBox.Show(ae.Message);
                return(false);
            }



            return(ret);
        }
        public bool SaveDisplay()
        {
            bool   ret = true;
            string str = "";


            //m_tblLineCollection.Clear();
            //m_tblBitmapCollection.Clear();
            //m_tblRectCollection.Clear();
            //m_tblPolylineCollection.Clear();
            //m_tblADTextCollection.Clear();
            int i = 0;

            // this.Update();
            foreach (DrawObject o in Pages.GraphicPagesList[0].List)
            {
                i++;
                if (o.Dirty)
                {
                    str = o.GetType().ToString();
                    switch (str)
                    {
                    case "DCS.Draw.Curve":
                        o.Save(this.DisplayID, Pages.ActivePageNo);
                        break;

                    case "DCS.Draw.DrawEllipse":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawImage":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawLine":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawPolyLine":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawPolygon":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawCurve":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawRectangle":
                        o.Save(this.DisplayID, i);
                        break;

                    case "DCS.Draw.DrawText":
                        o.Save(this.DisplayID, i);
                        break;
                    }
                }
            }

            foreach (DeleteListStruc deleteliststruc in Pages.Parenttabgraphicpagecontrol.DeleteList)
            {
                if (deleteliststruc.ID != -1)
                {
                    switch ((STATIC_OBJ_TYPE)deleteliststruc.Type)
                    {
                    case STATIC_OBJ_TYPE.ID_BITMAP:
                        tblBitmap tblbitmap = new tblBitmap();
                        tblbitmap.ID = deleteliststruc.ID;
                        tblbitmap.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_ANATEXT:
                    case STATIC_OBJ_TYPE.ID_TEXT:
                        tblADText tbladtext = new tblADText();
                        tbladtext.ID = deleteliststruc.ID;
                        tbladtext.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_LINE:
                        tblLine tblline = new tblLine();
                        tblline.ID = deleteliststruc.ID;
                        tblline.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_ELLIPS:
                    case STATIC_OBJ_TYPE.ID_ROUNDRECT:
                    case STATIC_OBJ_TYPE.ID_RECT:
                        tblRect tblRect = new tblRect();
                        tblRect.ID = deleteliststruc.ID;
                        tblRect.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_POLYLINE:
                        tblPolyline tblpolyline = new tblPolyline();
                        tblpolyline.ID = deleteliststruc.ID;
                        tblpolyline.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_POLYGON:
                        tblPolygon tblpolygon = new tblPolygon();
                        tblpolygon.ID = deleteliststruc.ID;
                        tblpolygon.Delete();
                        break;

                    case STATIC_OBJ_TYPE.ID_CURVE:
                        tblCurve tblcurve = new tblCurve();
                        tblcurve.ID = deleteliststruc.ID;
                        tblcurve.Delete();
                        break;
                    }
                }
            }
            Pages.Parenttabgraphicpagecontrol.DeleteList.Clear();

            return(ret);
        }
Exemple #3
0
 public bool Contains(tblPolyline item)
 {
     return(List.Contains(item));
 }
Exemple #4
0
 public int IndexOf(tblPolyline item)
 {
     return(List.IndexOf(item));
 }
Exemple #5
0
 public void Insert(int index, tblPolyline item)
 {
     List.Insert(index, item);
     this.OntblPolylineChanged(EventArgs.Empty);
 }
Exemple #6
0
 public void Remove(tblPolyline item)
 {
     List.Remove(item);
     this.OntblPolylineChanged(EventArgs.Empty);
 }
Exemple #7
0
 public void Add(tblPolyline item)
 {
     List.Add(item);
     this.OntblPolylineChanged(EventArgs.Empty);
 }