示例#1
0
        static PresetProfile()
        {
            // デフォルト
            Default      = new Profile();
            Default.Name = "デフォルト";
            PropertyInfo[] infoArray = Default.GetType().GetProperties();
            foreach (PropertyInfo info in infoArray)
            {
                ProfileMember.IProfileMember member = info.GetValue(Default, null) as ProfileMember.IProfileMember;
                if (member != null)
                {
                    member.IsEnabled = true;
                }
            }
            Default.Path.IsEnabled          = false;
            Default.LastPageIndex.IsEnabled = false;
            Default.WindowPos.IsEnabled     = false;

            // 書籍用(左綴じ)
            BookBoundOnLeftSide = new Profile();
            BookBoundOnLeftSide.NumofMatrix.IsEnabled          = true;
            BookBoundOnLeftSide.AspectRatio.IsEnabled          = true;
            BookBoundOnLeftSide.NonFixAspectRatio.IsEnabled    = true;
            BookBoundOnLeftSide.SlideDirection.IsEnabled       = true;
            BookBoundOnLeftSide.UseDefaultTileOrigin.IsEnabled = true;
            BookBoundOnLeftSide.DetectionOfSpread.IsEnabled    = true;

            BookBoundOnLeftSide.Name = "書籍用(左綴じ)";
            BookBoundOnLeftSide.NumofMatrix.Value          = new int[] { 2, 1 };
            BookBoundOnLeftSide.AspectRatio.Value          = new int[] { 2, 3 };
            BookBoundOnLeftSide.NonFixAspectRatio.Value    = true;
            BookBoundOnLeftSide.SlideDirection.Value       = SlideDirection.Left;
            BookBoundOnLeftSide.UseDefaultTileOrigin.Value = true;
            BookBoundOnLeftSide.DetectionOfSpread.Value    = DetectionOfSpread.ByWideImage;


            // 書籍用(右綴じ)
            BookBoundOnRightSide = new Profile();
            BookBoundOnRightSide.NumofMatrix.IsEnabled          = true;
            BookBoundOnRightSide.AspectRatio.IsEnabled          = true;
            BookBoundOnRightSide.NonFixAspectRatio.IsEnabled    = true;
            BookBoundOnRightSide.SlideDirection.IsEnabled       = true;
            BookBoundOnRightSide.UseDefaultTileOrigin.IsEnabled = true;
            BookBoundOnRightSide.DetectionOfSpread.IsEnabled    = true;

            BookBoundOnRightSide.Name = "書籍用(右綴じ)";
            BookBoundOnRightSide.NumofMatrix.Value          = new int[] { 2, 1 };
            BookBoundOnRightSide.AspectRatio.Value          = new int[] { 2, 3 };
            BookBoundOnRightSide.NonFixAspectRatio.Value    = true;
            BookBoundOnRightSide.SlideDirection.Value       = SlideDirection.Right;
            BookBoundOnRightSide.UseDefaultTileOrigin.Value = true;
            BookBoundOnRightSide.DetectionOfSpread.Value    = DetectionOfSpread.ByWideImage;

            // リスト
            Items.Add(Default);
            Items.Add(BookBoundOnLeftSide);
            Items.Add(BookBoundOnRightSide);
        }
示例#2
0
        /// <summary>
        /// クローン
        /// </summary>
        /// <returns></returns>
        public Profile Clone()
        {
            Profile newProfile = new Profile();

            PropertyInfo[] infoArraySrc  = this.GetType().GetProperties();
            PropertyInfo[] infoArrayDest = newProfile.GetType().GetProperties();

            for (int i = 0; i < infoArraySrc.Count(); i++)
            {
                ProfileMember.IProfileMember memberSrc  = infoArraySrc[i].GetValue(this, null) as ProfileMember.IProfileMember;
                ProfileMember.IProfileMember memberDest = infoArrayDest[i].GetValue(newProfile, null) as ProfileMember.IProfileMember;

                if (memberSrc != null && memberDest != null)
                {
                    memberDest.IsEnabled = memberSrc.IsEnabled;
                }
            }

            // Profile data
            newProfile.Name        = this.Name;
            newProfile.ProfileType = this.ProfileType;

            // 読み込み
            newProfile.Path.Value              = new List <string>(this.Path.Value);
            newProfile.LastPageIndex.Value     = this.LastPageIndex.Value;
            newProfile.DetectionOfSpread.Value = this.DetectionOfSpread.Value;

            // 行列設定
            Array.Copy(this.NumofMatrix.Value, newProfile.NumofMatrix.Value, 2);

            // アスペクト比設定
            Array.Copy(this.AspectRatio.Value, newProfile.AspectRatio.Value, 2);
            newProfile.NonFixAspectRatio.Value = this.NonFixAspectRatio.Value;

            // スライドの設定
            newProfile.SlidePlayMethod.Value          = this.SlidePlayMethod.Value;
            newProfile.SlideSpeed.Value               = this.SlideSpeed.Value;
            newProfile.SlideInterval.Value            = this.SlideInterval.Value;
            newProfile.SlideDirection.Value           = this.SlideDirection.Value;
            newProfile.SlideTimeInIntevalMethod.Value = this.SlideTimeInIntevalMethod.Value;
            newProfile.SlideByOneImage.Value          = this.SlideByOneImage.Value;
            newProfile.SlideShowAutoStart.Value       = this.SlideShowAutoStart.Value;

            // その他の設定_全般
            newProfile.FileSortMethod.Value          = this.FileSortMethod.Value;
            newProfile.TopMost.Value                 = this.TopMost.Value;
            newProfile.ApplyRotateInfoFromExif.Value = this.ApplyRotateInfoFromExif.Value;
            newProfile.BitmapDecodeTotalPixel.Value  = this.BitmapDecodeTotalPixel.Value;

            // その他の設定_配置
            newProfile.UseDefaultTileOrigin.Value = this.UseDefaultTileOrigin.Value;
            newProfile.TileOrigin.Value           = this.TileOrigin.Value;
            newProfile.TileOrientation.Value      = this.TileOrientation.Value;
            newProfile.TileImageStretch.Value     = this.TileImageStretch.Value;

            // その他の設定_外観1
            newProfile.AllowTransparency.Value          = this.AllowTransparency.Value;
            newProfile.OverallOpacity.Value             = this.OverallOpacity.Value;
            newProfile.BackgroundOpacity.Value          = this.BackgroundOpacity.Value;
            newProfile.BaseGridBackgroundColor.Value    = this.BaseGridBackgroundColor.Value;
            newProfile.UsePlaidBackground.Value         = this.UsePlaidBackground.Value;
            newProfile.PairColorOfPlaidBackground.Value = this.PairColorOfPlaidBackground.Value;

            // その他の設定_外観2
            newProfile.ResizeGripThickness.Value = this.ResizeGripThickness.Value;
            newProfile.ResizeGripColor.Value     = this.ResizeGripColor.Value;
            newProfile.TilePadding.Value         = this.TilePadding.Value;
            newProfile.GridLineColor.Value       = this.GridLineColor.Value;

            // ダイアログにはない設定
            newProfile.WindowPos.Value        = new Point(this.WindowPos.Value.X, this.WindowPos.Y);
            newProfile.WindowSize.Value       = new Size(this.WindowSize.Value.Width, this.WindowSize.Height);
            newProfile.IsFullScreenMode.Value = this.IsFullScreenMode.Value;


            return(newProfile);
        }