コード例 #1
0
ファイル: command.cs プロジェクト: thankhuong/autolead_pc
 public command(DeviceCommunicator comm)
 {
     this.sendControl = new command.SendControl(comm.sendData);
 }
コード例 #2
0
ファイル: Form1.cs プロジェクト: thankhuong/autolead_pc
        public Form1(string param)
        {
            this.settingUpdateTimer = new System.Windows.Forms.Timer();

            this.changesssh   = 0;
            this.scriptstatus = "stop";

            this._sshssh        = false;
            this.documentfolder = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "\\";

            this.offerListItem = new List <offerItem>();

            this.deviceComm = new DeviceCommunicator();
            this.cmd        = new command(this.deviceComm);
            this.cmdResult  = new commandResult();

            this.DeviceInfo = new deviceInfo();
            this.AppList    = new List <appDetail>();

            this.listbackup = new List <BackupObj>();
            this.listvipacc = new List <vipaccount>();

            this.maxwait             = 120;           // thoi gian timeout cua wipe - backup
            this.bitproc             = new Process(); //bitvise process
            this.runningstt          = EnumRunningSTT.NOT_RUN;
            this.currentOfferProfile = "";

            this.components = null;


            Random random = new Random();

            this.InitializeComponent();

            //init port connect
            this.numProxyPort.Value = random.Next(1000, 50000);
            //init ip connect
            this.DeviceIpControl.Text = Settings.Default.ipaddress;

            RunData.getInstance().loadAllData();

            this.lvwColumnSorter = new ListViewColumnSorter();
            this.listViewRRS.ListViewItemSorter = this.lvwColumnSorter;
            this.listViewRRS.OwnerDraw          = true;

            this.ipProxyHost.Text = NetworkHelper.getLocalIpAddress();


            ImageList imageList = new ImageList();

            imageList.ImageSize = new Size(1, 50);
            this.listViewOffer.SmallImageList = imageList;
            this.proxytool.Text = "SSH";


            try
            {
                this.Text = this.DeviceIpControl.Text.Split(new string[]
                {
                    "."
                }, StringSplitOptions.None)[3] + "|disconnected";
            }
            catch (Exception)
            {
            }

            initAutoLeadTab();

            Dictionary <string, ThreadStart> initParams = new Dictionary <string, ThreadStart>();

            initParams.Add("AutoLeadThread", new ThreadStart(this.autoLeadThread));
            initParams.Add("RRSThread", new ThreadStart(this.autoRRS));
            initParams.Add("BackupThread", new ThreadStart(this.backupthread));
            initParams.Add("WipeThread", new ThreadStart(this.wipethread));
            initParams.Add("ChangeIpThread", new ThreadStart(this.threadchangeIP));
            initParams.Add("ReconnectThread", new ThreadStart(this.reconnect));
            initParams.Add("ExeScriptThread", new ThreadStart(this.excutescriptthread1));

            ThreadManager.getInstance().init(initParams);
        }