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
- DateTimeConverter2.cs
- SecurityCriticalDataForSet.cs
- SessionSwitchEventArgs.cs
- XmlChildEnumerator.cs
- ProcessModelSection.cs
- OrthographicCamera.cs
- SchemaAttDef.cs
- BamlLocalizationDictionary.cs
- NavigationWindowAutomationPeer.cs
- ToolStripPanelRow.cs
- ToolStripItemCollection.cs
- XmlnsCache.cs
- GlyphRunDrawing.cs
- UInt32Converter.cs
- COM2FontConverter.cs
- ManipulationVelocities.cs
- SafeRegistryKey.cs
- InternalTypeHelper.cs
- BitConverter.cs
- StatusBarPanel.cs
- LocalizationCodeDomSerializer.cs
- FormViewUpdateEventArgs.cs
- SQLDoubleStorage.cs
- ImageMapEventArgs.cs
- MeasurementDCInfo.cs
- AsyncCompletedEventArgs.cs
- XmlReflectionImporter.cs
- pingexception.cs
- CmsInterop.cs
- DataGridViewAddColumnDialog.cs
- WebPartZoneAutoFormat.cs
- View.cs
- MessageAction.cs
- ObjectDataSourceView.cs
- ColumnHeaderCollectionEditor.cs
- UIElementParaClient.cs
- FixedTextSelectionProcessor.cs
- DateTimeAutomationPeer.cs
- CultureInfo.cs
- DateTimeSerializationSection.cs
- TemplateContentLoader.cs
- CommandField.cs
- AnimatedTypeHelpers.cs
- EastAsianLunisolarCalendar.cs
- VisualStyleElement.cs
- SubtreeProcessor.cs
- XappLauncher.cs
- RequestStatusBarUpdateEventArgs.cs
- SoapObjectWriter.cs
- ZipIOEndOfCentralDirectoryBlock.cs
- VoiceSynthesis.cs
- ReadWriteSpinLock.cs
- WebPartTransformerAttribute.cs
- CompositeTypefaceMetrics.cs
- XmlValidatingReaderImpl.cs
- IncrementalCompileAnalyzer.cs
- HelpInfo.cs
- CallbackValidatorAttribute.cs
- UrlPath.cs
- ToolStripDesignerUtils.cs
- WindowsComboBox.cs
- PriorityItem.cs
- BooleanAnimationBase.cs
- WeakReferenceEnumerator.cs
- CompilerState.cs
- FunctionMappingTranslator.cs
- EncoderFallback.cs
- ExecutedRoutedEventArgs.cs
- HwndSourceKeyboardInputSite.cs
- EdmRelationshipNavigationPropertyAttribute.cs
- TraceHandlerErrorFormatter.cs
- RotateTransform3D.cs
- XamlStream.cs
- ellipse.cs
- Privilege.cs
- EnumValidator.cs
- BrushConverter.cs
- TypeForwardedToAttribute.cs
- PlanCompiler.cs
- PerformanceCounterManager.cs
- DataTableTypeConverter.cs
- BindableTemplateBuilder.cs
- ClientSponsor.cs
- RuleRef.cs
- StatusBarItemAutomationPeer.cs
- GrammarBuilderWildcard.cs
- WebPart.cs
- BaseTemplateParser.cs
- TypeSystem.cs
- DeferredReference.cs
- ContainerAction.cs
- DataProviderNameConverter.cs
- peersecuritysettings.cs
- ContextMarshalException.cs
- FrameworkTemplate.cs
- NodeFunctions.cs
- ObjectIDGenerator.cs
- DiagnosticsConfigurationHandler.cs
- TextTreeText.cs
- BinHexEncoder.cs