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)); }
/// <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()); } }
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()); }
private static String GetVisualStateName(PageOrientation orientation) { return orientation.ToString(); }
// 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; }
// 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; }
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); }
private static String GetVisualStateName(PageOrientation orientation) { return(orientation.ToString()); }