Exemple #1
0
        /// <summary>
        /// 保存処理本体
        /// </summary>
        /// <param name="Pres">Presentation情報</param>
        /// <param name="Cancel">保存フラグ</param>
        /// <param name="SaveAsUI">キャンセルフラグ</param>
        public void PresentationSave(Microsoft.Office.Interop.PowerPoint.Presentation Pres, ref bool Cancel, bool SaveAsUI)
        {
            // PowerPoint画面が表示されていない場合は設定画面を表示しない
            if (this.Application.Visible == Microsoft.Office.Core.MsoTriState.msoFalse)
            {
                return;
            }

            // プロパティ情報取得
            PowerPointAddInSAB.SettingForm frmSet = new PowerPointAddInSAB.SettingForm();
            frmSet.propPres = Pres;

            // 共通設定エラー時処理
            if (frmSet.commonFileReadCompleted == false)
            {
                return;
            }

            // スライド数が0のときは登録不要
            if (frmSet.GetSlideCount() <= 0)
            {
                return;
            }

            string strFilePropertySecrecyLevel = string.Empty; // ファイルプロパティ情報 機密区分
            string strFilePropertyClassNo      = string.Empty; // ファイルプロパティ情報 事業所コード
            string strFilePropertyOfficeCode   = string.Empty; // ファイルプロパティ情報 事業所コード

            // プロパティのタグを取得
            frmSet.GetDocumentProperty(ref strFilePropertySecrecyLevel, ref strFilePropertyClassNo, ref strFilePropertyOfficeCode); // プロパティ情報取得

            // プロパティにSAB情報は未設定の場合は設定画面を表示
            if (frmSet.IsSecrecyInfoRegistered() == false)
            {
                // 必須登録モードON
                frmSet.MustRegistMode = true;

                frmSet.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                frmSet.ShowDialog();
            }
            else
            {
                // ファイルの事業所コードと設定値の事業所コードを比較
                if (strFilePropertyOfficeCode == frmSet.clsCommonSettting.strOfficeCode)
                {
                    // プロパティに情報を書込み
                    frmSet.SetDocumentProperty(strFilePropertySecrecyLevel);
                }
                else
                {
                    // 修正を押下された場合は、設定画面を表示する
                    frmSet.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
                    frmSet.ShowDialog();
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// 保存後イベント
        /// </summary>
        private void Application_PresentationSave(PowerPoint.Presentation Pres)
        {
            if (Pres != this.Application.ActivePresentation)
            {
                return;
            }

            // PowerPoint画面が表示されていない場合は設定画面を表示しない
            if (this.Application.Visible == Microsoft.Office.Core.MsoTriState.msoFalse)
            {
                return;
            }

            // プロパティ情報取得
            PowerPointAddInSAB.SettingForm frmSet = new PowerPointAddInSAB.SettingForm();
            frmSet.propPres = Pres;

            // 共通設定エラー時処理
            if (frmSet.commonFileReadCompleted == false)
            {
                return;
            }

            // スライド数が0のときは登録不要
            if (frmSet.GetSlideCount() <= 0)
            {
                return;
            }

            string strFilePropertySecrecyLevel = string.Empty; // ファイルプロパティ情報 機密区分
            string strFilePropertyClassNo      = string.Empty; // ファイルプロパティ情報 事業所コード
            string strFilePropertyOfficeCode   = string.Empty; // ファイルプロパティ情報 事業所コード

            // プロパティのタグを取得
            frmSet.GetDocumentProperty(ref strFilePropertySecrecyLevel, ref strFilePropertyClassNo, ref strFilePropertyOfficeCode); // プロパティ情報取得

            if (lstPresPath.Contains(Path.Combine(Pres.Path, Pres.Name)))
            {
                lstPresPath.Remove(Path.Combine(Pres.Path, Pres.Name));
            }

            // S秘・A秘なら保存場所の確認を行う
            if ((strFilePropertySecrecyLevel == AddInsLibrary.InfomationForm.SECRECY_PROPERTY_S) ||
                (strFilePropertySecrecyLevel == AddInsLibrary.InfomationForm.SECRECY_PROPERTY_A))
            {
                string PresPath = Pres.Path;
                string FileName = Pres.Name;

                List <string> lstTarGetSecureFolder = frmSet.clsCommonSettting.lstSecureFolder;

                // セキュアフォルダと同一なら保存
                string result = lstTarGetSecureFolder.FirstOrDefault(x => PresPath.Contains(x));
                if (result == null)
                {
                    // セキュアフォルダではない
                    MessageBox.Show(AddInsLibrary.Properties.Resources.msg_warning_save_not_secure, AddInsLibrary.Properties.Resources.msgError, MessageBoxButtons.OK, MessageBoxIcon.Hand);

                    string FullPath = Path.Combine(PresPath, FileName);
                    lstPresPath.Add(FullPath);

                    ExecuteSaveAs();

                    return;
                }
            }

            ClearListPath();
        }