Beispiel #1
0
        private void bSaveHostsFromPC_Click(object sender, EventArgs e)
        {
            ADB_UTIL adbSetting = ADB_UTIL.getSingleton(this);
            string   ret        = adbSetting.pushHostsfile();

            LPushFiles.Text = ret.Equals("")?"PUSH OK":ret;
        }
Beispiel #2
0
        /******** Event Listener ********/

        private void MainForm_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;
            LADBPath.Text        = ADB_UTIL.getSingleton(this).PATH;
        }
Beispiel #3
0
        private void bRunOpenHosts_Click(object sender, EventArgs e)
        {
            ADB_UTIL adbSetting = ADB_UTIL.getSingleton(this);

            LSystemBlock.Text = adbSetting.getSystemDirBlock();

            string ret = adbSetting.setRemount();

            if (ret.Contains("Operation"))
            {
                MessageBox.Show(ret, "REMOUNT FAILED");
                LReMount.Text = "REMOUNT FAILED";
                return;
            }
            else
            {
                LReMount.Text = "REMOUNT SUCCESS";
            }

            ret = adbSetting.changePermission();
            LChangePermission.Text = ret.Equals("") ? "CHMOD OK" : ret;

            ret             = adbSetting.getHostsFile();
            LPullFiles.Text = ret.Equals("") ? "PULL OK":ret;
        }
Beispiel #4
0
 private void addList(List <ListViewItem> items)
 {
     ADB_UTIL.getSingleton(this).init();
     adbList.Items.Clear();
     foreach (ListViewItem item in items)
     {
         adbList.Items.Add(item);
     }
     adbList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
 }
Beispiel #5
0
        /// <summary>
        /// Timer Method - auto command 'adb devices'
        /// </summary>
        private void TimerRefreshDeviceList(object o)
        {
            List <ListViewItem> l = new List <ListViewItem>();

            foreach (string name in ADB_UTIL.getSingleton(this).getDevices())
            {
                string[] items = name.Split('\t');
                l.Add(new ListViewItem(new string[] { items[0], items[1] }));
            }
            Invoke(new TimerDelegateAddList(addList), l);
        }
Beispiel #6
0
        private void adbList_SelectedIndexChanged(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection _ = this.adbList.SelectedItems;
            if (1 > _.Count)
            {
                return;
            }
            ListViewItem item = _[0];

            if (item == null)
            {
                return;
            }
            LCurrentDevice.Text = TAG_CURRENT_DEVICE + item.SubItems[0].Text;
            ADB_UTIL.getSingleton(this).DEVICE_NAME = item.SubItems[0].Text;
        }
Beispiel #7
0
        private void bRefreshDevices_Click(object sender, EventArgs e)
        {
            List <ListViewItem> l = new List <ListViewItem>();

            foreach (string name in ADB_UTIL.getSingleton(this).getDevices())
            {
                string[] items = name.Split('\t');
                l.Add(new ListViewItem(new string[] { items[0], items[1] }));
            }

            ADB_UTIL.getSingleton(this).init();
            adbList.Items.Clear();
            foreach (ListViewItem item in l)
            {
                adbList.Items.Add(item);
            }
            adbList.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
        }
Beispiel #8
0
 private void bSelectADBPath_Click(object sender, EventArgs e)
 {
     LADBPath.Text = ADB_UTIL.getSingleton(this).openFile();
 }
Beispiel #9
0
 private void bOpenHostsFromAndroid_Click(object sender, EventArgs e)
 {
     debugText.Text = ADB_UTIL.getSingleton(this).catHostsFile();
 }
Beispiel #10
0
 private void MainForm_FormClosed(object sender, FormClosedEventArgs e)
 {
     ADB_UTIL.getSingleton(this).deleteLocalHostsFile();
 }