public bool RestrictFavCheck { get; set; }
-#region "バージョンアップ"
- public void GetTweenBinary(string strVer)
- {
- try
- {
- //本体
- if (!(new HttpVarious()).GetDataToFile("http://tween.sourceforge.jp/Tween" + strVer + ".gz?" + DateTime.Now.ToString("yyMMddHHmmss") + Environment.TickCount.ToString(),
- Path.Combine(MyCommon.settingPath, "TweenNew.exe")))
- {
- throw new WebApiException("Err:Download failed");
- }
- //英語リソース
- if (!Directory.Exists(Path.Combine(MyCommon.settingPath, "en")))
- {
- Directory.CreateDirectory(Path.Combine(MyCommon.settingPath, "en"));
- }
- if (!(new HttpVarious()).GetDataToFile("http://tween.sourceforge.jp/TweenResEn" + strVer + ".gz?" + DateTime.Now.ToString("yyMMddHHmmss") + Environment.TickCount.ToString(),
- Path.Combine(Path.Combine(MyCommon.settingPath, "en"), "Tween.resourcesNew.dll")))
- {
- throw new WebApiException("Err:Download failed");
- }
- //その他言語圏のリソース。取得失敗しても継続
- //UIの言語圏のリソース
- var curCul = "";
- if (!Thread.CurrentThread.CurrentUICulture.IsNeutralCulture)
- {
- var idx = Thread.CurrentThread.CurrentUICulture.Name.LastIndexOf('-');
- if (idx > -1)
- {
- curCul = Thread.CurrentThread.CurrentUICulture.Name.Substring(0, idx);
- }
- else
- {
- curCul = Thread.CurrentThread.CurrentUICulture.Name;
- }
- }
- else
- {
- curCul = Thread.CurrentThread.CurrentUICulture.Name;
- }
- if (!string.IsNullOrEmpty(curCul) && curCul != "en" && curCul != "ja")
- {
- if (!Directory.Exists(Path.Combine(MyCommon.settingPath, curCul)))
- {
- Directory.CreateDirectory(Path.Combine(MyCommon.settingPath, curCul));
- }
- if (!(new HttpVarious()).GetDataToFile("http://tween.sourceforge.jp/TweenRes" + curCul + strVer + ".gz?" + DateTime.Now.ToString("yyMMddHHmmss") + Environment.TickCount.ToString(),
- Path.Combine(Path.Combine(MyCommon.settingPath, curCul), "Tween.resourcesNew.dll")))
- {
- //return "Err:Download failed";
- }
- }
- //スレッドの言語圏のリソース
- string curCul2;
- if (!Thread.CurrentThread.CurrentCulture.IsNeutralCulture)
- {
- var idx = Thread.CurrentThread.CurrentCulture.Name.LastIndexOf('-');
- if (idx > -1)
- {
- curCul2 = Thread.CurrentThread.CurrentCulture.Name.Substring(0, idx);
- }
- else
- {
- curCul2 = Thread.CurrentThread.CurrentCulture.Name;
- }
- }
- else
- {
- curCul2 = Thread.CurrentThread.CurrentCulture.Name;
- }
- if (!string.IsNullOrEmpty(curCul2) && curCul2 != "en" && curCul2 != curCul)
- {
- if (!Directory.Exists(Path.Combine(MyCommon.settingPath, curCul2)))
- {
- Directory.CreateDirectory(Path.Combine(MyCommon.settingPath, curCul2));
- }
- if (!(new HttpVarious()).GetDataToFile("http://tween.sourceforge.jp/TweenRes" + curCul2 + strVer + ".gz?" + DateTime.Now.ToString("yyMMddHHmmss") + Environment.TickCount.ToString(),
- Path.Combine(Path.Combine(MyCommon.settingPath, curCul2), "Tween.resourcesNew.dll")))
- {
- //return "Err:Download failed";
- }
- }
-
- //アップデータ
- if (!(new HttpVarious()).GetDataToFile("http://tween.sourceforge.jp/TweenUp3.gz?" + DateTime.Now.ToString("yyMMddHHmmss") + Environment.TickCount.ToString(),
- Path.Combine(MyCommon.settingPath, "TweenUp3.exe")))
- {
- throw new WebApiException("Err:Download failed");
- }
- //シリアライザDLL
- if (!(new HttpVarious()).GetDataToFile("http://tween.sourceforge.jp/TweenDll" + strVer + ".gz?" + DateTime.Now.ToString("yyMMddHHmmss") + Environment.TickCount.ToString(),
- Path.Combine(MyCommon.settingPath, "TweenNew.XmlSerializers.dll")))
- {
- throw new WebApiException("Err:Download failed");
- }
- }
- catch (Exception ex)
- {
- throw new WebApiException("Err:Download failed", ex);
- }
- }
-#endregion
-
public bool ReadOwnPost
{
get