using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TABS.MailCarrier.WebSDK;
using TABS.MailCarrier.WebSDK.Mail;

public partial class Mail_MoveTo : System.Web.UI.Page
{
    protected string _page;                        // 이전 페이지의 index
    protected Guid _folderId;                      // 이전 페이지의 folderId
    protected string _msgIds;                      // 이동할 메시지 IDs

    protected override void InitializeCulture()
    {
        string defLang = WebUser.CurrentUser.UiLanguage;
        Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(defLang);
        Thread.CurrentThread.CurrentUICulture = new CultureInfo(defLang);
        base.InitializeCulture();
    }

    protected void Page_Init(object sender, EventArgs e)
    {
        WebUtil.SetMcCommonCss(Page.Header);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        _msgIds = WebParam.GetStrParamValue("msg");
        _folderId = WebParam.GetGuidParamValue("folder");
        _page = WebParam.GetStrParamValue("page");

        if (!IsPostBack)
        {
            Page.Title = AppSetting.GetTitleInfo(Request).Title;
        }
    }

    protected string GetIndent(int indent)
    {
        return (indent * 16).ToString();
    }

    protected string GetFolderInfo(Guid id, string folderName, int newMsgCount, int msgCount)
    {
        string info = string.Format("<img src='../Images/Mail/{0}' border='0' /> ", MailUtil.GetMailboxImageName(folderName)); ;
        if (folderName == MailUtil.ReadRecipientsMailboxName)
        {
            info += Resources.Mail.ReadRecipientsMailbox;
        }
        else if (folderName == MailUtil.AllMailsMailboxName || folderName == MailUtil.UnreadMailsMailboxName || folderName == MailUtil.FlaggedMailsMailboxName || folderName == MailUtil.ReadRecipientsMailboxName)
        {
            info += MailUtil.GetMailboxDisplayName(folderName);
        }
        else
        {
            info += string.Format("{0} ({1}/{2})", MailUtil.GetMailboxDisplayName(folderName), newMsgCount, msgCount);
        }
        return info;
    }

    protected string GetFolderInfoEx(Guid id, string folderName, int newMsgCount, int msgCount)
    {
        string info = MailUtil.GetMailboxFontIcon(folderName) + " ";
        if (folderName == MailUtil.ReadRecipientsMailboxName)
        {
            info += Resources.Mail.ReadRecipientsMailbox;
        }
        else if (folderName == MailUtil.AllMailsMailboxName || folderName == MailUtil.UnreadMailsMailboxName || folderName == MailUtil.FlaggedMailsMailboxName || folderName == MailUtil.ReadRecipientsMailboxName)
        {
            info += MailUtil.GetMailboxDisplayName(folderName);
        }
        else
        {
            info += string.Format("{0} ({1}/{2})", MailUtil.GetMailboxDisplayName(folderName), newMsgCount, msgCount);
        }
        return info;
    }

}