当前位置: 首页>>代码示例>>C#>>正文


C# PageOrientation类代码示例

本文整理汇总了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;
        }
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:30,代码来源:OrientationHelper.cs

示例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();
        }
开发者ID:dqtruong,项目名称:PhotoViewer,代码行数:30,代码来源:MainPage.xaml.cs

示例3: ThreadView

 public ThreadView()
 {
     InitializeComponent();
     BindEvents();
     this.SupportedOrientations = SupportedPageOrientation.PortraitOrLandscape;
     this._currentOrientation = this.Orientation;
     this._defaultAppBar = this.ApplicationBar;
 }
开发者ID:bootlegrobot,项目名称:awful,代码行数:8,代码来源:ThreadView.xaml.cs

示例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";

        }
开发者ID:khalidcawl,项目名称:Auto-snapshot,代码行数:9,代码来源:ExportSettings.cs

示例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);
            }
        }
开发者ID:Gunner92,项目名称:Xamarin-Forms-Labs,代码行数:9,代码来源:PageExtensions.cs

示例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.");
        }
开发者ID:BackupTheBerlios,项目名称:zp7-svn,代码行数:35,代码来源:PrintTarget.cs

示例7: MainPage

        // Constructor
        public MainPage()
        {
            InitializeComponent();
            var locator = new ViewModelLocator();
            _mainViewModel = locator.Main;
            DataContext = _mainViewModel;

            OrientationChanged += MainPageOrientationChanged;
            _lastOrientation = Orientation;

            UpdateOrientation();
        }
开发者ID:tym32167,项目名称:calculon,代码行数:13,代码来源:MainPage.xaml.cs

示例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;
            }
        }
开发者ID:wuchangqi,项目名称:ifixit-microsoft,代码行数:53,代码来源:Details.xaml.cs

示例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);
                }

            }
        }
开发者ID:punker76,项目名称:XAMLResponsiveStyles,代码行数:52,代码来源:ResponsiveOrientation.cs

示例10: handleChangeEvents

        void handleChangeEvents(Size size, PageOrientation orientation)
        {
            if (ResponsiveMethods == null)
                return;

            foreach (var method in ResponsiveMethods)
            {
                method.HandleChange(size,
                                    orientation,
                                    this.Resources.MergedDictionaries);
            }

        }
开发者ID:punker76,项目名称:XAMLResponsiveStyles,代码行数:13,代码来源:ResponsiveApp.cs

示例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();
        }
开发者ID:dmourainatel,项目名称:Windows-Phone-Projects,代码行数:18,代码来源:Viewfinder.xaml.cs

示例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();
 }
开发者ID:NotNemesis,项目名称:cardmaker,代码行数:15,代码来源:PdfSharpExporter.cs

示例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);
			}
		}
开发者ID:Synergex,项目名称:Baconography,代码行数:15,代码来源:MainPage.xaml.cs

示例14: CampusMapPage

 public CampusMapPage()
 {
     this.InitializeComponent();
     this.initialScale = 1.0;
     this.previousOrientation = base.Orientation;
     base.OrientationChanged += FullImage_OrientationChanged;
 }
开发者ID:kventin,项目名称:Windows-Phone-Starter-Kit-for-Schools,代码行数:7,代码来源:CampusMapPage.xaml.cs

示例15: MainPage

 // Constructor
 public MainPage()
 {
     InitializeComponent();
     this.Loaded += MainPage_Loaded;
     lastOrientation = this.Orientation;
    
 }
开发者ID:jacevedo,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs


注:本文中的PageOrientation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。