Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- VirtualPathProvider.cs
- ObjectDataSourceDisposingEventArgs.cs
- WebZone.cs
- DataContractSerializerSection.cs
- ThrowHelper.cs
- RuntimeIdentifierPropertyAttribute.cs
- ConvertEvent.cs
- TableLayoutSettingsTypeConverter.cs
- ListViewItemCollectionEditor.cs
- QilXmlReader.cs
- PLINQETWProvider.cs
- SettingsSavedEventArgs.cs
- VisualStateGroup.cs
- EastAsianLunisolarCalendar.cs
- ServicePointManagerElement.cs
- HtmlInputButton.cs
- SqlUtil.cs
- DocumentPageHost.cs
- HierarchicalDataTemplate.cs
- CustomTokenProvider.cs
- ColorBlend.cs
- Perspective.cs
- DataColumn.cs
- DbBuffer.cs
- UInt32Storage.cs
- AutomationAttributeInfo.cs
- TiffBitmapEncoder.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ActivatableWorkflowsQueryResult.cs
- OdbcConnectionStringbuilder.cs
- XmlEncoding.cs
- RequestCachePolicy.cs
- DataIdProcessor.cs
- WebPartRestoreVerb.cs
- XmlIncludeAttribute.cs
- InteropAutomationProvider.cs
- ImageSourceValueSerializer.cs
- UpWmlPageAdapter.cs
- Win32Exception.cs
- ChtmlTextWriter.cs
- BamlVersionHeader.cs
- TextEditorParagraphs.cs
- RSACryptoServiceProvider.cs
- XmlCollation.cs
- Knowncolors.cs
- MenuBindingsEditor.cs
- XmlFormatReaderGenerator.cs
- BasePattern.cs
- SQLDecimalStorage.cs
- InlineUIContainer.cs
- HitTestWithPointDrawingContextWalker.cs
- ThousandthOfEmRealDoubles.cs
- PenThreadPool.cs
- MexBindingElement.cs
- LongValidatorAttribute.cs
- InstanceDescriptor.cs
- UrlPropertyAttribute.cs
- WebPartDeleteVerb.cs
- SqlMethodCallConverter.cs
- InternalsVisibleToAttribute.cs
- WebConfigurationFileMap.cs
- KeyBinding.cs
- PartManifestEntry.cs
- FramingChannels.cs
- WpfWebRequestHelper.cs
- AuthenticateEventArgs.cs
- DayRenderEvent.cs
- Rectangle.cs
- Selection.cs
- XmlParserContext.cs
- ContentPresenter.cs
- CryptoProvider.cs
- GroupLabel.cs
- HttpBufferlessInputStream.cs
- UnescapedXmlDiagnosticData.cs
- NamespaceCollection.cs
- ProgressBarAutomationPeer.cs
- Blend.cs
- RedBlackList.cs
- MetricEntry.cs
- NamespaceEmitter.cs
- SQLByteStorage.cs
- OdbcDataAdapter.cs
- ByteAnimation.cs
- SharedPersonalizationStateInfo.cs
- UpdateCommand.cs
- ValidatorUtils.cs
- PackUriHelper.cs
- TokenBasedSetEnumerator.cs
- TransactionCache.cs
- DesignerDataParameter.cs
- Transform.cs
- CustomCredentialPolicy.cs
- WindowVisualStateTracker.cs
- FileDialogCustomPlace.cs
- FaultReasonText.cs
- WSDualHttpSecurity.cs
- GridPattern.cs
- DataGridViewCellValueEventArgs.cs
- Char.cs