Exemplo n.º 1
0
        private void RemoveConfigurationExecute()
        {
            var systemPath = System.Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);

            System.IO.DirectoryInfo di = new DirectoryInfo(systemPath);
            foreach (FileInfo file in di.GetFiles())
            {
                if (file.Name == (SelectedConfig + ".xml"))
                {
                    file.Delete();
                    ConfigList.Remove(SelectedConfig);
                }
            }
            SelectedConfig = ConfigList.FirstOrDefault();
        }
    /// <summary>
    /// 删除方案
    /// </summary>
    /// <param name="data"></param>
    public static void DelectScheme(SchemeData data)
    {
        ConfigList.Remove(data);
        ConfigNameList.Remove(data.SchemeName);

        SaveEditorSchemeData();
        SaveGameSchemeConfig(null);

        string Path1 = Application.dataPath + "/" + c_SDKCachePath + "/" + data.SchemeName + "Plugins";
        string Path2 = Application.dataPath + "/" + c_SDKCachePath + "/" + data.SchemeName;
        string Path3 = Application.dataPath + "/Plugins";
        string Path4 = Application.dataPath + "/" + data.SchemeName;

        FileTool.SafeDeleteDirectory(Path1);
        FileTool.SafeDeleteDirectory(Path2);
        FileTool.SafeDeleteDirectory(Path3);
        FileTool.SafeDeleteDirectory(Path4);
    }
Exemplo n.º 3
0
 public void ThreadOfEmail()
 {
     while (true)
     {
         if (ConfigList == null)
         {
             Thread.Sleep(ScanBetween);
             continue;
         }
         List <EmailConfig> eclist = new List <EmailConfig>(ConfigList);
         foreach (EmailConfig e in eclist)
         {
             try
             {
                 EmailHelper eh    = new EmailHelper(e);
                 int         count = eh.GetEmailCount();
                 eh.Disposed();
                 if (!Config_MD5.ContainsKey(e))
                 {
                     Config_MD5.Add(e, e.GetMD5());
                 }
                 if (!User_Count.ContainsKey(Config_MD5[e]))
                 {
                     User_Count.Add(Config_MD5[e], count);
                 }
                 else
                 {
                     #region 失效
                     //if (User_Count[Config_MD5[e]] != count)
                     //{
                     //    if (User_Count[Config_MD5[e]] > count)
                     //    {
                     //        NotifyIcon.ShowBalloonTip(5, "邮件被删除", e.Url + ":" + e.UserName + "删除了" + (count) + "条邮件", ToolTipIcon.Info);
                     //    }
                     //    else
                     //    {
                     //        NotifyIcon.ShowBalloonTip(5, "收到了新邮件", e.Url + ":" + e.UserName + "收到了" + (count - User_Count[Config_MD5[e]]) + "条新邮件", ToolTipIcon.Info);
                     //    }
                     //    User_Count[Config_MD5[e]] = User_Count[Config_MD5[e]] + count;
                     //}
                     #endregion
                 }
                 if (count != 0)
                 {
                     User_Count[Config_MD5[e]] = User_Count[Config_MD5[e]] + count;
                     NotifyIcon.ShowBalloonTip(5, "收到了新邮件", e.Url + ":" + e.UserName + "收到了" + (count) + "条新邮件", ToolTipIcon.Info);
                     if (!MailMessages.ContainsKey(Config_MD5[e]))
                     {
                         MailMessages.Add(Config_MD5[e], new List <MailMessage>());
                     }
                     EmailHelper ehh = new EmailHelper(e);
                     var         ll  = ehh.GetAllEmailMessages();
                     MailMessages[Config_MD5[e]].AddRange(ll);
                     ehh.Disposed();
                 }
                 else
                 {
                     ;
                 }
             }
             catch
             {
                 ConfigList.Remove(e);
                 Config_MD5.Remove(e);
             }
         }
         Thread.Sleep(ScanBetween);
     }
 }