Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / MIT / System / Web / UI / MobileControls / Design / Util / HeaderPanel.cs / 1305376 / HeaderPanel.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.MobileControls.Util { using System; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; [ System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode) ] [Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")] internal class HeaderPanel : Panel { private int _recursionCount = 0; internal void RequestNewHeight(HeaderLabel header, int height) { int offset = height - header.Height; try { // This is a workaround for a RTB issue that causes their // algorithm to ---- up if OnContentsResize recurses. (Now // that HeaderLabel does not resize the text untill after // autoscaling, we do not seem to hit this, but just in case). // // On the first call the RTB guesses its best dimensions // for the given text. We correct the Width which may cause // a second recursive call to adjust the height. if(_recursionCount < 2) { _recursionCount++; header.Height = height; // foreach(Control child in Controls) { if(child.Top > header.Top) { child.Top += offset; } } for( Control controlIterator = this; controlIterator != null; controlIterator = controlIterator.Parent ) { controlIterator.Height += offset; } } else { Debug.Assert(offset == 0, "On 3rd recursive call offset is not yet stabalized." ); } } finally { _recursionCount = 0; } } protected override void OnSizeChanged(EventArgs e) { foreach(Control child in Controls) { if(child is HeaderLabel) { child.Width = Width; } } base.OnSizeChanged(e); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.Design.MobileControls.Util { using System; using System.Diagnostics; using System.Drawing; using System.Windows.Forms; [ System.Security.Permissions.SecurityPermission(System.Security.Permissions.SecurityAction.Demand, Flags=System.Security.Permissions.SecurityPermissionFlag.UnmanagedCode) ] [Obsolete("The System.Web.Mobile.dll assembly has been deprecated and should no longer be used. For information about how to develop ASP.NET mobile applications, see http://go.microsoft.com/fwlink/?LinkId=157231.")] internal class HeaderPanel : Panel { private int _recursionCount = 0; internal void RequestNewHeight(HeaderLabel header, int height) { int offset = height - header.Height; try { // This is a workaround for a RTB issue that causes their // algorithm to ---- up if OnContentsResize recurses. (Now // that HeaderLabel does not resize the text untill after // autoscaling, we do not seem to hit this, but just in case). // // On the first call the RTB guesses its best dimensions // for the given text. We correct the Width which may cause // a second recursive call to adjust the height. if(_recursionCount < 2) { _recursionCount++; header.Height = height; // foreach(Control child in Controls) { if(child.Top > header.Top) { child.Top += offset; } } for( Control controlIterator = this; controlIterator != null; controlIterator = controlIterator.Parent ) { controlIterator.Height += offset; } } else { Debug.Assert(offset == 0, "On 3rd recursive call offset is not yet stabalized." ); } } finally { _recursionCount = 0; } } protected override void OnSizeChanged(EventArgs e) { foreach(Control child in Controls) { if(child is HeaderLabel) { child.Width = Width; } } base.OnSizeChanged(e); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ElementUtil.cs
- BitSet.cs
- XmlHierarchicalDataSourceView.cs
- ReadOnlyCollectionBase.cs
- SqlDataSourceEnumerator.cs
- XNameTypeConverter.cs
- IsolationInterop.cs
- ValueConversionAttribute.cs
- PrefixQName.cs
- HMACSHA1.cs
- XsltFunctions.cs
- SafeProcessHandle.cs
- SystemTcpStatistics.cs
- StringUtil.cs
- StringKeyFrameCollection.cs
- SimplePropertyEntry.cs
- NonBatchDirectoryCompiler.cs
- HttpClientCertificate.cs
- x509store.cs
- DictionarySectionHandler.cs
- OdbcConnectionFactory.cs
- KeyPullup.cs
- DoubleAnimationBase.cs
- MultipleViewPattern.cs
- HttpHeaderCollection.cs
- BuildProvider.cs
- XsltLibrary.cs
- ProfilePropertySettingsCollection.cs
- DataGridViewColumnEventArgs.cs
- Single.cs
- XmlResolver.cs
- TextPenaltyModule.cs
- FileSystemWatcher.cs
- ProfessionalColors.cs
- GridViewRowPresenterBase.cs
- WindowsIPAddress.cs
- SqlDataSourceView.cs
- MetadataImporter.cs
- ArrayConverter.cs
- DefaultTextStoreTextComposition.cs
- DateTimeUtil.cs
- TextParagraph.cs
- SQLBinary.cs
- IdnElement.cs
- DataGridRowHeaderAutomationPeer.cs
- TagNameToTypeMapper.cs
- recordstatefactory.cs
- BindingContext.cs
- SoapBinding.cs
- PartialCachingAttribute.cs
- DrawingCollection.cs
- PropertyNames.cs
- CompilerTypeWithParams.cs
- BrowserInteropHelper.cs
- PolyBezierSegmentFigureLogic.cs
- DataColumnMappingCollection.cs
- PagedDataSource.cs
- DataGridRowClipboardEventArgs.cs
- CodeAttributeDeclaration.cs
- ClientSponsor.cs
- Cursor.cs
- HostingEnvironmentSection.cs
- BaseCodeDomTreeGenerator.cs
- RoutedEventValueSerializer.cs
- RSAProtectedConfigurationProvider.cs
- SubtreeProcessor.cs
- ReversePositionQuery.cs
- EventLogPermission.cs
- IPHostEntry.cs
- ErrorFormatter.cs
- CustomErrorsSection.cs
- SiteMapDataSourceView.cs
- BindingMAnagerBase.cs
- StrokeNodeOperations2.cs
- XmlSiteMapProvider.cs
- StandardToolWindows.cs
- XmlSerializerNamespaces.cs
- AsymmetricSignatureFormatter.cs
- PrtCap_Public.cs
- DataSourceXmlSubItemAttribute.cs
- XDRSchema.cs
- FileDialog_Vista.cs
- DictionaryContent.cs
- XmlElementList.cs
- WorkflowElementDialogWindow.xaml.cs
- PlainXmlDeserializer.cs
- LassoHelper.cs
- UpdateCommandGenerator.cs
- XmlSchemaAttribute.cs
- Brush.cs
- SqlRetyper.cs
- GridToolTip.cs
- UInt64Converter.cs
- EmptyStringExpandableObjectConverter.cs
- DragEvent.cs
- SynchronizedDispatch.cs
- AssemblyInfo.cs
- DataColumnCollection.cs
- StringArrayConverter.cs
- CompressionTransform.cs