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
- FtpWebRequest.cs
- Nullable.cs
- ColorConverter.cs
- DockPattern.cs
- TakeOrSkipQueryOperator.cs
- CustomError.cs
- PropertyItemInternal.cs
- ScrollChrome.cs
- SqlDataSourceTableQuery.cs
- DocumentReference.cs
- FormViewUpdatedEventArgs.cs
- KeyInterop.cs
- ValuePatternIdentifiers.cs
- OutputScopeManager.cs
- SocketPermission.cs
- AssemblyBuilder.cs
- KeyManager.cs
- __Filters.cs
- XmlWrappingReader.cs
- XmlSiteMapProvider.cs
- StorageComplexTypeMapping.cs
- TextLineResult.cs
- RSATokenProvider.cs
- DesignBindingValueUIHandler.cs
- AutomationPatternInfo.cs
- ErrorWrapper.cs
- __Filters.cs
- ListBoxItem.cs
- SweepDirectionValidation.cs
- PrimitiveXmlSerializers.cs
- DecimalAnimationBase.cs
- CellConstantDomain.cs
- XmlSchemaValidationException.cs
- ArraySortHelper.cs
- ReadContentAsBinaryHelper.cs
- BaseAddressPrefixFilterElementCollection.cs
- DiagnosticTraceSource.cs
- VariableQuery.cs
- AppDomainProtocolHandler.cs
- PersonalizationProvider.cs
- ClassicBorderDecorator.cs
- SqlBulkCopy.cs
- InstanceHandle.cs
- Reference.cs
- XmlEncodedRawTextWriter.cs
- EncoderParameter.cs
- FamilyMap.cs
- MiniCustomAttributeInfo.cs
- ReadOnlyCollectionBase.cs
- querybuilder.cs
- CodeCatchClause.cs
- FlowPosition.cs
- ExpressionBuilderCollection.cs
- HtmlInputRadioButton.cs
- SQLDouble.cs
- UrlPath.cs
- WebPartManagerInternals.cs
- StorageInfo.cs
- PageRequestManager.cs
- OAVariantLib.cs
- InheritedPropertyChangedEventArgs.cs
- RowType.cs
- SrgsElementFactory.cs
- XmlNodeReader.cs
- WindowsFormsHelpers.cs
- DetailsViewUpdateEventArgs.cs
- Win32.cs
- WebPartCollection.cs
- ComboBox.cs
- RectangleConverter.cs
- FontFamily.cs
- HeaderedItemsControl.cs
- XmlTextReaderImplHelpers.cs
- ParameterInfo.cs
- DependencyObjectProvider.cs
- EpmTargetPathSegment.cs
- SQLMoneyStorage.cs
- dsa.cs
- LogSwitch.cs
- Stopwatch.cs
- XmlSchemaAny.cs
- Zone.cs
- XPathNodeInfoAtom.cs
- _BaseOverlappedAsyncResult.cs
- NamespaceCollection.cs
- Mappings.cs
- ExtenderProvidedPropertyAttribute.cs
- FormatVersion.cs
- X509CertificateValidator.cs
- ListDictionaryInternal.cs
- DataTableClearEvent.cs
- NameValuePair.cs
- EventEntry.cs
- RefType.cs
- UnsafeNativeMethods.cs
- SqlGatherProducedAliases.cs
- PerSessionInstanceContextProvider.cs
- RuntimeArgumentHandle.cs
- DesignTimeTemplateParser.cs
- Context.cs