Esempio n. 1
0
        public void LoadHistory(string path)
        {
            EnabledItemsInHistory ei = Setting.EnabledItemsInHistory;
            HistoryItem           hi = Setting.History.FirstOrDefault(h => h.ArchiverPath == path);
            Profile pf = Setting.TempProfile;

            if (hi != null && (Directory.Exists(path) || File.Exists(path)))
            {
                // ファイル情報読み込み
                ReadFiles(new string[] { hi.ArchiverPath }, false);

                // 最後に読み込んだ画像(ページ番号)
                pf.LastPageIndex.Value = 0;
                if (hi.ImagePath != null)
                {
                    ImageFileContext lastImageFileContext = ImgContainerManager.ImagePool.ImageFileContextList.FirstOrDefault(i => i.FilePath == hi.ImagePath);
                    if (lastImageFileContext != null)
                    {
                        pf.LastPageIndex.Value = ImgContainerManager.ImagePool.ImageFileContextList.IndexOf(lastImageFileContext);
                    }
                }
                // アス比
                if (ei.AspectRatio && hi.AspectRatio != null)
                {
                    Array.Copy(hi.AspectRatio, pf.AspectRatio.Value, pf.AspectRatio.Value.Length);
                }

                // 行列設定
                if (ei.Matrix && hi.Matrix != null)
                {
                    Array.Copy(hi.Matrix, pf.NumofMatrix.Value, pf.NumofMatrix.Value.Length);
                }

                // スライド方向
                if (ei.SlideDirection && !(hi.SlideDirection == SlideDirection.None))
                {
                    pf.SlideDirection.Value = hi.SlideDirection;
                }

                // 見開きを検出するかどうか
                if (ei.DetectionOfSpread)
                {
                    pf.DetectionOfSpread.Value = hi.DetectionOfSpread;
                }

                // 画像読み込み
                var t = ImgContainerManager.InitAllContainer(pf.LastPageIndex.Value);

                // ツールバー更新
                UpdateToolbarViewing();
            }
            else
            {
                NotificationBlock.Show(path + " は見つかりませんでした。", NotificationPriority.Normal, NotificationTime.Long, NotificationType.None);
            }
        }
Esempio n. 2
0
        public void SaveHistoryItem()
        {
            EnabledItemsInHistory ei = Setting.EnabledItemsInHistory;

            if (!ei.ImagePath && !ei.Matrix && !ei.SlideDirection)
            {
                return;
            }

            // アーカイバが1つの時だけ保存
            if (ImgContainerManager.ImagePool.IsSingleArchiver && ImgContainerManager.ImagePool.Archivers[0].LeaveHistory)
            {
                HistoryItem hi = Setting.History.FirstOrDefault(h => h.ArchiverPath == ImgContainerManager.ImagePool.Archivers[0].ArchiverPath);
                if (hi != null)
                {
                    // 最後に読み込んだ画像のパス(並び順に依らないページ番号復元用)
                    ImageFileContext ifc = ImgContainerManager.CurrentImageFileContext;
                    if (ifc != null)
                    {
                        hi.ImagePath = ifc.FilePath;
                    }
                    else
                    {
                        hi.ImagePath = "";
                    }
                    // アス比
                    hi.AspectRatio = new int[] { Setting.TempProfile.AspectRatio.H, Setting.TempProfile.AspectRatio.V };
                    // 行列
                    hi.Matrix = new int[] { Setting.TempProfile.NumofMatrix.Col, Setting.TempProfile.NumofMatrix.Row };
                    // スライド方向
                    hi.SlideDirection = Setting.TempProfile.SlideDirection.Value;
                    // 見開きを検出するかどうか
                    hi.DetectionOfSpread = Setting.TempProfile.DetectionOfSpread.Value;
                }
            }
        }
Esempio n. 3
0
        public AppSetting()
        {
            // 初期化

            // 一時的プロファイル
            TempProfile             = new Profile();
            TempProfile.ProfileType = ProfileType.Temp;

            // ダイアログにはない設定
            ShowFileInfoInTileExpantionPanel         = true;
            SettingDialogTabIndex                    = 0;
            AppSettingDialogTabIndex                 = 0;
            AppSettingDialog_ShortcutSettingTabIndex = 0;
            AppSettingDialogSize             = Size.Empty;
            MatrixSelecterMaxSize            = 4;
            FolderOpenDialogLastSelectedPath = null;
            FileOpenDialogLastSelectedPath   = null;

            // プロファイル
            UserProfileList  = new List <UserProfileInfo>();
            UsePresetProfile = true;

            // 起動時
            StartUp_RestoreWindowSizeAndPos = true;
            StartUp_LoadLastFiles           = true;
            StartUp_RestoreLastPageIndex    = true;
            StartUp_RestoreSlideShowPlaying = true;


            // ショートカット
            ShortcutSetting       = new ShortcutSetting();
            MouseGestureRange     = 15;
            LongClickDecisionTime = 400;

            // 履歴設定
            History                = new List <HistoryItem>();
            NumofHistory           = 100;
            NumofHistoryInMenu     = 30;
            NumofHistoryInMainMenu = 10;
            EnabledItemsInHistory  = new EnabledItemsInHistory();
            ApplyHistoryInfoInNewArchiverReading = true;

            // アスペクト比のリスト
            AspectRatioList = new List <Point> {
                new Point(4, 3), new Point(3, 4), new Point(16, 9), new Point(9, 16), new Point(3, 2), new Point(2, 3), new Point(1, 1)
            };

            // 外部連携
            ExternalAppInfoList = new List <ExternalAppInfo>();

            var exAppInfo1 = new ExternalAppInfo();

            exAppInfo1.Name = "規定のプログラム";
            exAppInfo1.Arg  = "\"" + Format.FilePathFormat + "\"";
            ExternalAppInfoList.Add(exAppInfo1);

            var exAppInfo2 = new ExternalAppInfo();

            exAppInfo2.Name = "エクスプローラー";
            exAppInfo2.Path = "explorer.exe";
            exAppInfo2.Arg  = "/select,\"" + Format.FilePathFormat + "\"";
            ExternalAppInfoList.Add(exAppInfo2);

            // 詳細
            ShowMenuItem_AdditionalRead         = true;
            SerachAllDirectoriesInFolderReading = false;
            ReadSingleImageAsParentFolder       = true;
            SeekbarColor = Colors.Black;
            SeekBarIsMoveToPointEnabled             = true;
            MouseCursorAutoHide                     = true;
            MouseCursorAutoHideInFullScreenModeOnly = false;
            OperationSlideDuration                  = 300;
            EnableScreenSnap = true;
            EnableWindowSnap = true;
            ScreenSnapRange  = 10;
            WindowSnapRange  = 10;
        }