Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- WebPartZoneDesigner.cs
- FormParameter.cs
- SoapFaultCodes.cs
- BinaryObjectWriter.cs
- MaskedTextBoxDesigner.cs
- DecoratedNameAttribute.cs
- X509CertificateClaimSet.cs
- DataTableMappingCollection.cs
- NamespaceList.cs
- Span.cs
- ProfileEventArgs.cs
- RegexMatchCollection.cs
- XPathDocumentIterator.cs
- TypeRefElement.cs
- WebPartConnectionsCancelEventArgs.cs
- XamlTypeMapperSchemaContext.cs
- ItemMap.cs
- ToolBar.cs
- PasswordBoxAutomationPeer.cs
- BinaryWriter.cs
- CommandManager.cs
- UrlPath.cs
- HtmlEncodedRawTextWriter.cs
- StorageEntityContainerMapping.cs
- ParenExpr.cs
- Aggregates.cs
- PrivilegeNotHeldException.cs
- FileIOPermission.cs
- OptimizerPatterns.cs
- SqlCommandBuilder.cs
- ProgramPublisher.cs
- StringPropertyBuilder.cs
- DesignerWithHeader.cs
- AuthStoreRoleProvider.cs
- connectionpool.cs
- XamlTypeWithExplicitNamespace.cs
- autovalidator.cs
- SelectorAutomationPeer.cs
- WindowsFormsSynchronizationContext.cs
- ListSourceHelper.cs
- MaterialGroup.cs
- TranslateTransform.cs
- IOException.cs
- SupportingTokenChannel.cs
- FlowDocumentReaderAutomationPeer.cs
- PartialTrustValidationBehavior.cs
- Utility.cs
- TagNameToTypeMapper.cs
- RootProfilePropertySettingsCollection.cs
- DESCryptoServiceProvider.cs
- X509CertificateCollection.cs
- WebPartConnection.cs
- LambdaValue.cs
- SchemaMerger.cs
- DataGridViewColumnDesigner.cs
- LogEntrySerialization.cs
- ActivityLocationReferenceEnvironment.cs
- RichTextBoxContextMenu.cs
- RunInstallerAttribute.cs
- FormsAuthenticationTicket.cs
- ScrollContentPresenter.cs
- FactoryGenerator.cs
- SQLInt16.cs
- cache.cs
- _NestedMultipleAsyncResult.cs
- ExtendedProtectionPolicy.cs
- securitycriticaldata.cs
- BrowserCapabilitiesFactory.cs
- XamlBrushSerializer.cs
- ContextMenuStripGroupCollection.cs
- Object.cs
- TextEditorTyping.cs
- XslAst.cs
- MailMessageEventArgs.cs
- HelpKeywordAttribute.cs
- UnsafeNetInfoNativeMethods.cs
- Encoding.cs
- ObjectView.cs
- VerificationAttribute.cs
- IpcPort.cs
- XamlTypeWithExplicitNamespace.cs
- SurrogateSelector.cs
- PenContext.cs
- ExtensionSimplifierMarkupObject.cs
- UnsafeCollabNativeMethods.cs
- AttributeUsageAttribute.cs
- QuestionEventArgs.cs
- SimpleTextLine.cs
- PageWrapper.cs
- TemplateBindingExpressionConverter.cs
- MembershipValidatePasswordEventArgs.cs
- ComUdtElementCollection.cs
- CopyAttributesAction.cs
- Row.cs
- Types.cs
- ClientRuntime.cs
- QueryCacheManager.cs
- TextDecorationCollectionConverter.cs
- PasswordTextContainer.cs
- ClientBuildManagerCallback.cs