Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Framework / System / Windows / Automation / Peers / NavigationWindowAutomationPeer.cs / 1 / 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
- TableLayoutPanelResizeGlyph.cs
- PrimitiveList.cs
- WinInet.cs
- DisplayInformation.cs
- ConnectionStringSettingsCollection.cs
- PageEventArgs.cs
- Socket.cs
- FileNotFoundException.cs
- JavascriptCallbackResponseProperty.cs
- FigureParagraph.cs
- BlurBitmapEffect.cs
- VisualTransition.cs
- IisTraceListener.cs
- ClientConvert.cs
- ConnectorDragDropGlyph.cs
- ExclusiveCanonicalizationTransform.cs
- ReadOnlyObservableCollection.cs
- DurationConverter.cs
- ChannelCacheSettings.cs
- DiscoveryDocumentLinksPattern.cs
- IgnoreFlushAndCloseStream.cs
- CryptoConfig.cs
- BindingsCollection.cs
- fixedPageContentExtractor.cs
- FormattedText.cs
- FontUnitConverter.cs
- RecordsAffectedEventArgs.cs
- NonParentingControl.cs
- AssemblyInfo.cs
- InterleavedZipPartStream.cs
- BulletedListDesigner.cs
- BookmarkScopeManager.cs
- SpellerInterop.cs
- GridView.cs
- SqlDependencyListener.cs
- AmbientProperties.cs
- NoClickablePointException.cs
- XmlCollation.cs
- JobStaple.cs
- BulletChrome.cs
- SafeLocalAllocation.cs
- ADRoleFactory.cs
- BinHexEncoding.cs
- FileBasedResourceGroveler.cs
- ClientSettingsProvider.cs
- EntityDataSourceView.cs
- XmlSchemaAnnotated.cs
- util.cs
- ConnectionStringsExpressionBuilder.cs
- CategoryAttribute.cs
- DrawListViewColumnHeaderEventArgs.cs
- RowBinding.cs
- StringStorage.cs
- AutomationElementCollection.cs
- QuaternionAnimation.cs
- RemotingConfiguration.cs
- StylusButtonEventArgs.cs
- AlignmentXValidation.cs
- RangeValueProviderWrapper.cs
- Missing.cs
- CookieParameter.cs
- TextBox.cs
- ReflectEventDescriptor.cs
- ToolBarButtonClickEvent.cs
- CodeTypeDeclaration.cs
- TimersDescriptionAttribute.cs
- WebPartCatalogAddVerb.cs
- WebRequestModuleElementCollection.cs
- TemplateBamlTreeBuilder.cs
- BitHelper.cs
- GenericUI.cs
- XmlWrappingWriter.cs
- RectangleHotSpot.cs
- ClientConvert.cs
- OdbcParameter.cs
- OpenFileDialog.cs
- FocusChangedEventArgs.cs
- LineGeometry.cs
- _emptywebproxy.cs
- TemplateControlBuildProvider.cs
- SynchronizationHandlesCodeDomSerializer.cs
- InteropAutomationProvider.cs
- Win32MouseDevice.cs
- XmlCodeExporter.cs
- SafeTimerHandle.cs
- Reference.cs
- SecurityElement.cs
- ButtonColumn.cs
- Compiler.cs
- ObjRef.cs
- SizeConverter.cs
- KeyEvent.cs
- QueryableDataSourceEditData.cs
- DefaultValidator.cs
- ObjectSecurityT.cs
- SpellerStatusTable.cs
- DefaultObjectMappingItemCollection.cs
- XamlFilter.cs
- SplineKeyFrames.cs
- Inline.cs