Exemplo n.º 1
0
 public void StoreValues(Data data, string path)
 {
     CompressColorAndGray.StoreValues(data, path + @"CompressColorAndGray\");
     CompressMonochrome.StoreValues(data, path + @"CompressMonochrome\");
     Security.StoreValues(data, path + @"Security\");
     Signature.StoreValues(data, path + @"Signature\");
     data.SetValue(@"" + path + @"ColorModel", ColorModel.ToString());
     data.SetValue(@"" + path + @"DocumentView", DocumentView.ToString());
     data.SetValue(@"" + path + @"PageOrientation", PageOrientation.ToString());
     data.SetValue(@"" + path + @"PageView", PageView.ToString());
     data.SetValue(@"" + path + @"ViewerStartsOnPage", ViewerStartsOnPage.ToString(System.Globalization.CultureInfo.InvariantCulture));
 }
Exemplo n.º 2
0
        /// <summary>
        /// 表示用の名称を取得する
        /// </summary>
        /// <param name="pageOrient">this PageOrientation</param>
        /// <returns>文字列</returns>
        public static string ToDisplayName(this PageOrientation pageOrient)
        {
            switch (pageOrient)
            {
            case PageOrientation.Landscape: return("横");

            case PageOrientation.Portrait: return("縦");

            case PageOrientation.Unknown: return("不明");

            default:
                return(pageOrient.ToString());
            }
        }
Exemplo n.º 3
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendLine("[CompressColorAndGray]");
            sb.AppendLine(CompressColorAndGray.ToString());
            sb.AppendLine("[CompressMonochrome]");
            sb.AppendLine(CompressMonochrome.ToString());
            sb.AppendLine("[Security]");
            sb.AppendLine(Security.ToString());
            sb.AppendLine("[Signature]");
            sb.AppendLine(Signature.ToString());
            sb.AppendLine("ColorModel=" + ColorModel.ToString());
            sb.AppendLine("DocumentView=" + DocumentView.ToString());
            sb.AppendLine("PageOrientation=" + PageOrientation.ToString());
            sb.AppendLine("PageView=" + PageView.ToString());
            sb.AppendLine("ViewerStartsOnPage=" + ViewerStartsOnPage.ToString());

            return(sb.ToString());
        }
Exemplo n.º 4
0
 private static String GetVisualStateName(PageOrientation orientation)
 {
     return orientation.ToString();
 }
Exemplo n.º 5
0
        // Handle orientation changes
        void MainPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
        {
            _to = e.Orientation;
            if (_from == PageOrientation.None)
            {
                _from = _to;
            }

            System.Diagnostics.Debug.WriteLine("From: " + _from.ToString());
            System.Diagnostics.Debug.WriteLine("To: " + _to.ToString());

            // If in portrait mode...
            if ((e.Orientation & PageOrientation.Portrait) == (PageOrientation.Portrait))
            {
                overlay.LayoutRoot.Height = Browser.Height = Application.Current.Host.Content.ActualHeight - ApplicationBar.DefaultSize;
                overlay.LayoutRoot.Width  = Browser.Width = Application.Current.Host.Content.ActualWidth;
            }
            // If in landscape mode...
            else
            {
                overlay.LayoutRoot.Height = Browser.Height = Application.Current.Host.Content.ActualWidth;
                overlay.LayoutRoot.Width  = Browser.Width = Application.Current.Host.Content.ActualHeight - ApplicationBar.DefaultSize;
            }

            switch (_from)
            {
            case PageOrientation.PortraitUp:
                switch (_to)
                {
                case PageOrientation.LandscapeLeft:
                    RotateAnimation.From = -90;
                    break;

                case PageOrientation.LandscapeRight:
                    RotateAnimation.From = 90;
                    break;

                case PageOrientation.PortraitDown:
                    RotateAnimation.From = 180;
                    break;
                }
                break;

            case PageOrientation.LandscapeLeft:
                switch (_to)
                {
                case PageOrientation.PortraitUp:
                    RotateAnimation.From = 90;
                    break;

                case PageOrientation.PortraitDown:
                    RotateAnimation.From = -90;
                    break;

                case PageOrientation.LandscapeRight:
                    RotateAnimation.From = 180;
                    break;
                }
                break;

            case PageOrientation.LandscapeRight:
                switch (_to)
                {
                case PageOrientation.PortraitUp:
                    RotateAnimation.From = -90;
                    break;

                case PageOrientation.PortraitDown:
                    RotateAnimation.From = 90;
                    break;

                case PageOrientation.LandscapeLeft:
                    RotateAnimation.From = 180;
                    break;
                }
                break;

            case PageOrientation.PortraitDown:
                switch (_to)
                {
                case PageOrientation.PortraitUp:
                    RotateAnimation.From = 180;
                    break;

                case PageOrientation.LandscapeRight:
                    RotateAnimation.From = -90;
                    break;

                case PageOrientation.LandscapeLeft:
                    RotateAnimation.From = 90;
                    break;
                }
                break;
            }
            RotateAnimation.To = 0;
            RotateStoryboard.Begin();
            _from = _to;
        }
Exemplo n.º 6
0
        // Handle orientation changes
        void MainPage_OrientationChanged(object sender, OrientationChangedEventArgs e)
        {
            _to = e.Orientation;
            if (_from == PageOrientation.None)
                _from = _to;

            System.Diagnostics.Debug.WriteLine("From: " + _from.ToString());
            System.Diagnostics.Debug.WriteLine("To: " + _to.ToString());

            // If in portrait mode...
            if ((e.Orientation & PageOrientation.Portrait) == (PageOrientation.Portrait))
            {
                overlay.LayoutRoot.Height = Browser.Height = Application.Current.Host.Content.ActualHeight - ApplicationBar.DefaultSize;
                overlay.LayoutRoot.Width = Browser.Width = Application.Current.Host.Content.ActualWidth;


            }
            // If in landscape mode...
            else
            {
                overlay.LayoutRoot.Height = Browser.Height = Application.Current.Host.Content.ActualWidth;
                overlay.LayoutRoot.Width = Browser.Width = Application.Current.Host.Content.ActualHeight - ApplicationBar.DefaultSize;
            }

            switch (_from)
            {
                case PageOrientation.PortraitUp:
                    switch (_to)
                    {
                        case PageOrientation.LandscapeLeft:
                            RotateAnimation.From = -90;
                            break;
                        case PageOrientation.LandscapeRight:
                            RotateAnimation.From = 90;
                            break;
                        case PageOrientation.PortraitDown:
                            RotateAnimation.From = 180;
                            break;
                    }
                    break;
                case PageOrientation.LandscapeLeft:
                    switch (_to)
                    {
                        case PageOrientation.PortraitUp:
                            RotateAnimation.From = 90;
                            break;
                        case PageOrientation.PortraitDown:
                            RotateAnimation.From = -90;
                            break;
                        case PageOrientation.LandscapeRight:
                            RotateAnimation.From = 180;
                            break;
                    }
                    break;
                case PageOrientation.LandscapeRight:
                    switch (_to)
                    {
                        case PageOrientation.PortraitUp:
                            RotateAnimation.From = -90;
                            break;
                        case PageOrientation.PortraitDown:
                            RotateAnimation.From = 90;
                            break;
                        case PageOrientation.LandscapeLeft:
                            RotateAnimation.From = 180;
                            break;
                    }
                    break;
                case PageOrientation.PortraitDown:
                    switch (_to)
                    {
                        case PageOrientation.PortraitUp:
                            RotateAnimation.From = 180;
                            break;
                        case PageOrientation.LandscapeRight:
                            RotateAnimation.From = -90;
                            break;
                        case PageOrientation.LandscapeLeft:
                            RotateAnimation.From = 90;
                            break;
                    }
                    break;
            }
            RotateAnimation.To = 0;
            RotateStoryboard.Begin();
            _from = _to;
        }
Exemplo n.º 7
0
 public IEnumerable <string> ComposeArg() => new List <string>
 {
     $" -O {PageOrientation.ToString()} "
 };
 public void OnOrientationChanged(PageOrientation Orientation)
 {
     // Switch to the visual state that corresponds to our target orientation
     VisualStateManager.GoToState(this, Orientation.ToString(), true);
 }
Exemplo n.º 9
0
 private static String GetVisualStateName(PageOrientation orientation)
 {
     return(orientation.ToString());
 }