コード例 #1
0
 private void CancelAlert()
 {
     try
     {
     }
     catch (Exception Ex)
     {
         DebugWrite.Writeln(nameof(CancelAlert), Ex);
     }
 }
コード例 #2
0
 private void EndAlert()
 {
     try
     {
         _readTimer?.Dispose();
         _readTimer = null;
     }
     catch (Exception Ex)
     {
         DebugWrite.Writeln(nameof(EndAlert), Ex);
     }
 }
コード例 #3
0
        //データーをfavaritecom.ini / favariteuser.ini型式で出力する
        private bool ExportData <T>(string w_file, IList <T> lists) where T : IAlertData, new()
        {
            var enc    = new System.Text.UTF8Encoding(false);
            var result = false;

            try
            {
                using (var sw = new StreamWriter(w_file, false, enc))
                {
                    sw.WriteLine("120");
                    foreach (T li in lists)
                    {
                        sw.WriteLine(li.Ng);
                        sw.WriteLine(li.ComId);
                        sw.WriteLine(li.UserId);
                        sw.WriteLine(li.Col04);
                        sw.WriteLine(li.ComName); //5
                        sw.WriteLine(li.UserName);
                        sw.WriteLine(li.Group);
                        sw.WriteLine(li.Last_Date);
                        sw.WriteLine(li.Col09); //9
                        sw.WriteLine(li.Col10); //10
                        sw.WriteLine(li.Col11);
                        sw.WriteLine(li.Col12);
                        sw.WriteLine(li.Col13);
                        sw.WriteLine(li.Col14);
                        sw.WriteLine(li.Col15);
                        sw.WriteLine(li.Regist_Date); //16
                        sw.WriteLine(li.Col17);
                        sw.WriteLine(li.Pop.ToString().ToLower());
                        sw.WriteLine(li.Ballon.ToString().ToLower()); //バルーン
                        sw.WriteLine(li.Web.ToString().ToLower());
                        sw.WriteLine(li.Mail.ToString().ToLower());   //メール
                        sw.WriteLine(li.Sound.ToString().ToLower());  //22
                        sw.WriteLine(li.Col23.ToString().ToLower());  //23
                        sw.WriteLine(li.App.ToString().ToLower());
                        sw.WriteLine(li.App_a.ToString().ToLower());
                        sw.WriteLine(li.App_b.ToString().ToLower());
                        sw.WriteLine(li.App_c.ToString().ToLower());
                        sw.WriteLine(li.App_d.ToString().ToLower());
                        sw.WriteLine(li.Memo); //メモ
                    }
                    sw.WriteLine("namarokuEndLine");
                }
            }
            catch (Exception Ex)
            {
                DebugWrite.Writeln(nameof(ExportData), Ex);
            }

            return(result);
        }
コード例 #4
0
        private void PopupProc(GetStreamInfo gsi)
        {
            var fpop = new Popup(this, gsi);

            try
            {
                int i = fpop.GetPopiNum();
                fpop.SetPosition("RD");     //表示する座標を決定
                fpop.Show();
            }
            catch (Exception Ex)
            {
                DebugWrite.Writeln(nameof(GetStreamInfo), Ex);
            }
        }
コード例 #5
0
 private void StopSound()
 {
     try
     {
         if (_player != null)
         {
             _player.Stop();
             _player.Dispose();
             _player = null;
         }
     }
     catch (Exception Ex)
     {
         DebugWrite.Writeln(nameof(StopSound), Ex);
     }
 }
コード例 #6
0
        private void SoundProc()
        {
            try
            {
                if (_player != null)
                {
                    StopSound();
                }

                _player = new SoundPlayer(props.GetSoundFile());
                _player.Play();
            }
            catch (Exception Ex)
            {
                DebugWrite.Writeln(nameof(SoundProc), Ex);
            }
        }
コード例 #7
0
        //データー出力
        private bool SaveCommData <T>(string w_file, IList <T> lists)
        {
            var enc    = new System.Text.UTF8Encoding(false);
            var result = false;

            try
            {
                using (var sw = new StreamWriter(w_file, false, enc))
                {
                    foreach (var li in lists)
                    {
                        string ttt = JsonConvert.SerializeObject(li);
                        sw.WriteLine(ttt);
                    }
                }
                result = true;
            }
            catch (Exception Ex)
            {
                DebugWrite.Writeln(nameof(SaveCommData), Ex);
            }

            return(result);
        }
コード例 #8
0
        //データー読込
        private List <T> ReadCommData <T>(string r_file)
        {
            var enc   = new System.Text.UTF8Encoding(false);
            var lists = new List <T>();

            try
            {
                using (var sr = new StreamReader(r_file, enc))
                {
                    string line;
                    while ((line = sr.ReadLine()) != null)
                    {
                        var ttt = JsonConvert.DeserializeObject <T>(line);
                        lists.Add(ttt);
                    }
                }
            }
            catch (Exception Ex)
            {
                DebugWrite.Writeln(nameof(ReadCommData), Ex);
            }

            return(lists);
        }