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
- FlowDocument.cs
- XmlLoader.cs
- PrintEvent.cs
- XmlSchemaAnnotated.cs
- TrustManagerMoreInformation.cs
- Stack.cs
- AudienceUriMode.cs
- ColumnHeader.cs
- ControlBuilder.cs
- DataViewSettingCollection.cs
- NamespaceCollection.cs
- _emptywebproxy.cs
- SingleTagSectionHandler.cs
- IdentityElement.cs
- SqlServer2KCompatibilityCheck.cs
- HtmlContainerControl.cs
- Int32Rect.cs
- XmlSchemaComplexType.cs
- TextSegment.cs
- UnsafeNativeMethodsCLR.cs
- LocatorPartList.cs
- TransactionScope.cs
- FileSystemWatcher.cs
- SqlClientWrapperSmiStreamChars.cs
- RankException.cs
- PngBitmapEncoder.cs
- LineGeometry.cs
- ScrollItemProviderWrapper.cs
- StyleModeStack.cs
- HtmlInputFile.cs
- RealizationDrawingContextWalker.cs
- AppAction.cs
- XPathArrayIterator.cs
- BinaryKeyIdentifierClause.cs
- IdnElement.cs
- NameValueFileSectionHandler.cs
- UpdateManifestForBrowserApplication.cs
- TaskForm.cs
- ItemCheckEvent.cs
- TemplateKeyConverter.cs
- TriggerBase.cs
- MediaCommands.cs
- PartitionResolver.cs
- DocComment.cs
- StylusPointPropertyInfo.cs
- XmlQueryRuntime.cs
- AsynchronousChannel.cs
- HTMLTagNameToTypeMapper.cs
- ConnectionStringsSection.cs
- RemotingException.cs
- EditorPartChrome.cs
- RawStylusActions.cs
- List.cs
- SchemaElementLookUpTableEnumerator.cs
- SecureUICommand.cs
- ObjectConverter.cs
- PeerNameRecord.cs
- path.cs
- SqlDataSourceCustomCommandEditor.cs
- NonVisualControlAttribute.cs
- ClientConvert.cs
- CommandTreeTypeHelper.cs
- COM2PropertyBuilderUITypeEditor.cs
- MsdtcWrapper.cs
- DataGridViewSelectedRowCollection.cs
- SqlUDTStorage.cs
- BufferAllocator.cs
- PerformanceCounterPermission.cs
- TextBoxAutoCompleteSourceConverter.cs
- QilGenerator.cs
- XamlFilter.cs
- Rotation3D.cs
- DataServiceKeyAttribute.cs
- WrappedIUnknown.cs
- JpegBitmapDecoder.cs
- BaseAddressPrefixFilterElementCollection.cs
- ItemDragEvent.cs
- Vector3DKeyFrameCollection.cs
- DesignerProperties.cs
- StylusPointDescription.cs
- DecoderReplacementFallback.cs
- SqlGatherProducedAliases.cs
- TdsParserHelperClasses.cs
- TriggerBase.cs
- ThicknessKeyFrameCollection.cs
- UIAgentAsyncEndRequest.cs
- QuaternionAnimation.cs
- ImageCodecInfoPrivate.cs
- GeometryCollection.cs
- GeneratedCodeAttribute.cs
- IndexExpression.cs
- FloaterBaseParaClient.cs
- TransformerConfigurationWizardBase.cs
- TypeUtil.cs
- ObjectSet.cs
- EntityDataReader.cs
- ConstrainedGroup.cs
- DiscoveryClientProtocol.cs
- Helper.cs
- CallbackHandler.cs