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
- ScriptResourceAttribute.cs
- Color.cs
- ThumbAutomationPeer.cs
- ConstrainedDataObject.cs
- LambdaCompiler.cs
- StateDesigner.Helpers.cs
- RouteValueDictionary.cs
- Geometry.cs
- PersistChildrenAttribute.cs
- FormViewUpdateEventArgs.cs
- ErrorWebPart.cs
- AddToCollection.cs
- ConnectorSelectionGlyph.cs
- GridViewSelectEventArgs.cs
- DetailsViewRow.cs
- String.cs
- GuidConverter.cs
- TextBreakpoint.cs
- ArrangedElementCollection.cs
- XmlSerializerFactory.cs
- ImageFormat.cs
- HtmlSelect.cs
- StrongName.cs
- RequiredFieldValidator.cs
- DocumentPageView.cs
- Request.cs
- OpenFileDialog.cs
- SrgsRuleRef.cs
- PathBox.cs
- DispatcherOperation.cs
- TextLine.cs
- ResourceWriter.cs
- RegexCode.cs
- PbrsForward.cs
- ProxyAttribute.cs
- DbConnectionPoolIdentity.cs
- FillErrorEventArgs.cs
- SynchronizedReadOnlyCollection.cs
- MappingModelBuildProvider.cs
- OracleCommand.cs
- DataSetUtil.cs
- MenuAdapter.cs
- SimpleHandlerFactory.cs
- XamlToRtfWriter.cs
- HandoffBehavior.cs
- WorkflowNamespace.cs
- EventDescriptorCollection.cs
- DataGridViewImageColumn.cs
- Point3DIndependentAnimationStorage.cs
- CopyNodeSetAction.cs
- EntityStoreSchemaGenerator.cs
- SessionEndingEventArgs.cs
- Camera.cs
- BidPrivateBase.cs
- ContentPropertyAttribute.cs
- ACL.cs
- SamlSecurityToken.cs
- DispatcherHookEventArgs.cs
- CodeIdentifiers.cs
- FixedStringLookup.cs
- Types.cs
- WebPartsPersonalizationAuthorization.cs
- xsdvalidator.cs
- HorizontalAlignConverter.cs
- SecUtil.cs
- DataSourceXmlSubItemAttribute.cs
- EntityViewGenerationAttribute.cs
- LogStream.cs
- RelationshipType.cs
- WindowsSpinner.cs
- StagingAreaInputItem.cs
- Selector.cs
- EventRecordWrittenEventArgs.cs
- SQLByte.cs
- EntityViewGenerationAttribute.cs
- OneOfTypeConst.cs
- counter.cs
- RtfToXamlLexer.cs
- FixedSOMGroup.cs
- SessionEndedEventArgs.cs
- SchemaCollectionCompiler.cs
- InkCanvasInnerCanvas.cs
- SqlConnectionHelper.cs
- ReferenceService.cs
- AuthorizationRule.cs
- PasswordRecovery.cs
- IntegerValidator.cs
- StateDesigner.Layouts.cs
- SQLStringStorage.cs
- FixedPageAutomationPeer.cs
- SmiRequestExecutor.cs
- EventSource.cs
- _BasicClient.cs
- IdentityVerifier.cs
- ConfigXmlComment.cs
- SQLDateTime.cs
- CallbackBehaviorAttribute.cs
- DataGridTable.cs
- BuildManager.cs
- WebPartConnectVerb.cs