本文整理汇总了C#中PageOrientation类的典型用法代码示例。如果您正苦于以下问题:C# PageOrientation类的具体用法?C# PageOrientation怎么用?C# PageOrientation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PageOrientation类属于命名空间,在下文中一共展示了PageOrientation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRotationAngle
/// <summary>
/// Converts the <paramref name="orientation"/> given to a proper page rotation angle, in degrees.
/// </summary>
/// <param name="orientation">Page orientation.</param>
/// <returns>Rotation angle.</returns>
public static int GetRotationAngle(PageOrientation orientation)
{
int angle = 0;
switch (orientation)
{
case PageOrientation.None:
case PageOrientation.Portrait:
case PageOrientation.PortraitUp:
angle = 90;
break;
case PageOrientation.PortraitDown:
angle = 270;
break;
case PageOrientation.Landscape:
case PageOrientation.LandscapeLeft:
angle = 0;
break;
case PageOrientation.LandscapeRight:
angle = 180;
break;
}
return angle;
}
示例2: RotateIamgeViewer
private void RotateIamgeViewer(PageOrientation orientation)
{
var duration = new Duration(TimeSpan.FromSeconds(0.5));
var sb = new Storyboard();
sb.Duration = duration;
var da = new DoubleAnimation();
da.Duration = duration;
sb.Children.Add(da);
//Storyboard.SetTarget(da, mediaViewerTranform);
Storyboard.SetTarget(da, mediaViewerTransform);
Storyboard.SetTargetProperty(da, new PropertyPath("Rotation"));
if (orientation == PageOrientation.Landscape ||
orientation == PageOrientation.LandscapeLeft ||
orientation == PageOrientation.LandscapeRight)
{
da.From = 90;
da.To = 0;
}
else if (orientation == PageOrientation.Portrait ||
orientation == PageOrientation.PortraitDown ||
orientation == PageOrientation.PortraitUp)
{
da.From = -90;
da.To = 0;
}
sb.Begin();
}
示例3: ThreadView
public ThreadView()
{
InitializeComponent();
BindEvents();
this.SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;
this._currentOrientation = this.Orientation;
this._defaultAppBar = this.ApplicationBar;
}
示例4: ExportSettings
public ExportSettings()
{
m_page_orientation = PageOrientation.Landscape;
if (GetTotalScreens() > 1)
m_template_doc_path = Directory.GetParent(Assembly.GetExecutingAssembly().Location) + "\\Documents\\Template Landscape.docx";
else
m_template_doc_path = Directory.GetParent(Assembly.GetExecutingAssembly().Location) + "\\Documents\\Template Portrait.docx";
}
示例5: SetOrientation
public static void SetOrientation(this PhoneApplicationPage page, PageOrientation? orientation = null)
{
var app = Resolver.Resolve<IXFormsApp>() as XFormsAppWP;
if (app != null)
{
app.SetOrientation(orientation ?? page.Orientation);
}
}
示例6: GetPageSize
//PdfPage m_page;
//public PdfPrintTarget(PdfPage page)
//{
// m_page = page;
//}
/*
#region IPrintTarget Members
public float Width
{
get { return PageSizeConverter.ToSize(m_page.Size).Width; }
}
public float Height
{
get { return PageSizeConverter.ToSize(m_page.Size).Height; }
}
#endregion
*/
#region IPrintTarget Members
public SizeF GetPageSize(PageOrientation orientation)
{
switch (orientation)
{
case PageOrientation.Portrait:
return new SizeF(m_size.Width, m_size.Height);
case PageOrientation.Landscape:
return new SizeF(m_size.Height, m_size.Width);
}
throw new Exception("The method or operation is not implemented.");
}
示例7: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
var locator = new ViewModelLocator();
_mainViewModel = locator.Main;
DataContext = _mainViewModel;
OrientationChanged += MainPageOrientationChanged;
_lastOrientation = Orientation;
UpdateOrientation();
}
示例8: SetOrientation
private void SetOrientation(PageOrientation orientation)
{
switch (orientation)
{
case PageOrientation.Landscape:
case PageOrientation.LandscapeLeft:
case PageOrientation.LandscapeRight:
case PageOrientation.None:
TopMenu.Visibility = System.Windows.Visibility.Collapsed;
break;
case PageOrientation.Portrait:
case PageOrientation.PortraitDown:
case PageOrientation.PortraitUp:
TopMenu.Visibility = System.Windows.Visibility.Visible;
break;
default:
break;
}
switch (orientation)
{
case PageOrientation.Landscape:
break;
case PageOrientation.LandscapeLeft:
ContentPanel.Margin = new Thickness(0, 0, 75, 0);
IndexNav.Margin = new Thickness(0, 0, 75, 0);
break;
case PageOrientation.LandscapeRight:
ContentPanel.Margin = new Thickness(75, 0, 0, 0);
IndexNav.Margin = new Thickness(75, 0, 0, 0);
break;
case PageOrientation.None:
case PageOrientation.Portrait:
case PageOrientation.PortraitDown:
case PageOrientation.PortraitUp:
default:
ContentPanel.Margin = new Thickness(0, 0, 0, 0);
IndexNav.Margin = new Thickness(0, 0, 0, 0);
break;
}
}
示例9: determineStyle
void determineStyle(PageOrientation newOrientation, IList<ResourceDictionary> resources)
{
var lastOrientation = state;
state = newOrientation;
//some flags to simplify detecting an orientation change
var wasBlank = (lastOrientation == null ||
lastOrientation == PageOrientation.None);
var wasPortrait = (lastOrientation == PageOrientation.Portrait ||
lastOrientation == PageOrientation.PortraitDown ||
lastOrientation == PageOrientation.PortraitUp);
var wasLandscape = (lastOrientation == PageOrientation.Landscape ||
lastOrientation == PageOrientation.LandscapeLeft ||
lastOrientation == PageOrientation.LandscapeRight);
var isPortrait = (newOrientation == PageOrientation.Portrait ||
newOrientation == PageOrientation.PortraitDown ||
newOrientation == PageOrientation.PortraitUp);
var isLandscape = (newOrientation == PageOrientation.Landscape ||
newOrientation == PageOrientation.LandscapeLeft ||
newOrientation == PageOrientation.LandscapeRight);
//STYLE SWITCHING
//only switch on orientation change
if (isLandscape && (wasBlank || wasPortrait))
{
//clear existing responsive styles if any
removeExistingStyles(resources);
//add compact style xaml to resources
if (this.LandscapeStyles != null)
{
foreach (var style in this.LandscapeStyles)
resources.Add(style);
}
}
else if (isPortrait && (wasBlank || wasLandscape))
{
//clear existing responsive styles if any
removeExistingStyles(resources);
//add regular style xaml to resources
if (this.PortraitStyles != null)
{
foreach (var style in this.PortraitStyles)
resources.Add(style);
}
}
}
示例10: handleChangeEvents
void handleChangeEvents(Size size, PageOrientation orientation)
{
if (ResponsiveMethods == null)
return;
foreach (var method in ResponsiveMethods)
{
method.HandleChange(size,
orientation,
this.Resources.MergedDictionaries);
}
}
示例11: OnOrientationChanged
/// <summary>
/// Tells the Viewfinder to update its UI to reflect a new PageOrientation
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
public void OnOrientationChanged(PageOrientation newOrientation)
{
if (IsPortrait(newOrientation))
{
this.rotateArrowButtonToPortrait.Begin();
}
else
{
this.rotateArrowButtonToLandscape.Begin();
}
ApplyRotation();
}
示例12: PdfSharpExporter
public PdfSharpExporter(int nLayoutStartIndex, int nLayoutEndIndex, string sExportFile, string sPageOrientation)
: base(nLayoutStartIndex, nLayoutEndIndex)
{
m_sExportFile = sExportFile;
try
{
m_ePageOrientation = (PageOrientation)Enum.Parse(typeof(PageOrientation), sPageOrientation);
}
catch (Exception)
{
Logger.AddLogLine(sPageOrientation + " is an unknow page orientation.");
}
m_zDocument = new PdfDocument();
AddPage();
}
示例13: AdjustForOrientation
private void AdjustForOrientation(PageOrientation orientation)
{
Messenger.Default.Send<OrientationChangedMessage>(new OrientationChangedMessage { Orientation = orientation });
lastKnownOrientation = orientation;
if (LayoutRoot != null)
{
if (orientation == PageOrientation.LandscapeRight)
LayoutRoot.Margin = new Thickness(40, 0, 0, 0);
else if (orientation == PageOrientation.LandscapeLeft)
LayoutRoot.Margin = new Thickness(0, 0, 35, 0);
else
LayoutRoot.Margin = new Thickness(0, 0, 0, 0);
}
}
示例14: CampusMapPage
public CampusMapPage()
{
this.InitializeComponent();
this.initialScale = 1.0;
this.previousOrientation = base.Orientation;
base.OrientationChanged += FullImage_OrientationChanged;
}
示例15: MainPage
// Constructor
public MainPage()
{
InitializeComponent();
this.Loaded += MainPage_Loaded;
lastOrientation = this.Orientation;
}