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
- PlanCompilerUtil.cs
- PeerCredentialElement.cs
- FontStretches.cs
- basecomparevalidator.cs
- CodeIterationStatement.cs
- x509utils.cs
- DataRowExtensions.cs
- DockProviderWrapper.cs
- ZipIOLocalFileHeader.cs
- PeerName.cs
- CompilerInfo.cs
- InputReportEventArgs.cs
- CrossSiteScriptingValidation.cs
- FixedFlowMap.cs
- SqlRewriteScalarSubqueries.cs
- NativeRecognizer.cs
- ComPlusServiceLoader.cs
- HMACSHA512.cs
- PrintDialog.cs
- TextWriterEngine.cs
- Identifier.cs
- PolyBezierSegment.cs
- CodeIdentifier.cs
- RubberbandSelector.cs
- GestureRecognitionResult.cs
- TimeoutException.cs
- DataTableMappingCollection.cs
- UInt16Storage.cs
- TdsParser.cs
- Floater.cs
- MemberRelationshipService.cs
- SessionEndingEventArgs.cs
- WmpBitmapDecoder.cs
- FixedPageProcessor.cs
- CellQuery.cs
- PrintPreviewDialog.cs
- UrlMappingsSection.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- Process.cs
- SerializationObjectManager.cs
- KeyValuePair.cs
- CultureNotFoundException.cs
- MsmqAppDomainProtocolHandler.cs
- WebResourceAttribute.cs
- LogicalExpressionEditor.cs
- StrictAndMessageFilter.cs
- ControlDesigner.cs
- IsolatedStorageFileStream.cs
- ServerValidateEventArgs.cs
- AutoSizeComboBox.cs
- DragEventArgs.cs
- EmptyControlCollection.cs
- TdsParserStateObject.cs
- NumberFormatter.cs
- FrameworkElement.cs
- AttachedProperty.cs
- WmlPageAdapter.cs
- IItemContainerGenerator.cs
- ButtonAutomationPeer.cs
- CultureInfo.cs
- sqlinternaltransaction.cs
- PaintValueEventArgs.cs
- RegistryKey.cs
- WSDualHttpSecurity.cs
- CharAnimationBase.cs
- ReachVisualSerializerAsync.cs
- TimelineGroup.cs
- RootDesignerSerializerAttribute.cs
- ProtocolsSection.cs
- UndirectedGraph.cs
- View.cs
- NamespaceCollection.cs
- IntSecurity.cs
- KeyedCollection.cs
- ContextBase.cs
- ReliabilityContractAttribute.cs
- COM2ExtendedTypeConverter.cs
- HtmlTextBoxAdapter.cs
- ExpressionReplacer.cs
- Group.cs
- FontSourceCollection.cs
- streamingZipPartStream.cs
- _Semaphore.cs
- Image.cs
- HtmlFormWrapper.cs
- Parser.cs
- RuleSettingsCollection.cs
- SamlNameIdentifierClaimResource.cs
- Model3DGroup.cs
- GenericTypeParameterBuilder.cs
- ManagementOperationWatcher.cs
- Utils.cs
- MimeBasePart.cs
- MachineKeyConverter.cs
- EventLogPermissionAttribute.cs
- WebContext.cs
- Utils.cs
- StreamUpgradeProvider.cs
- CollectionType.cs
- FixedSOMTableRow.cs