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();

            //if (_SqlConnectionConnection.State == System.Data.ConnectionState.Open)
            //    _SqlConnectionConnection.Close();
            //_SqlConnectionConnection.ConnectionString = Common.ConnectionString;
            //_SqlConnectionConnection.Open();

            try
            {
                myReader = null;

                myCommand.CommandText = @"SELECT * FROM [tblBitmap]  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();
                //_SqlConnectionConnection.Close();

                foreach (long id in idlist)// (int i = 0; i < count ; i++)
                {
                    tblBitmap tblbitmap = new tblBitmap();
                    tblbitmap.ID = id;
                    tblbitmap.m_DisplayID_tblDisplay = this.m_DisplayID_tblDisplay;
                    tblbitmap.Select();

                    Add(tblbitmap);
                }
            }
            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);
        }
Example #3
0
 public bool Contains(tblBitmap item)
 {
     return(List.Contains(item));
 }
Example #4
0
 public int IndexOf(tblBitmap item)
 {
     return(List.IndexOf(item));
 }
Example #5
0
 public void Insert(int index, tblBitmap item)
 {
     List.Insert(index, item);
     this.OntblBitmapChanged(EventArgs.Empty);
 }
Example #6
0
 public void Remove(tblBitmap item)
 {
     List.Remove(item);
     this.OntblBitmapChanged(EventArgs.Empty);
 }
Example #7
0
 public void Add(tblBitmap item)
 {
     List.Add(item);
     this.OntblBitmapChanged(EventArgs.Empty);
 }