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
- XmlSerializerFactory.cs
- ContainerAction.cs
- CaseInsensitiveOrdinalStringComparer.cs
- _SingleItemRequestCache.cs
- XmlRawWriter.cs
- StoreAnnotationsMap.cs
- WeakEventManager.cs
- BinaryEditor.cs
- BrowserCapabilitiesCodeGenerator.cs
- Region.cs
- ToolStripGrip.cs
- InkPresenterAutomationPeer.cs
- ClusterSafeNativeMethods.cs
- InlineUIContainer.cs
- ListView.cs
- sitestring.cs
- Table.cs
- HttpCachePolicy.cs
- StateWorkerRequest.cs
- MessageQueue.cs
- XmlILModule.cs
- XmlDomTextWriter.cs
- ReferenceEqualityComparer.cs
- CmsInterop.cs
- TextParentUndoUnit.cs
- ControlBuilder.cs
- XmlExtensionFunction.cs
- Parsers.cs
- WebConvert.cs
- IdleTimeoutMonitor.cs
- EventHandlersStore.cs
- WindowsListViewGroup.cs
- QuadraticBezierSegment.cs
- HttpConfigurationContext.cs
- SerializationAttributes.cs
- TabControlAutomationPeer.cs
- ActivityCodeDomSerializationManager.cs
- SchemaTypeEmitter.cs
- DBSchemaRow.cs
- TableRowCollection.cs
- ActivationServices.cs
- CloseSequenceResponse.cs
- XmlAttributeAttribute.cs
- DecimalMinMaxAggregationOperator.cs
- Border.cs
- ApplicationFileCodeDomTreeGenerator.cs
- MaterializeFromAtom.cs
- Int32.cs
- AssemblyBuilder.cs
- LocalizationCodeDomSerializer.cs
- SqlDataSourceCache.cs
- RelationshipType.cs
- LocationChangedEventArgs.cs
- CollectionViewGroupRoot.cs
- IndicCharClassifier.cs
- DbProviderManifest.cs
- DbProviderManifest.cs
- AssemblyFilter.cs
- WorkflowElementDialogWindow.xaml.cs
- SqlDataRecord.cs
- CultureMapper.cs
- OutputCacheProfile.cs
- TemplateBindingExtensionConverter.cs
- OleDbDataAdapter.cs
- TextParagraphView.cs
- HyperLinkDesigner.cs
- RecommendedAsConfigurableAttribute.cs
- ExceptQueryOperator.cs
- XmlSchemaRedefine.cs
- SettingsBase.cs
- DependencyObjectType.cs
- RuntimeHelpers.cs
- ByteStreamGeometryContext.cs
- ContentPlaceHolder.cs
- SoapAttributes.cs
- DataFormats.cs
- Renderer.cs
- ProtectedConfigurationProviderCollection.cs
- SinglePageViewer.cs
- ImageClickEventArgs.cs
- Span.cs
- CmsInterop.cs
- PtsHost.cs
- DbQueryCommandTree.cs
- ZeroOpNode.cs
- PeerCustomResolverElement.cs
- PriorityQueue.cs
- LinkButton.cs
- DetailsViewDeletedEventArgs.cs
- IUnknownConstantAttribute.cs
- AggregatePushdown.cs
- SequentialWorkflowRootDesigner.cs
- Identity.cs
- ReaderContextStackData.cs
- InProcStateClientManager.cs
- AppSettingsSection.cs
- PeerInvitationResponse.cs
- KeySplineConverter.cs
- SettingsPropertyIsReadOnlyException.cs
- CodeNamespaceImportCollection.cs