Пример #1
0
        public static bool PowerOff()
        {
            bool b = GprsControl.Deactive();

            if (b)
            {
                IsOnPower   = false;
                IsOnConnect = false;
            }
            return(b);
        }
Пример #2
0
        /// <summary>
        /// Dispose Call
        /// </summary>
        /// <returns></returns>
        public static bool DisCall()
        {
            //if (!IsOnPower) return true;
            //if (!IsOnConnect) return true;
            bool b = GprsControl.Disconnect();

            if (b)
            {
                IsOnConnect = false;
            }
            return(b);
        }
Пример #3
0
        /// <summary>
        /// OnPower
        /// </summary>
        /// <returns></returns>
        public static bool Open()
        {
            if (GprsControl.IsActived())
            {
                GprsControl.Deactive();
                Thread.Sleep(200);
            }

            IsOnPower = GprsControl.Active() > 0;
            Thread.Sleep(5000);
            return(IsOnPower);
        }
Пример #4
0
 private void FrPadMain_Load(object sender, EventArgs e)
 {
     if (WifiControl.IsActived())
     {
         btwifi.Text = "Close Wi-Fi";
     }
     if (GprsControl.IsActived())
     {
         btGPRS.Tag  = "Close";
         btGPRS.Text = "Close GPRS";
     }
 }
Пример #5
0
 /// <summary>
 /// Call GPRS
 /// </summary>
 /// <returns></returns>
 public static bool Call()
 {
     if (!IsOnPower)
     {
         return(false);
     }
     if (IsOnConnect)
     {
         return(true);
     }
     IsOnConnect = GprsControl.Connect();
     return(IsOnConnect);
 }
Пример #6
0
        /// <summary>
        /// Switch Gprs
        /// </summary>
        private void SwitchGprs()
        {
            bool isInvoke = false;

            if (GprsControl.IsActived())
            {
                if (DialogResult.Yes == MessageBox.Show("Are you sure to close the gprs?", "GPRS", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
                {
                    if (GprsControl.Deactive())
                    {
                        btGPRS.Text = "Open GPRS";
                    }
                }
                else
                {
                    isInvoke = true;
                }
            }
            else
            {
                int ret = GprsControl.Active();
                {
                    isInvoke = true;
                }
            }

            if (isInvoke)
            {
                btGPRS.Text = "Close GPRS";
                string procname = @"\Windows\rnaapp.exe";
                if (!File.Exists(procname))
                {
                    return;
                }
                Process.Start(procname, "-e\"GPRSDial\"");      //"-p-e\"GPRSDial\""
            }
        }