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
- AutomationElementCollection.cs
- WindowsRichEdit.cs
- XPathNavigator.cs
- WindowsTreeView.cs
- MetadataUtilsSmi.cs
- ListControlActionList.cs
- RequestTimeoutManager.cs
- ClientConfigPaths.cs
- FontNamesConverter.cs
- CommandHelper.cs
- SendParametersContent.cs
- ConfigurationManagerHelper.cs
- storepermissionattribute.cs
- ArgumentValidation.cs
- XmlCharacterData.cs
- RuntimeCompatibilityAttribute.cs
- Clause.cs
- MsmqNonTransactedPoisonHandler.cs
- Internal.cs
- XPathNodeIterator.cs
- ServiceBusyException.cs
- ArglessEventHandlerProxy.cs
- IDQuery.cs
- PropertyManager.cs
- Empty.cs
- SemaphoreSlim.cs
- UrlMappingsSection.cs
- TraceRecords.cs
- Attribute.cs
- GridViewDeletedEventArgs.cs
- TimeEnumHelper.cs
- TrimSurroundingWhitespaceAttribute.cs
- ByteConverter.cs
- TableLayoutStyleCollection.cs
- RemoveStoryboard.cs
- TextParagraph.cs
- OperationGenerator.cs
- RootBrowserWindow.cs
- Soap12ProtocolImporter.cs
- FlowDocumentView.cs
- InstanceHandleConflictException.cs
- BulletedListEventArgs.cs
- DrawItemEvent.cs
- Wizard.cs
- Debug.cs
- AnnotationService.cs
- IListConverters.cs
- PageTheme.cs
- HelloOperationCD1AsyncResult.cs
- TimeoutStream.cs
- BmpBitmapEncoder.cs
- Translator.cs
- NativeMethods.cs
- TitleStyle.cs
- ValueSerializer.cs
- ReferencedCategoriesDocument.cs
- ObjectSecurity.cs
- ReservationNotFoundException.cs
- ProfilePropertySettingsCollection.cs
- SQLSingleStorage.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- ChameleonKey.cs
- Variant.cs
- SymbolEqualComparer.cs
- newinstructionaction.cs
- MemberAccessException.cs
- embossbitmapeffect.cs
- ColorAnimationUsingKeyFrames.cs
- OdbcConnectionOpen.cs
- DictionaryBase.cs
- ColumnPropertiesGroup.cs
- ContentDisposition.cs
- AlternateViewCollection.cs
- Point3D.cs
- ExpandSegmentCollection.cs
- DtdParser.cs
- CacheSection.cs
- WebPartDisplayMode.cs
- LinkedResource.cs
- SynchronizedDispatch.cs
- PackWebResponse.cs
- AudioLevelUpdatedEventArgs.cs
- TdsParserSessionPool.cs
- BindUriHelper.cs
- DesignerSerializationOptionsAttribute.cs
- SharedPerformanceCounter.cs
- TcpProcessProtocolHandler.cs
- Pkcs9Attribute.cs
- OleAutBinder.cs
- BamlRecordReader.cs
- BindingOperations.cs
- InternalDuplexChannelListener.cs
- LinearGradientBrush.cs
- SocketPermission.cs
- DataServiceClientException.cs
- FontFamily.cs
- CancellationHandler.cs
- FolderBrowserDialog.cs
- ToolStripMenuItemDesigner.cs
- ScriptHandlerFactory.cs