private void Stop_DisplayService(bool isForced = true)
 {
     if (Base_DL.iniEntity.IsDM_D30Used)
     {
         Login_BL bbl_1 = new Login_BL();
         if (bbl_1.ReadConfig())
         {
             bbl_1.Display_Service_Update(false);
             Thread.Sleep(1 * 1000);
             bbl_1.Display_Service_Enabled(false);
         }
         else
         {
             bbl_1.Display_Service_Update(false);
             Thread.Sleep(1 * 1000);
             bbl_1.Display_Service_Enabled(false);
         }
         try
         {
             Kill("Display_Service");
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.StackTrace.ToString());
         }
         if (isForced)
         {
             cdo.SetDisplay(true, true, Base_DL.iniEntity.DefaultMessage);
         }
         //Base_DL.iniEntity.CDO_DISPLAY.SetDisplay(true, true,Base_DL.iniEntity.DefaultMessage);
     }
 }
        public void ForceToclose()
        {
            foreach (DataRow dr in menu.Rows)
            {
                var localByName = Process.GetProcessesByName(dr["ProgramID_ID"].ToString());
                if (localByName.Count() > 0)
                {
                    foreach (var process in localByName)
                    {
                        try
                        {
                            process.Kill();
                        }
                        catch
                        {
                        }
                    }
                }
            }
            try
            {
                Login_BL lbl = new Login_BL();
                try
                {
                    lbl.Display_Service_Update(false);
                    Thread.Sleep(3 * 1000);
                    lbl.Display_Service_Enabled(false);
                }
                catch {
                }
                cdo.RemoveDisplay();
                // true, true,Base_DL.iniEntity.DefaultMessage
                //  Base_DL.Ini_Entity_CDP.CDO_DISPLAY.RemoveDisplay();
            }
            catch
            {
            }

            //try
            //{
            //    m_Display.MarqueeType = DisplayMarqueeType.None;  // marquee close
            //    m_Display.DestroyWindow();                        // instance close we have created


            //    m_Display.ClearText();
            //    m_Display.DeviceEnabled = false;
            //    m_Display.Release();
            //    m_Display.Close();
            //}
            //catch(Exception ex)
            //{
            //   // MessageBox.Show(ex.Message);
            //}
        }
 private void Start_Display()
 {
     try
     {
         if (Base_DL.iniEntity.IsDM_D30Used)
         {
             Login_BL bbl_1 = new Login_BL();
             if (bbl_1.ReadConfig())
             {
                 bbl_1.Display_Service_Update(false);
                 Thread.Sleep(1 * 1000);
                 bbl_1.Display_Service_Enabled(false);
             }
             else
             {
                 bbl_1.Display_Service_Update(false);
                 Thread.Sleep(1 * 1000);
                 bbl_1.Display_Service_Enabled(false);
             }
             Kill("Display_Service");
         }
     }
     catch (Exception ex) { MessageBox.Show("Cant remove on second time" + ex.StackTrace); }
 }
 private void RunDisplay_Service()  // Make when we want to run display_service
 {
     try
     {
         if (Base_DL.iniEntity.IsDM_D30Used)
         {
             cdo.RemoveDisplay(true);
             Login_BL bbl_1 = new Login_BL();
             bbl_1.Display_Service_Update(true);
             bbl_1.Display_Service_Enabled(true);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error in removing display. . .");
     }
 }