/// <summary> /// Page prerender. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_PreRender(object sender, EventArgs e) { bool checkCollision = false; if (ParentZone != null) { checkCollision = ParentZone.RequiresWebPartManagement(); } else { checkCollision = (ViewMode == ViewModeEnum.Design); } if (ScriptHelper.IsPrototypeBoxRegistered() && checkCollision) { Label lblError = new Label(); lblError.EnableViewState = false; lblError.CssClass = "ErrorLabel"; lblError.Text = GetString("javascript.mootoolsprototype"); Controls.Clear(); Controls.Add(lblError); } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); bool checkCollision = false; if (ParentZone != null) { checkCollision = ParentZone.RequiresWebPartManagement(); } else { checkCollision = (ViewMode == ViewModeEnum.Design); } if (ScriptHelper.IsPrototypeBoxRegistered() && checkCollision) { Label lblError = new Label(); lblError.EnableViewState = false; lblError.CssClass = "ErrorLabel"; lblError.Text = GetString("javascript.mootoolsprototype"); Controls.Add(lblError); } else { if (StopProcessing) { Visible = false; } else { string divScript = "<div style=\"" + "width: " + (DivWidth) + "px; " + "height: " + DivHeight + "px; " + "overflow: hidden; " + "z-index: 0; " + (DivStyle) + "\">" + "<div id=\"" + ClientID + "\" style=\"" + "width: " + (DivWidth) + "px; " + "height: " + DivHeight + "px; " + "overflow:hidden;" + "visibility:hidden;" + "position:relative;\">"; ltlBefore.Text = divScript; ltlAfter.Text = "</div></div>"; // Register Slider javascript ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Viewers/Effects/ScrollingText_files/ScrollingText.js"); // Build Javascript string jScript = @"window.addEvent('load', function(){ try { var scroller_" + ClientID + " = new Sroller('" + ClientID + "'," + JsDirection + "," + JsMoveTime + "," + JsStopTime + ",'" + JsOnMouseStop + "'," + DivWidth + "," + DivHeight + @"); if (scrollernodes['" + ClientID + @"'].length != 0) { startScroller(scroller_" + ClientID + "," + (JsMoveTime + JsStopTime) + @", false); } } catch (ex) {} });"; ScriptHelper.RegisterClientScriptBlock(this, typeof(string), ("scrollingScript" + ClientID), ScriptHelper.GetScript(jScript)); // Hide control based on repeater datasource and HideControlForZeroRows property if (!repItems.HasData()) { if (!HideControlForZeroRows) { lblNoData.Text = ZeroRowsText; lblNoData.Visible = true; } else { Visible = false; } } else { Visible = repItems.Visible; } } } }
public bool Build(ShapeCollection staticGeometries, ref int numGeometryVertices, ref int numGeometryTriangles) { if (!HasEngineInstance()) { return(false); } EngineNavMesh.ClearNavMesh(); EngineNavMesh.ClearGeometry(); EngineNavMesh.ClearCarvers(); EngineNavMesh.ClearSeedPoints(); EngineNavMesh.ClearLocalSettings(); EngineNavMesh.ClearDecorationCapsules(); SetEngineInstanceBaseProperties(); HavokNavMeshGlobalSettings globalSettings = GetGlobalSettings(); if (globalSettings == null) { return(false); } BoundingBox parentZoneBbox = new BoundingBox(); if (globalSettings.RestrictToInputGeometryFromSameZone && ParentZone != null) { parentZoneBbox = ParentZone.CalculateBoundingBox(); } // check if there's a parent zone foreach (ShapeBase shape in staticGeometries) { // treat as cutter if flag is set and if in different zone bool potentiallyTreatAsCutter = globalSettings.RestrictToInputGeometryFromSameZone && (shape.ParentZone != ParentZone); if (shape is EntityShape) { EntityShape entity = shape as EntityShape; eNavMeshUsage usage = entity.GetNavMeshUsage(); // exclude entities that have a vHavokRigidBody component with "Motion Type" != "Fixed" ShapeComponentType compType = (ShapeComponentType)EditorManager.EngineManager.ComponentClassManager.GetCollectionType("vHavokRigidBody"); if (compType != null && entity.Components != null) { ShapeComponent comp = entity.Components.GetComponentByType(compType); if (comp != null) { string propValue = comp.GetPropertyValue("Motion Type") as string; if (string.Compare(propValue, "Fixed") != 0) { usage = eNavMeshUsage.ExcludeFromNavMesh; } } } // potentially override usage if (potentiallyTreatAsCutter && (usage == eNavMeshUsage.IncludeInNavMesh)) { usage = eNavMeshUsage.CutterOnly; } if (usage != eNavMeshUsage.ExcludeFromNavMesh) { EngineNavMesh.AddEntityGeometry(entity.EngineEntity.GetNativeObject(), (int)usage, parentZoneBbox); } } else if (shape is StaticMeshShape) { StaticMeshShape staticMesh = shape as StaticMeshShape; eNavMeshUsage usage = staticMesh.GetNavMeshUsage(); // potentially override usage if (potentiallyTreatAsCutter && (usage == eNavMeshUsage.IncludeInNavMesh)) { usage = eNavMeshUsage.CutterOnly; } if (usage != eNavMeshUsage.ExcludeFromNavMesh) { EngineNavMesh.AddStaticMeshGeometry(staticMesh.EngineMesh.GetNativeObject(), (int)usage, parentZoneBbox); } } else if (shape is TerrainShape) { TerrainShape terrain = shape as TerrainShape; eNavMeshUsage usage = terrain.GetNavMeshUsage(); // potentially override usage if (potentiallyTreatAsCutter && (usage == eNavMeshUsage.IncludeInNavMesh)) { usage = eNavMeshUsage.CutterOnly; } if (usage != eNavMeshUsage.ExcludeFromNavMesh) { EngineNavMesh.AddTerrainGeometry(terrain.EngineTerrain.GetNativeObject(), (int)usage, parentZoneBbox); } } #if !HK_ANARCHY else if (shape is DecorationGroupShape) { DecorationGroupShape decorationGroup = shape as DecorationGroupShape; // Please note that currently the native HavokAiEnginePlugin only supports decoration capsules as cutters. if (decorationGroup.GetNavMeshLimitedUsage() == DecorationGroupShape.eNavMeshLimitedUsage.CutterOnly) { EngineNavMesh.AddDecorationGroupCapsules(decorationGroup.EngineGroup.GetGroupsObject()); } } #endif #if USE_SPEEDTREE else if (shape is Speedtree6GroupShape) { Speedtree6GroupShape trees = shape as Speedtree6GroupShape; if (trees.EnableCollisions) { EngineNavMesh.AddSpeedTree6Capsules(trees.EngineGroup.GetGroupsObject()); } } #endif } numGeometryVertices = EngineNavMesh.GetNumGeometryVertices(); numGeometryTriangles = EngineNavMesh.GetNumGeometryTriangles(); // Add carvers ShapeCollection carvers = EditorManager.Scene.AllShapesOfType(typeof(HavokNavMeshCarverShape)); foreach (ShapeBase shape in carvers) { HavokNavMeshCarverShape carver = shape as HavokNavMeshCarverShape; BoundingBox localBbox = null; carver.GetLocalBoundingBox(ref localBbox); localBbox.vMin.X *= carver.ScaleX; localBbox.vMin.Y *= carver.ScaleY; localBbox.vMin.Z *= carver.ScaleZ; localBbox.vMax.X *= carver.ScaleX; localBbox.vMax.Y *= carver.ScaleY; localBbox.vMax.Z *= carver.ScaleZ; EngineNavMesh.AddBoxCarver(localBbox.vMin, localBbox.vMax, carver.Position, carver.RotationMatrix, carver.IsInverted()); } // Add seed points ShapeCollection seedPoints = EditorManager.Scene.AllShapesOfType(typeof(HavokNavMeshSeedPointShape)); foreach (ShapeBase shape in seedPoints) { HavokNavMeshSeedPointShape seedPoint = shape as HavokNavMeshSeedPointShape; EngineNavMesh.AddSeedPoint(seedPoint.Position); } // Add local settings ShapeCollection localSettings = EditorManager.Scene.AllShapesOfType(typeof(HavokNavMeshLocalSettingsShape)); foreach (ShapeBase shape in localSettings) { HavokNavMeshLocalSettingsShape ls = shape as HavokNavMeshLocalSettingsShape; BoundingBox bbox = null; ls.GetLocalBoundingBox(ref bbox); bbox.vMin.X *= ls.ScaleX; bbox.vMin.Y *= ls.ScaleY; bbox.vMin.Z *= ls.ScaleZ; bbox.vMax.X *= ls.ScaleX; bbox.vMax.Y *= ls.ScaleY; bbox.vMax.Z *= ls.ScaleZ; // Nav Mesh Generation Settings EngineNavMesh.m_maxWalkableSlope = ls.MaxWalkableSlope / 180.0f * 3.14159f; // Nav Mesh Edge Matching Settings EngineNavMesh.m_maxStepHeight = ls.MaxStepHeight; EngineNavMesh.m_maxSeparation = ls.MaxSeparation; EngineNavMesh.m_maxOverhang = ls.MaxOverhang; EngineNavMesh.m_cosPlanarAlignmentAngle = (float)Math.Cos(ls.PlanarAlignmentAngle / 180.0f * 3.14159f); EngineNavMesh.m_cosVerticalAlignmentAngle = (float)Math.Cos(ls.VerticalAlignmentAngle / 180.0f * 3.14159f); EngineNavMesh.m_minEdgeOverlap = ls.MinEdgeOverlap; // Nav Mesh Simplification Settings EngineNavMesh.m_maxBorderSimplifyArea = ls.MaxBorderSimplifyArea; EngineNavMesh.m_maxConcaveBorderSimplifyArea = ls.MaxConcaveBorderSimplifyArea; EngineNavMesh.m_useHeightPartitioning = ls.UseHeightPartitioning; EngineNavMesh.m_maxPartitionHeightError = ls.MaxPartitionHeightError; // Nav Mesh Simplification Settings (Advanced) EngineNavMesh.m_minCorridorWidth = ls.MinCorridorWidth; EngineNavMesh.m_maxCorridorWidth = ls.MaxCorridorWidth; EngineNavMesh.m_holeReplacementArea = ls.HoleReplacementArea; EngineNavMesh.m_maxLoopShrinkFraction = ls.MaxLoopShrinkFraction; EngineNavMesh.m_maxBorderHeightError = ls.MaxBorderHeightError; EngineNavMesh.m_maxBorderDistanceError = ls.MaxBorderDistanceError; EngineNavMesh.m_maxPartitionSize = ls.MaxPartitionSize; EngineNavMesh.m_useConservativeHeightPartitioning = ls.UseConservativeHeightPartitioning; EngineNavMesh.m_hertelMehlhornHeightError = ls.HertelMehlhornHeightError; EngineNavMesh.m_cosPlanarityThreshold = (float)Math.Cos(ls.PlanarityThreshold / 180 * 3.14159f); EngineNavMesh.m_nonconvexityThreshold = ls.NonconvexityThreshold; EngineNavMesh.m_boundaryEdgeFilterThreshold = ls.BoundaryEdgeFilterThreshold; EngineNavMesh.m_maxSharedVertexHorizontalError = ls.MaxSharedVertexHorizontalError; EngineNavMesh.m_maxSharedVertexVerticalError = ls.MaxSharedVertexVerticalError; EngineNavMesh.m_maxBoundaryVertexHorizontalError = ls.MaxBoundaryVertexHorizontalError; EngineNavMesh.m_maxBoundaryVertexVerticalError = ls.MaxBoundaryVertexVerticalError; EngineNavMesh.m_mergeLongestEdgesFirst = ls.MergeLongestEdgesFirst; EngineNavMesh.AddLocalSettings(bbox.vMin, bbox.vMax, ls.Position, ls.RotationMatrix); } // todo: figure out how to pass class instances between here and EngineNavMesh. // basically the settings members of EngineNavMesh are reused for transferring the local settings to // EngineNavMesh. this should be harmless due to the following call which will revert any changes. SetEngineInstanceBaseProperties(); string fullSnapshotPath = Path.Combine(CSharpFramework.EditorManager.Scene.Project.ProjectDir, m_snapshotFilename); bool ret = EngineNavMesh.BuildNavMeshFromGeometry(m_saveInputSnapshot, fullSnapshotPath); EngineNavMesh.ClearGeometry(); EngineNavMesh.ClearCarvers(); EngineNavMesh.ClearSeedPoints(); EngineNavMesh.ClearLocalSettings(); EngineNavMesh.ClearDecorationCapsules(); return(ret); }
/// <summary> /// OnPreRender. /// </summary> protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); bool checkCollision = false; if (ParentZone != null) { checkCollision = ParentZone.RequiresWebPartManagement(); } else { checkCollision = PortalContext.IsDesignMode(ViewMode, false); } if (ScriptHelper.IsPrototypeBoxRegistered() && checkCollision) { Label lblError = new Label(); lblError.EnableViewState = false; lblError.CssClass = "ErrorLabel"; lblError.Text = GetString("javascript.mootoolsprototype"); Controls.Add(lblError); } else { if (!StopProcessing) { ltlBefore.Text = "<div class=\"Slider\"><div class=\"Content\" id=\"" + ClientID + "\" style=\"" + StyleOptions + "\">"; // Register Slider javascript ScriptHelper.RegisterScriptFile(Page, "~/CMSWebParts/Viewers/Effects/ContentSlider_files/ContentSlider.js"); // Build Javascript string jScript = "var CurrentPage_" + ClientID + " = null; var Slider_" + ClientID + " = null; window.addEvent('domready',function(){ \n" + "try { \n" + "Slider_" + ClientID + " = new ContentSlider(\"" + ClientID + "\"," + JsFadeIn + "," + JsFadeOut + "," + JsBreak + "); \n"; if ((index != 0) && (JsAutoStart)) { jScript += "autoTurnPage(Slider_" + ClientID + ",0," + (JsFadeIn + JsFadeOut + JsBreak) + ", false); \n"; } // Set back and width of bottom div jScript += "var tmp = $('" + ClientID + "'); \n" + "tmp.style.backgroundColor = $('" + ClientID + "_page_0').style.borderTopColor; \n" + // Get element width "var elWidth = 0; if(!isNaN(parseInt(tmp.style.width.substring(0,tmp.style.width.length - 2), 10))){elWidth=parseInt(tmp.style.width.substring(0,tmp.style.width.length - 2), 10); }" + // Get border width "var borderWidth = 0; if(!isNaN(parseInt($('" + ClientID + "_page_0').style.borderLeftWidth.substring(0, $('" + ClientID + "_page_0').style.borderLeftWidth.length - 2), 10))){borderWidth=parseInt($('" + ClientID + "_page_0').style.borderLeftWidth.substring(0, $('" + ClientID + "_page_0').style.borderLeftWidth.length - 2), 10);}" + // Set total width "tmp.style.width = (elWidth+(2*borderWidth))+\"px\"; \n"; for (int i = 0; i < index; i++) { jScript += "$('" + ClientID + "_page_" + i + "').addEvent('click',function(){Slider_" + ClientID + ".turnPage(" + i + ",false);});\n"; } jScript += "} catch (ex) {}});\n"; ScriptHelper.RegisterClientScriptBlock(this, typeof(string), "sliderScript" + ClientID, ScriptHelper.GetScript(jScript)); string bottomDiv = "</div>"; if (index > 0) { // DIV with links to pages bottomDiv += "<div id=\"" + ClientID + "_pager\" class=\"Pager\" style=\"width:" + DivWidth + "px;\">"; // Page numbers for (int p = 0; p < index; p++) { bottomDiv += "<div class=\"PagerPage\" style=\"width:10px;\"><a id=\"" + ClientID + "_page_" + p + "\" href=\"#\" onclick=\"CurrentPage_" + ClientID + "=" + p + ";document.getElementById('" + ClientID + "_runSlider').style.display='inline';return false;\">" + (p + 1) + "</a></div>"; } // Add start link bottomDiv += "<div style=\"display:none;\" id=\"" + ClientID + "_runSlider\" class=\"Control\"><a href=\"#\" onclick=\"document.getElementById('" + ClientID + "_runSlider').style.display='none';autoTurnPage(Slider_" + ClientID + ",CurrentPage_" + ClientID + "," + (JsFadeIn + JsFadeOut + JsBreak) + ", false); return false;\" >" + GetString("ContentSlider.Start") + "</a></div>"; bottomDiv += "<div style=\"clear:both;height:0;line-height:0;\"></div></div>"; } ltlAfter.Text = bottomDiv + "</div>"; Visible = repItems.Visible; if (!repItems.HasData() && HideControlForZeroRows) { Visible = false; } } else { Visible = false; } } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { galleryElem.StopProcessing = true; } else { galleryElem.ControlContext = ControlContext; // Basic control properties galleryElem.HideControlForZeroRows = HideControlForZeroRows; galleryElem.ZeroRowsText = ZeroRowsText; // Data source properties galleryElem.CombineWithDefaultCulture = CombineWithDefaultCulture; galleryElem.CultureCode = CultureCode; galleryElem.OrderBy = OrderBy; galleryElem.TopN = TopN; if (string.IsNullOrEmpty(Path)) { Path = DocumentContext.CurrentAliasPath; } Path = TreePathUtils.EnsureSingleNodePath(Path); galleryElem.Path = Path; galleryElem.SiteName = SiteName; galleryElem.WhereCondition = WhereCondition; galleryElem.AttachmentGroupGUID = AttachmentGroupGUID; galleryElem.FilterName = FilterName; // System properties galleryElem.CacheItemName = CacheItemName; galleryElem.CacheDependencies = CacheDependencies; galleryElem.CacheMinutes = CacheMinutes; galleryElem.CheckPermissions = CheckPermissions; if (ParentZone != null) { galleryElem.CheckCollision = ParentZone.RequiresWebPartManagement(); } else { galleryElem.CheckCollision = PortalContext.IsDesignMode(PortalContext.ViewMode); } // UniPager properties galleryElem.PageSize = PageSize; galleryElem.GroupSize = GroupSize; galleryElem.QueryStringKey = QueryStringKey; galleryElem.DisplayFirstLastAutomatically = DisplayFirstLastAutomatically; galleryElem.DisplayPreviousNextAutomatically = DisplayPreviousNextAutomatically; galleryElem.HidePagerForSinglePage = HidePagerForSinglePage; switch (PagingMode.ToLowerCSafe()) { case "postback": galleryElem.PagingMode = UniPagerMode.PostBack; break; default: galleryElem.PagingMode = UniPagerMode.Querystring; break; } #region "UniPager template properties" // UniPager template properties galleryElem.PagesTemplate = PagesTemplate; galleryElem.CurrentPageTemplate = CurrentPageTemplate; galleryElem.SeparatorTemplate = SeparatorTemplate; galleryElem.FirstPageTemplate = FirstPageTemplate; galleryElem.LastPageTemplate = LastPageTemplate; galleryElem.PreviousPageTemplate = PreviousPageTemplate; galleryElem.NextPageTemplate = NextPageTemplate; galleryElem.PreviousGroupTemplate = PreviousGroupTemplate; galleryElem.NextGroupTemplate = NextGroupTemplate; galleryElem.LayoutTemplate = LayoutTemplate; #endregion #region "Lightbox properties" galleryElem.LightBoxLoadDelay = LightBoxLoadDelay; galleryElem.LightBoxPermanentNavigation = LightBoxPermanentNavigation; galleryElem.LightBoxNextImg = LightBoxNextImg; galleryElem.LightBoxPrevImg = LightBoxPrevImg; galleryElem.LightBoxCloseImg = LightBoxCloseImg; galleryElem.LightBoxLoadingImg = LightBoxLoadingImg; galleryElem.LightBoxBorderSize = LightBoxBorderSize; galleryElem.LightBoxResizeSpeed = LightBoxResizeSpeed; galleryElem.LightBoxHeight = LightBoxHeight; galleryElem.LightBoxWidth = LightBoxWidth; galleryElem.LightBoxAnimate = LightBoxAnimate; galleryElem.LightBoxOverlayOpacity = LightBoxOverlayOpacity; galleryElem.LightBoxExternalScriptPath = LightBoxExternalScriptPath; galleryElem.LightBoxGroup = LightBoxGroup; #endregion // Transformation properties galleryElem.TransformationName = TransformationName; galleryElem.AlternatingTransformationName = AlternatingTransformationName; galleryElem.SelectedItemTransformationName = SelectedItemTransformationName; galleryElem.FooterTransformationName = FooterTransformationName; galleryElem.HeaderTransformationName = HeaderTransformationName; galleryElem.SeparatorTransformationName = SeparatorTransformationName; } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { repItems.StopProcessing = true; extLightbox.StopProcessing = true; } else { repItems.ControlContext = ControlContext; // Document properties repItems.CacheItemName = CacheItemName; repItems.CacheDependencies = CacheDependencies; repItems.CacheMinutes = CacheMinutes; repItems.CheckPermissions = CheckPermissions; repItems.ClassNames = ClassNames; repItems.CombineWithDefaultCulture = CombineWithDefaultCulture; repItems.CultureCode = CultureCode; repItems.MaxRelativeLevel = MaxRelativeLevel; repItems.OrderBy = OrderBy; repItems.SelectTopN = SelectTopN; repItems.Columns = Columns; repItems.SelectOnlyPublished = SelectOnlyPublished; repItems.FilterOutDuplicates = FilterOutDuplicates; repItems.Path = Path; repItems.SiteName = SiteName; repItems.WhereCondition = WhereCondition; // Pager repItems.EnablePaging = EnablePaging; repItems.PagerControl.PagerPosition = PagerPosition; repItems.PagerControl.PageSize = PageSize; repItems.PagerControl.QueryStringKey = QueryStringKey; repItems.PagerControl.PagingMode = PagingMode; repItems.PagerControl.ShowFirstLast = ShowFirstLast; #region "Lightbox properties" extLightbox.LightBoxLoadDelay = LightBoxLoadDelay; extLightbox.LightBoxPermanentNavigation = LightBoxPermanentNavigation; extLightbox.LightBoxNextImg = LightBoxNextImg; extLightbox.LightBoxPrevImg = LightBoxPrevImg; extLightbox.LightBoxCloseImg = LightBoxCloseImg; extLightbox.LightBoxLoadingImg = LightBoxLoadingImg; extLightbox.LightBoxBorderSize = LightBoxBorderSize; extLightbox.LightBoxResizeSpeed = LightBoxResizeSpeed; extLightbox.LightBoxHeight = LightBoxHeight; extLightbox.LightBoxWidth = LightBoxWidth; extLightbox.LightBoxAnimate = LightBoxAnimate; extLightbox.LightBoxOverlayOpacity = LightBoxOverlayOpacity; extLightbox.LightBoxExternalScriptPath = LightBoxExternalScriptPath; extLightbox.LightBoxGroup = LightBoxGroup; if (ParentZone != null) { extLightbox.CheckCollision = ParentZone.RequiresWebPartManagement(); } else { extLightbox.CheckCollision = (ViewMode == ViewModeEnum.Design); } #endregion // Relationships repItems.RelatedNodeIsOnTheLeftSide = RelatedNodeIsOnTheLeftSide; repItems.RelationshipName = RelationshipName; repItems.RelationshipWithNodeGuid = RelationshipWithNodeGUID; // Transformation properties repItems.TransformationName = TransformationName; repItems.AlternatingTransformationName = AlternatingTransformationName; repItems.SelectedItemTransformationName = SelectedItemTransformationName; // Public properties repItems.HideControlForZeroRows = HideControlForZeroRows; repItems.ZeroRowsText = ZeroRowsText; repItems.ItemSeparator = ItemSeparator; repItems.NestedControlsID = NestedControlsID; // Add repeater to the filter collection CMSControlsHelper.SetFilter(ValidationHelper.GetString(GetValue("WebPartControlID"), ClientID), repItems); } }
public override void PointExitCardAnimation(CardComponent card) { card.transform.DOScale(1f, GameData.INTERACTIVE_TIME_DEFAULT); ParentZone.PointExitCardAnimation(ParentCard); }
public override void PointEnterCardAnimation(CardComponent card) { card.transform.DOScale(1.05f, GameData.INTERACTIVE_TIME_DEFAULT).SetEase(enterCardEase); ParentZone.PointEnterCardAnimation(ParentCard); this.StackOrder(card.transform); }
/// <summary> /// Create a new restore instance for the window. /// </summary> /// <param name="child">Child object instance.</param> /// <returns>New restore instance.</returns> public override Restore RecordRestore(object child) { // Child of a WindowContent must be a Content object Content c = child as Content; StringCollection next = new StringCollection(); StringCollection previous = new StringCollection(); bool before = true; // Fill collections with list of Content before and after parameter foreach (Content content in Contents) { if (content == c) { before = false; } else { if (before) { if ((content.UniqueName != null) && (content.UniqueName.Length > 0)) { previous.Add(content.UniqueName); } else { previous.Add(content.Title); } } else { if ((content.UniqueName != null) && (content.UniqueName.Length > 0)) { next.Add(content.UniqueName); } else { next.Add(content.Title); } } } } bool selected = false; // Is there a selected tab? if (_tabControl.SelectedIndex != -1) { // Get access to the selected Content Content selectedContent = _tabControl.SelectedTab.Tag as Content; // Need to record if it is selected selected = (selectedContent == c); } // Create a Restore object to handle this WindowContent Restore thisRestore = new RestoreWindowContent(null, c, next, previous, selected); // Do we have a Zone as our parent? if (ParentZone != null) { // Get the Zone to prepend its own Restore knowledge thisRestore = ParentZone.RecordRestore(this, child, thisRestore); } return(thisRestore); }