Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / System / Windows / Automation / Peers / FlowDocumentPageViewerAutomationPeer.cs / 1 / FlowDocumentPageViewerAutomationPeer.cs
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// File: FlowDocumentPageViewerAutomationPeer.cs
//
// Description: AutomationPeer associated with FlowDocumentPageViewer.
//
//---------------------------------------------------------------------------
using System.Collections.Generic; // List
using System.Windows.Controls; // FlowDocumentPageViewer
using MS.Internal.Documents; // IFlowDocumentView
namespace System.Windows.Automation.Peers
{
///
/// AutomationPeer associated with FlowDocumentPageViewer.
///
public class FlowDocumentPageViewerAutomationPeer : DocumentViewerBaseAutomationPeer
{
///
/// Constructor.
///
/// Owner of the AutomationPeer.
public FlowDocumentPageViewerAutomationPeer(FlowDocumentPageViewer owner)
: base(owner)
{ }
///
///
///
///
/// AutomationPeer associated with DocumentViewerBase returns an AutomationPeer
/// for hosted Document and for elements in the style.
///
protected override List GetChildrenCore()
{
// Get children for all elements in the style.
List children = base.GetChildrenCore();
// If the owner is IFlowDocumentViewer, it means that it is embedded inside
// FlowDocumentReaer. In this case DocumentAutumationPeer is already exposed.
// Hence need to remove it from children collection.
if (Owner is IFlowDocumentViewer && children != null && children.Count > 0)
{
if (children[children.Count-1] is DocumentAutomationPeer)
{
children.RemoveAt(children.Count - 1);
if (children.Count == 0)
{
children = null;
}
}
}
return children;
}
///
///
///
protected override string GetClassNameCore()
{
return "FlowDocumentPageViewer";
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
//----------------------------------------------------------------------------
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// File: FlowDocumentPageViewerAutomationPeer.cs
//
// Description: AutomationPeer associated with FlowDocumentPageViewer.
//
//---------------------------------------------------------------------------
using System.Collections.Generic; // List
using System.Windows.Controls; // FlowDocumentPageViewer
using MS.Internal.Documents; // IFlowDocumentView
namespace System.Windows.Automation.Peers
{
///
/// AutomationPeer associated with FlowDocumentPageViewer.
///
public class FlowDocumentPageViewerAutomationPeer : DocumentViewerBaseAutomationPeer
{
///
/// Constructor.
///
/// Owner of the AutomationPeer.
public FlowDocumentPageViewerAutomationPeer(FlowDocumentPageViewer owner)
: base(owner)
{ }
///
///
///
///
/// AutomationPeer associated with DocumentViewerBase returns an AutomationPeer
/// for hosted Document and for elements in the style.
///
protected override List GetChildrenCore()
{
// Get children for all elements in the style.
List children = base.GetChildrenCore();
// If the owner is IFlowDocumentViewer, it means that it is embedded inside
// FlowDocumentReaer. In this case DocumentAutumationPeer is already exposed.
// Hence need to remove it from children collection.
if (Owner is IFlowDocumentViewer && children != null && children.Count > 0)
{
if (children[children.Count-1] is DocumentAutomationPeer)
{
children.RemoveAt(children.Count - 1);
if (children.Count == 0)
{
children = null;
}
}
}
return children;
}
///
///
///
protected override string GetClassNameCore()
{
return "FlowDocumentPageViewer";
}
}
}
// 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
- Conditional.cs
- ExpressionBindingCollection.cs
- WebPartConnectionsConfigureVerb.cs
- ResolveInfo.cs
- MaskedTextBoxDesigner.cs
- CmsInterop.cs
- ChangeProcessor.cs
- LinkLabel.cs
- ClientScriptManagerWrapper.cs
- Label.cs
- HttpGetProtocolReflector.cs
- WindowsRichEditRange.cs
- ProcessModule.cs
- WrappedOptions.cs
- _NegoStream.cs
- CompareValidator.cs
- ModelService.cs
- MatcherBuilder.cs
- PathFigureCollection.cs
- SendActivityDesigner.cs
- HtmlDocument.cs
- Scanner.cs
- QilValidationVisitor.cs
- SQLMoney.cs
- ApplyImportsAction.cs
- ViewValidator.cs
- _SslState.cs
- Validator.cs
- ToolStripSplitButton.cs
- UnmanagedMemoryStream.cs
- AggregateNode.cs
- ForwardPositionQuery.cs
- HandledMouseEvent.cs
- DataRowComparer.cs
- PenThreadWorker.cs
- PackageRelationship.cs
- LinkClickEvent.cs
- XmlTextReaderImplHelpers.cs
- ScrollPattern.cs
- NavigationProgressEventArgs.cs
- AttributeUsageAttribute.cs
- DesignParameter.cs
- ParallelEnumerableWrapper.cs
- ChtmlLinkAdapter.cs
- SqlDataReader.cs
- iisPickupDirectory.cs
- StorageAssociationSetMapping.cs
- RelatedPropertyManager.cs
- ParseChildrenAsPropertiesAttribute.cs
- SettingsPropertyIsReadOnlyException.cs
- CompareInfo.cs
- KnownColorTable.cs
- HttpRequest.cs
- ScriptComponentDescriptor.cs
- XmlEncoding.cs
- WebPartConnectionsCloseVerb.cs
- OneToOneMappingSerializer.cs
- HwndSubclass.cs
- MobileCategoryAttribute.cs
- PageBuildProvider.cs
- TimelineClockCollection.cs
- DateTimeSerializationSection.cs
- Attributes.cs
- PartitionerQueryOperator.cs
- HttpWebRequest.cs
- RuleProcessor.cs
- GenericUriParser.cs
- ThreadStateException.cs
- DataErrorValidationRule.cs
- ExpandableObjectConverter.cs
- SignedPkcs7.cs
- ScrollEventArgs.cs
- CfgParser.cs
- EmptyCollection.cs
- ExpressionBinding.cs
- EncoderFallback.cs
- Application.cs
- PartitionResolver.cs
- ITextView.cs
- SmiEventSink.cs
- OracleBoolean.cs
- Speller.cs
- AuthenticatingEventArgs.cs
- relpropertyhelper.cs
- Atom10ItemFormatter.cs
- ResourceReferenceExpression.cs
- ControlPropertyNameConverter.cs
- TextBox.cs
- BaseValidatorDesigner.cs
- Int32AnimationUsingKeyFrames.cs
- BaseCodePageEncoding.cs
- PropertyGridDesigner.cs
- SchemaNamespaceManager.cs
- Directory.cs
- Model3DGroup.cs
- StatusBarItem.cs
- X509Certificate2.cs
- ModelVisual3D.cs
- AuthStoreRoleProvider.cs
- TraceEventCache.cs