Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Automation / Peers / NavigationWindowAutomationPeer.cs / 1305600 / NavigationWindowAutomationPeer.cs
using System; using System.Windows; using System.Windows.Automation; using System.Windows.Navigation; using System.Windows.Interop; using System.Windows.Media; using System.ComponentModel; namespace System.Windows.Automation.Peers { /// public class NavigationWindowAutomationPeer : WindowAutomationPeer { /// public NavigationWindowAutomationPeer(NavigationWindow owner): base(owner) {} /// override protected string GetClassNameCore() { return "NavigationWindow"; } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal static void RaiseAsyncContentLoadedEvent(AutomationPeer peer, long bytesRead, long maxBytes) { double percentComplete = 0d; AsyncContentLoadedState asyncContentState = AsyncContentLoadedState.Beginning; if (bytesRead > 0) { if (bytesRead < maxBytes) { percentComplete = maxBytes > 0 ? (bytesRead * 100d / maxBytes) : 0; asyncContentState = AsyncContentLoadedState.Progress; } else { percentComplete = 100d; asyncContentState = AsyncContentLoadedState.Completed; } } peer.RaiseAsyncContentLoadedEvent(new AsyncContentLoadedEventArgs(asyncContentState, percentComplete)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.Windows; using System.Windows.Automation; using System.Windows.Navigation; using System.Windows.Interop; using System.Windows.Media; using System.ComponentModel; namespace System.Windows.Automation.Peers { /// public class NavigationWindowAutomationPeer : WindowAutomationPeer { /// public NavigationWindowAutomationPeer(NavigationWindow owner): base(owner) {} /// override protected string GetClassNameCore() { return "NavigationWindow"; } // [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] internal static void RaiseAsyncContentLoadedEvent(AutomationPeer peer, long bytesRead, long maxBytes) { double percentComplete = 0d; AsyncContentLoadedState asyncContentState = AsyncContentLoadedState.Beginning; if (bytesRead > 0) { if (bytesRead < maxBytes) { percentComplete = maxBytes > 0 ? (bytesRead * 100d / maxBytes) : 0; asyncContentState = AsyncContentLoadedState.Progress; } else { percentComplete = 100d; asyncContentState = AsyncContentLoadedState.Completed; } } peer.RaiseAsyncContentLoadedEvent(new AsyncContentLoadedEventArgs(asyncContentState, percentComplete)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InvokePatternIdentifiers.cs
- SafeNativeMemoryHandle.cs
- XmlAutoDetectWriter.cs
- ParentUndoUnit.cs
- TextProperties.cs
- IssuedTokensHeader.cs
- ConnectionsZone.cs
- GuidTagList.cs
- HttpRequest.cs
- TraceEventCache.cs
- ChunkedMemoryStream.cs
- AsyncPostBackErrorEventArgs.cs
- QueryAccessibilityHelpEvent.cs
- CommandHelper.cs
- RawStylusInputCustomData.cs
- ListItemCollection.cs
- TransformCollection.cs
- Block.cs
- Point.cs
- StyleTypedPropertyAttribute.cs
- DataServiceQueryOfT.cs
- _LocalDataStore.cs
- DbConnectionPoolGroupProviderInfo.cs
- Int32AnimationUsingKeyFrames.cs
- RelatedPropertyManager.cs
- PrimitiveXmlSerializers.cs
- TextSyndicationContentKindHelper.cs
- ObjectListItem.cs
- DummyDataSource.cs
- XmlSchemaElement.cs
- XPathDocument.cs
- DataGridViewBindingCompleteEventArgs.cs
- SamlAuthorityBinding.cs
- HandleCollector.cs
- HtmlGenericControl.cs
- PerfCounterSection.cs
- TemplateBuilder.cs
- ButtonBase.cs
- XPathScanner.cs
- StyleModeStack.cs
- IssuanceLicense.cs
- OdbcDataReader.cs
- EditorBrowsableAttribute.cs
- StatusBarItem.cs
- XslVisitor.cs
- XmlDomTextWriter.cs
- ExpandSegmentCollection.cs
- IndexerHelper.cs
- HttpRequest.cs
- TypeDescriptionProvider.cs
- PointHitTestParameters.cs
- PropertyChangingEventArgs.cs
- AuthenticationModuleElement.cs
- UnsafeNativeMethods.cs
- datacache.cs
- AsymmetricKeyExchangeDeformatter.cs
- Triangle.cs
- WebPartDisplayModeEventArgs.cs
- EntityViewGenerationConstants.cs
- SqlCacheDependencyDatabaseCollection.cs
- MsmqIntegrationInputMessage.cs
- BitmapEffectRenderDataResource.cs
- Int32Animation.cs
- ComplusTypeValidator.cs
- CompatibleComparer.cs
- EntityWithKeyStrategy.cs
- _Rfc2616CacheValidators.cs
- CapiHashAlgorithm.cs
- SatelliteContractVersionAttribute.cs
- XmlSchemaResource.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- activationcontext.cs
- DataViewListener.cs
- MenuBindingsEditorForm.cs
- ContextQuery.cs
- MarkupExtensionParser.cs
- SecurityException.cs
- RuntimeComponentFilter.cs
- PropertyMapper.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- FontDriver.cs
- RenamedEventArgs.cs
- FixedHighlight.cs
- Popup.cs
- X509Utils.cs
- XmlElementCollection.cs
- IgnoreFileBuildProvider.cs
- EventOpcode.cs
- CodeArgumentReferenceExpression.cs
- SuppressMessageAttribute.cs
- ToolboxComponentsCreatedEventArgs.cs
- StyleBamlRecordReader.cs
- ToolStripMenuItemDesigner.cs
- FilteredDataSetHelper.cs
- ApplicationGesture.cs
- HostingEnvironment.cs
- SystemResources.cs
- BitmapEncoder.cs
- EntityTypeEmitter.cs
- CryptoHandle.cs