Example #1
0
        private void listBoxControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable temp = projectlistbox.DataSource as DataTable;
            string    path = temp.Rows[projectlistbox.SelectedIndex][2].ToString();

            if (firstlogin == false)
            {
                if (File.Exists(path) == true)
                {
                    using (DBeng db = new DBeng())
                    {
                        db.setProjectPath(path);
                        using (LocalTables locals = new LocalTables(true))
                        {
                            locals.getalltables();
                        }
                    }


                    this.Hide();
                }
                else
                {
                    MessageBox.Show("Dosya artık mevcut değil" + path);
                }
            }

            firstlogin = false;
        }
        private void backgroundWorker1_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e)
        {
            DBeng db = new DBeng();

            db.create_project(textEdit1.Text);
            finish = true;
        }
 public determine_pin_locations_window(string SocketID)
 {
     db      = new DBeng();
     manager = new DataManager(true);
     updater = new DataManager.TableUpdater();
     InitializeComponent();
     pin_locations = new List <String>();
     //socketimage_to_be_processed = new Bitmap("dummy filename");
     socketID_to_be_processed = SocketID;
     //CheckForIllegalCrossThreadCalls = false;
 }
        public determine_pin_locations_window(string SocketID, Bitmap img)
        {
            manager = new DataManager(true);
            updater = new DataManager.TableUpdater();
            InitializeComponent();
            //CheckForIllegalCrossThreadCalls = false;
            PropertyItem[] propertyItem2 = img.PropertyItems;
            bitmap_to_be_saved = new Bitmap(img);


            for (int i = 0; i < propertyItem2.Length; i++)
            {
                bitmap_to_be_saved.SetPropertyItem(propertyItem2[i]);
                Console.WriteLine(propertyItem2[i]);
            }
            socketimage_to_be_processed = new Bitmap(img);

            db            = new DBeng();
            pin_locations = new List <String>();
            determine_pin_locations_image.Image = socketimage_to_be_processed;
            socketID_to_be_processed            = SocketID;


            propertyItem = bitmap_to_be_saved.GetPropertyItem(0x010e);


            pin_coordinates = Encoding.UTF8.GetString(propertyItem.Value).Trim().Split(' ');



            for (int i = 0; i < pin_coordinates.Length - 2; i = i + 3)
            {
                //Console.WriteLine(i+"==" +pin_coordinates[i + 1]+ " --- " + pin_coordinates[i + 2]+ "///////" + pin_coordinates.Length);
                pin_point = new Point(Convert.ToInt32(pin_coordinates[i + 1]), Convert.ToInt32(pin_coordinates[i + 2]));
                bitmap_for_pin_processing      = (Bitmap)determine_pin_locations_image.Image;
                point_color_for_pin_processing = bitmap_for_pin_processing.GetPixel(pin_point.X, pin_point.Y);
                if (point_color_for_pin_processing != Color.FromArgb(255, 255, 0, 0))
                {
                    // Console.WriteLine("girdi");
                    pin_locations.Add(pincount + 1 + " " + pin_point.X.ToString() + " " + pin_point.Y.ToString());
                    determine_pin_locations_determinedpins.Items.Add(++pincount + ". pin = " + pin_point.X.ToString() + " " + pin_point.Y.ToString());
                    Fill4(bitmap_for_pin_processing, pin_point, point_color_for_pin_processing, Color.Red);
                }
                determine_pin_locations_image.Image = bitmap_for_pin_processing;
            }
        }