private void MagicLenPage_OnOrientationChanged(object sender, OrientationChangedEventArgs e) { ControlOrientation orientation = ControlOrientation.Default; switch (e.Orientation) { case PageOrientation.LandscapeLeft: orientation = ControlOrientation.Clockwise270Degrees; break; case PageOrientation.LandscapeRight: orientation = ControlOrientation.Clockwise90Degrees; break; } ardisplay.Orientation = orientation; }
// Constructor for Deserialization #region public Transition(SerializationInfo info, StreamingContext context) : base(info, context) public Transition(SerializationInfo info, StreamingContext context) : base(info, context) { // This call is required by the Windows.Forms Form Designer. InitializeComponent(); this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); this.UpdateStyles(); this.Location = (Point)info.GetValue("location", typeof(Point)); this.coOrientation = (ControlOrientation)info.GetValue("orientation", typeof(ControlOrientation)); this.alInputPorts.Add(new Port(1, this.Region)); this.alOutputPorts.Add(new Port(1, this.Region)); // To set region, call resize this.Transition_Resize(this, EventArgs.Empty); }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { base.OnOrientationChanged(e); ControlOrientation orientation = ControlOrientation.Default; switch (e.Orientation) { case PageOrientation.LandscapeLeft: orientation = ControlOrientation.Clockwise270Degrees; break; case PageOrientation.LandscapeRight: orientation = ControlOrientation.Clockwise90Degrees; break; } ardisplay.Orientation = orientation; }
private void EnsureViewport() { // Only do this once if (viewport.Width == 0 || previousOrientation != currentOrientation || viewPortNeedsRebuilding) { // Initialize the viewport and matrixes for 3d projection. // Create the ViewPort based on the size of ourselves (the view) and not the screen. That's // becase the View should be sized to the camera preview, which is not the same size as // the Page or Window. viewport = new Viewport(0, 0, (int)this.ActualWidth, (int)this.ActualHeight); viewPortNeedsRebuilding = false; float aspect = viewport.AspectRatio; projection = Matrix.CreatePerspectiveFieldOfView(1, aspect, (float)NearClippingPlane, (float)FarClippingPlane); // Rotate items by adjusting camera's up vector Vector3 cameraUpVector = Vector3.Up; switch (currentOrientation) { case ControlOrientation.Clockwise270Degrees: cameraUpVector = Vector3.Right; break; case ControlOrientation.Clockwise90Degrees: cameraUpVector = Vector3.Left; break; #if WIN_RT case ControlOrientation.Clockwise180Degrees: cameraUpVector = Vector3.Down; break; #endif } view = Matrix.CreateLookAt(new Vector3(0, 0, 1), Vector3.Zero, cameraUpVector); previousOrientation = currentOrientation; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); try { bool blnIndicateChildren = bool.Parse(GetValue(IndicateChildren, "True")); string strRightArrow; string strDownArrow; var objSkins = new SkinController(); //image for right facing arrow if (!String.IsNullOrEmpty(IndicateChildImageSub)) { strRightArrow = IndicateChildImageSub; } else { strRightArrow = "breadcrumb.gif"; //removed APPIMAGEPATH token - https://www.dnnsoftware.com/Community/ForumsDotNetNuke/tabid/795/forumid/76/threadid/85554/scope/posts/Default.aspx } //image for down facing arrow if (!String.IsNullOrEmpty(IndicateChildImageRoot)) { strDownArrow = IndicateChildImageRoot; } else { strDownArrow = "menu_down.gif"; //removed APPIMAGEPATH token - https://www.dnnsoftware.com/Community/ForumsDotNetNuke/tabid/795/forumid/76/threadid/85554/scope/posts/Default.aspx } //Set correct image path for all separator images if (!String.IsNullOrEmpty(SeparatorHTML)) { SeparatorHTML = FixImagePath(SeparatorHTML); } if (!String.IsNullOrEmpty(SeparatorLeftHTML)) { SeparatorLeftHTML = FixImagePath(SeparatorLeftHTML); } if (!String.IsNullOrEmpty(SeparatorRightHTML)) { SeparatorRightHTML = FixImagePath(SeparatorRightHTML); } if (!String.IsNullOrEmpty(SeparatorLeftHTMLBreadCrumb)) { SeparatorLeftHTMLBreadCrumb = FixImagePath(SeparatorLeftHTMLBreadCrumb); } if (!String.IsNullOrEmpty(SeparatorRightHTMLBreadCrumb)) { SeparatorRightHTMLBreadCrumb = FixImagePath(SeparatorRightHTMLBreadCrumb); } if (!String.IsNullOrEmpty(SeparatorLeftHTMLActive)) { SeparatorLeftHTMLActive = FixImagePath(SeparatorLeftHTMLActive); } if (!String.IsNullOrEmpty(SeparatorRightHTMLActive)) { SeparatorRightHTMLActive = FixImagePath(SeparatorRightHTMLActive); } if (!String.IsNullOrEmpty(NodeLeftHTMLBreadCrumbRoot)) { NodeLeftHTMLBreadCrumbRoot = FixImagePath(NodeLeftHTMLBreadCrumbRoot); } if (!String.IsNullOrEmpty(NodeRightHTMLBreadCrumbRoot)) { NodeRightHTMLBreadCrumbRoot = FixImagePath(NodeRightHTMLBreadCrumbRoot); } if (!String.IsNullOrEmpty(NodeLeftHTMLBreadCrumbSub)) { NodeLeftHTMLBreadCrumbSub = FixImagePath(NodeLeftHTMLBreadCrumbSub); } if (!String.IsNullOrEmpty(NodeRightHTMLBreadCrumbSub)) { NodeRightHTMLBreadCrumbSub = FixImagePath(NodeRightHTMLBreadCrumbSub); } if (!String.IsNullOrEmpty(NodeLeftHTMLRoot)) { NodeLeftHTMLRoot = FixImagePath(NodeLeftHTMLRoot); } if (!String.IsNullOrEmpty(NodeRightHTMLRoot)) { NodeRightHTMLRoot = FixImagePath(NodeRightHTMLRoot); } if (!String.IsNullOrEmpty(NodeLeftHTMLSub)) { NodeLeftHTMLSub = FixImagePath(NodeLeftHTMLSub); } if (!String.IsNullOrEmpty(NodeRightHTMLSub)) { NodeRightHTMLSub = FixImagePath(NodeRightHTMLSub); } if (String.IsNullOrEmpty(PathImage)) { PathImage = PortalSettings.HomeDirectory; } if (blnIndicateChildren) { IndicateChildImageSub = strRightArrow; if (ControlOrientation.ToLowerInvariant() == "vertical") { IndicateChildImageRoot = strRightArrow; } else { IndicateChildImageRoot = strDownArrow; } } else { IndicateChildImageSub = "[APPIMAGEPATH]spacer.gif"; } PathSystemScript = Globals.ApplicationPath + "/controls/SolpartMenu/"; PathSystemImage = "[APPIMAGEPATH]"; BuildNodes(null); } catch (Exception exc) { Exceptions.ProcessModuleLoadException(this, exc); } }
/// <summary> /// The Page_Load server event handler on this page is used /// to populate the role information for the page /// </summary> protected override void OnLoad(EventArgs e) { base.OnLoad(e); try { bool blnUseSkinPathArrowImages = bool.Parse(GetValue(UseSkinPathArrowImages, "False")); bool blnUseRootBreadcrumbArrow = bool.Parse(GetValue(UseRootBreadCrumbArrow, "True")); bool blnUseSubMenuBreadcrumbArrow = bool.Parse(GetValue(UseSubMenuBreadCrumbArrow, "False")); bool blnUseArrows = bool.Parse(GetValue(UseArrows, "True")); bool blnRootOnly = bool.Parse(GetValue(RootOnly, "False")); string strRootBreadcrumbArrow; string strSubMenuBreadcrumbArrow; string strRightArrow; string strDownArrow; if (blnRootOnly) { blnUseArrows = false; PopulateNodesFromClient = false; StartTabId = -1; ExpandDepth = 1; } var objSkins = new SkinController(); //image for root menu breadcrumb marking if (!String.IsNullOrEmpty(RootBreadCrumbArrow)) { strRootBreadcrumbArrow = PortalSettings.ActiveTab.SkinPath + RootBreadCrumbArrow; } else { strRootBreadcrumbArrow = Globals.ApplicationPath + "/images/breadcrumb.gif"; } //image for submenu breadcrumb marking if (!String.IsNullOrEmpty(SubMenuBreadCrumbArrow)) { strSubMenuBreadcrumbArrow = PortalSettings.ActiveTab.SkinPath + SubMenuBreadCrumbArrow; } if (blnUseSubMenuBreadcrumbArrow) { strSubMenuBreadcrumbArrow = Globals.ApplicationPath + "/images/breadcrumb.gif"; NodeLeftHTMLBreadCrumbSub = "<img alt=\"*\" BORDER=\"0\" src=\"" + strSubMenuBreadcrumbArrow + "\">"; } if (blnUseRootBreadcrumbArrow) { NodeLeftHTMLBreadCrumbRoot = "<img alt=\"*\" BORDER=\"0\" src=\"" + strRootBreadcrumbArrow + "\">"; } //image for right facing arrow if (!String.IsNullOrEmpty(RightArrow)) { strRightArrow = RightArrow; } else { strRightArrow = "breadcrumb.gif"; } if (!String.IsNullOrEmpty(DownArrow)) { strDownArrow = DownArrow; } else { strDownArrow = "menu_down.gif"; } //Set correct image path for all separator images if (!String.IsNullOrEmpty(Separator)) { if (Separator.IndexOf("src=") != -1) { Separator = Separator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparator)) { if (LeftSeparator.IndexOf("src=") != -1) { LeftSeparator = LeftSeparator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparator)) { if (RightSeparator.IndexOf("src=") != -1) { RightSeparator = RightSeparator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparatorBreadCrumb)) { if (LeftSeparatorBreadCrumb.IndexOf("src=") != -1) { LeftSeparatorBreadCrumb = LeftSeparatorBreadCrumb.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparatorBreadCrumb)) { if (RightSeparatorBreadCrumb.IndexOf("src=") != -1) { RightSeparatorBreadCrumb = RightSeparatorBreadCrumb.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparatorActive)) { if (LeftSeparatorActive.IndexOf("src=") != -1) { LeftSeparatorActive = LeftSeparatorActive.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparatorActive)) { if (RightSeparatorActive.IndexOf("src=") != -1) { RightSeparatorActive = RightSeparatorActive.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } //generate dynamic menu if (blnUseSkinPathArrowImages) { PathSystemImage = PortalSettings.ActiveTab.SkinPath; } else { PathSystemImage = Globals.ApplicationPath + "/images/"; } if (String.IsNullOrEmpty(PathImage)) { PathImage = PortalSettings.HomeDirectory; } if (blnUseArrows) { IndicateChildImageSub = strRightArrow; if (ControlOrientation.ToLower() == "vertical") //NavigationProvider.NavigationProvider.Orientation.Vertical Then { IndicateChildImageRoot = strRightArrow; } else { IndicateChildImageRoot = strDownArrow; } } else { PathSystemImage = Globals.ApplicationPath + "/images/"; IndicateChildImageSub = "spacer.gif"; } if (String.IsNullOrEmpty(PathSystemScript)) { PathSystemScript = Globals.ApplicationPath + "/controls/SolpartMenu/"; } BuildNodes(null); } catch (Exception exc) //Module failed to load { Exceptions.ProcessModuleLoadException(this, exc); } }
/// <summary> /// Occurs when <see cref="Orientation"/> property has changed /// </summary> /// <param name="e"></param> protected override void OnOrientationChanged(DependencyPropertyChangedEventArgs e) { currentOrientation = (ControlOrientation)(e.NewValue); base.OnOrientationChanged(e); }
protected override void OnPreRender(EventArgs e) { using (new DNNContext(this)) { var blnUseSkinPathArrowImages = Boolean.Parse(GetValue(UseSkinPathArrowImages, "false")); var blnUseRootBreadcrumbArrow = Boolean.Parse(GetValue(UseRootBreadCrumbArrow, "true")); var blnUseSubMenuBreadcrumbArrow = Boolean.Parse(GetValue(UseSubMenuBreadCrumbArrow, "false")); var blnUseArrows = Boolean.Parse(GetValue(UseArrows, "true")); var blnRootOnly = Boolean.Parse(GetValue(RootOnly, "false")); if (blnRootOnly) { blnUseArrows = false; PopulateNodesFromClient = false; StartTabId = -1; ExpandDepth = 1; } var strRootBreadcrumbArrow = !String.IsNullOrEmpty(RootBreadCrumbArrow) ? PortalSettings.ActiveTab.SkinPath + RootBreadCrumbArrow : ResolveUrl("~/images/breadcrumb.gif"); if (blnUseSubMenuBreadcrumbArrow) { var strSubMenuBreadcrumbArrow = ResolveUrl("~/images/breadcrumb.gif"); NodeLeftHTMLBreadCrumbSub = "<img alt='*' BORDER='0' src='" + strSubMenuBreadcrumbArrow + "'>"; } if (blnUseRootBreadcrumbArrow) { NodeLeftHTMLBreadCrumbRoot = "<img alt='*' BORDER='0' src='" + strRootBreadcrumbArrow + "'>"; } var strRightArrow = !String.IsNullOrEmpty(RightArrow) ? RightArrow : "breadcrumb.gif"; var strDownArrow = !String.IsNullOrEmpty(DownArrow) ? DownArrow : "menu_down.gif"; if (!String.IsNullOrEmpty(Separator)) { if (Separator.IndexOf("src=") != -1) { Separator = Separator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparator)) { if (LeftSeparator.IndexOf("src=") != -1) { LeftSeparator = LeftSeparator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparator)) { if (RightSeparator.IndexOf("src=") != -1) { RightSeparator = RightSeparator.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparatorBreadCrumb)) { if (LeftSeparatorBreadCrumb.IndexOf("src=") != -1) { LeftSeparatorBreadCrumb = LeftSeparatorBreadCrumb.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparatorBreadCrumb)) { if (RightSeparatorBreadCrumb.IndexOf("src=") != -1) { RightSeparatorBreadCrumb = RightSeparatorBreadCrumb.Replace( "src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(LeftSeparatorActive)) { if (LeftSeparatorActive.IndexOf("src=") != -1) { LeftSeparatorActive = LeftSeparatorActive.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } if (!String.IsNullOrEmpty(RightSeparatorActive)) { if (RightSeparatorActive.IndexOf("src=") != -1) { RightSeparatorActive = RightSeparatorActive.Replace("src=\"", "src=\"" + PortalSettings.ActiveTab.SkinPath); } } PathSystemImage = blnUseSkinPathArrowImages ? PortalSettings.ActiveTab.SkinPath : ResolveUrl("~/images/"); PathImage = PortalSettings.HomeDirectory; if (blnUseArrows) { IndicateChildImageSub = strRightArrow; IndicateChildImageRoot = (ControlOrientation.ToLower() == "vertical") ? strRightArrow : strDownArrow; } else { PathSystemImage = ResolveUrl("~/images/"); IndicateChildImageSub = "spacer.gif"; } if (String.IsNullOrEmpty(PathSystemScript)) { PathSystemScript = ResolveUrl("~/controls/SolpartMenu/"); } Control.Bind(GetNavigationNodes(null)); base.OnPreRender(e); } }