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
- SortedList.cs
- WebResourceAttribute.cs
- DelayLoadType.cs
- ToggleButtonAutomationPeer.cs
- DefaultValueConverter.cs
- DispatcherHookEventArgs.cs
- EncoderBestFitFallback.cs
- SiteMapNodeItem.cs
- EntityObject.cs
- CookielessHelper.cs
- IdentityVerifier.cs
- Evidence.cs
- PhonemeEventArgs.cs
- TextCompositionManager.cs
- Group.cs
- EncryptedReference.cs
- GeometryCollection.cs
- CustomCategoryAttribute.cs
- StringKeyFrameCollection.cs
- PolyBezierSegmentFigureLogic.cs
- AdapterDictionary.cs
- AxHost.cs
- ItemsPresenter.cs
- GetWinFXPath.cs
- ISO2022Encoding.cs
- WeakHashtable.cs
- HttpClientCertificate.cs
- GeometryCollection.cs
- NonValidatingSecurityTokenAuthenticator.cs
- SystemFonts.cs
- EntitySqlException.cs
- HtmlSelect.cs
- FormViewDeleteEventArgs.cs
- DirectoryGroupQuery.cs
- ArrayWithOffset.cs
- Geometry3D.cs
- TextTreeInsertElementUndoUnit.cs
- ProcessingInstructionAction.cs
- ContextMenu.cs
- xmlformatgeneratorstatics.cs
- IntPtr.cs
- TimeoutStream.cs
- Tile.cs
- itemelement.cs
- DiagnosticTraceSource.cs
- SpAudioStreamWrapper.cs
- FrameworkTextComposition.cs
- RoleManagerEventArgs.cs
- codemethodreferenceexpression.cs
- MaterialGroup.cs
- FactoryGenerator.cs
- XmlSchemaValidationException.cs
- FixUpCollection.cs
- PassportIdentity.cs
- WebEventTraceProvider.cs
- PermissionSetTriple.cs
- ObjectKeyFrameCollection.cs
- COM2Properties.cs
- UpdateRecord.cs
- CommandBinding.cs
- TcpConnectionPoolSettings.cs
- CodeCommentStatementCollection.cs
- ToolStrip.cs
- RuntimeEnvironment.cs
- CustomErrorCollection.cs
- Util.cs
- BaseResourcesBuildProvider.cs
- SmiRequestExecutor.cs
- _TLSstream.cs
- FormViewInsertedEventArgs.cs
- GeneratedContractType.cs
- TypeBrowser.xaml.cs
- DetailsViewModeEventArgs.cs
- ImageList.cs
- SettingsPropertyWrongTypeException.cs
- UnsafeNativeMethods.cs
- SeverityFilter.cs
- ProtocolsConfigurationHandler.cs
- ButtonAutomationPeer.cs
- ControlIdConverter.cs
- CallbackHandler.cs
- WebPartConnectionCollection.cs
- SQLBinaryStorage.cs
- StackBuilderSink.cs
- CodeDomSerializerException.cs
- latinshape.cs
- ResourceDisplayNameAttribute.cs
- PropertyPushdownHelper.cs
- DataGridViewTextBoxColumn.cs
- SqlDataSourceSelectingEventArgs.cs
- NativeWindow.cs
- PaperSize.cs
- SamlAttribute.cs
- InstanceDataCollection.cs
- RuntimeTrackingProfile.cs
- BrowserTree.cs
- SectionInformation.cs
- UIElement3D.cs
- LongTypeConverter.cs
- RawKeyboardInputReport.cs