private void InitStatus()
        {
            UpdateController controller = new UpdateController(this);

            controller.CheckUpdate();
            //UpgradeService us = new UpgradeService(true);
            //us.SynCheckUpdate();
            MagazineStyle se = MagazineStyle.GetInstance();

            if (se.Exist())
            {
                cb_style.Text = se.Name;
            }
            //2016-06-13 测试 吴海龙
            WordApplication.GetInstance().WordApp = Globals.ThisAddIn.Application;
            //WordApplication.GetInstance().WordApp = Globals.ThisAddIn.Application;
            //日志目录
            if (!Directory.Exists("C:\\log\\"))
            {
                Directory.CreateDirectory("C:\\log\\");
            }
            //多线程下载样式避免,网络卡顿造成word 卡死。
            Thread t = new Thread(DownloadStyles);

            t.Start();
            RefreshStyleList();
        }
 private void edit_style_Click(object sender, RibbonControlEventArgs e)
 {
     try
     {
         if (new LoginController(this).IsLogin("登录后才能进行样式编辑!请问是否立即登录?"))
         {
             if (MagazineStyle.GetInstance().Name == "参考文献样式")
             {
                 MessageBox.Show("请选择具体的参考文献样式后再编辑。");
                 return;
             }
             PublicVar.CNStyle = CommonFunction.IsCNStyle(MagazineStyle.GetInstance().Name);
             frmTempletManager frm = new frmTempletManager(cb_style.Text);
             if (DialogResult.OK == frm.ShowDialog())
             {
                 RefreshStyleList();
                 cb_style.Text = frm.newStyle;
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(typeof(BIMTRibbon), ex);
     }
 }
        public void SetStyle(string name)
        {
            MagazineStyle se = MagazineStyle.GetInstance();

            se.Name = name;
            if (se.Exist())
            {
                cb_style.Text = name.Split('.')[0];
            }
        }
        private void btn_apply_style_Click(object sender, RibbonControlEventArgs e)
        {//更新样式
            try
            {
                MagazineStyle.GetInstance().Name = cb_style.Text;

                PublicVar.SetCurrentStyleJObject();

                CommonFunction.RefreshStyle();
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(typeof(BIMTRibbon), ex);
            }
        }
 private void currentStyle_TextChanged(object sender, RibbonControlEventArgs e)
 {
     try
     {
         if (DialogResult.Yes == MessageBox.Show(null, "是否应用" + cb_style.Text + "的参考文献样式?", "切换样式", MessageBoxButtons.YesNo))
         {
             MagazineStyle _style = MagazineStyle.GetInstance();
             _style.Name = cb_style.Text;
             PublicVar.SetCurrentStyleJObject();
             CommonFunction.RefreshStyle();
             QuotationStyle style = new QuotationStyle(MagazineStyle.GetInstance().Name);
             style.WriteContent();
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog(typeof(BIMTRibbon), ex);
     }
 }