Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / Tools / System.Activities.Presentation / System / Activities / Presentation / View / PrimarySelectionAdorner.cs / 1305376 / PrimarySelectionAdorner.cs
//---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.View { using System; using System.Collections.Generic; using System.Text; using System.Windows.Documents; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Runtime; [Fx.Tag.XamlVisible(false)] sealed class PrimarySelectionAdorner : Adorner { public PrimarySelectionAdorner(UIElement adornedElement) : base(adornedElement) { } protected override void OnInitialized(EventArgs e) { this.IsHitTestVisible = false; } protected override void OnRender(DrawingContext drawingContext) { ContentControl contentControl = this.AdornedElement as ContentControl; double height = contentControl.ActualHeight; double width = contentControl.ActualWidth; Rect adornedElementRect = new Rect(this.DesiredSize.Width / 2 - width / 2, 0, width, height);; Pen renderPen = new Pen(SystemColors.HighlightBrush, 3); drawingContext.DrawRoundedRectangle(null, renderPen, adornedElementRect, 5, 5); //Geometry geometry = new RectangleGeometry(new Rect(-1000, -1000, 2000, 2000)); //geometry = Geometry.Combine(geometry, new RectangleGeometry(adornedElementRect, 5, 5), GeometryCombineMode.Exclude,null); //drawingContext.PushClip(geometry); //SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(160, 120, 120, 120)); //drawingContext.DrawRectangle(brush, renderPen, new Rect(-1000, -1000, 2000, 2000)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //---------------------------------------------------------------- // Copyright (c) Microsoft Corporation. All rights reserved. //--------------------------------------------------------------- namespace System.Activities.Presentation.View { using System; using System.Collections.Generic; using System.Text; using System.Windows.Documents; using System.Windows; using System.Windows.Controls; using System.Windows.Media; using System.Runtime; [Fx.Tag.XamlVisible(false)] sealed class PrimarySelectionAdorner : Adorner { public PrimarySelectionAdorner(UIElement adornedElement) : base(adornedElement) { } protected override void OnInitialized(EventArgs e) { this.IsHitTestVisible = false; } protected override void OnRender(DrawingContext drawingContext) { ContentControl contentControl = this.AdornedElement as ContentControl; double height = contentControl.ActualHeight; double width = contentControl.ActualWidth; Rect adornedElementRect = new Rect(this.DesiredSize.Width / 2 - width / 2, 0, width, height);; Pen renderPen = new Pen(SystemColors.HighlightBrush, 3); drawingContext.DrawRoundedRectangle(null, renderPen, adornedElementRect, 5, 5); //Geometry geometry = new RectangleGeometry(new Rect(-1000, -1000, 2000, 2000)); //geometry = Geometry.Combine(geometry, new RectangleGeometry(adornedElementRect, 5, 5), GeometryCombineMode.Exclude,null); //drawingContext.PushClip(geometry); //SolidColorBrush brush = new SolidColorBrush(Color.FromArgb(160, 120, 120, 120)); //drawingContext.DrawRectangle(brush, renderPen, new Rect(-1000, -1000, 2000, 2000)); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
![Network programming in C#, Network Programming in VB.NET, Network Programming in .NET](/images/book.jpg)
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Page.cs
- TableCellCollection.cs
- WSHttpBinding.cs
- SafeArrayTypeMismatchException.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- PlainXmlSerializer.cs
- Size.cs
- Pair.cs
- NativeMethods.cs
- ConnectionInterfaceCollection.cs
- Dictionary.cs
- ExcCanonicalXml.cs
- CallSiteBinder.cs
- CustomErrorCollection.cs
- ObjectSpanRewriter.cs
- ProcessStartInfo.cs
- StateWorkerRequest.cs
- FunctionNode.cs
- MemberRelationshipService.cs
- XmlBinaryWriter.cs
- AuthorizationContext.cs
- MissingMemberException.cs
- IsolatedStorageFilePermission.cs
- HandleValueEditor.cs
- PrivateFontCollection.cs
- CookielessData.cs
- NavigationWindow.cs
- securitymgrsite.cs
- HttpResponseHeader.cs
- MatrixConverter.cs
- ClientSettingsSection.cs
- Transform3DGroup.cs
- WmfPlaceableFileHeader.cs
- WebResponse.cs
- PropertyDescriptorCollection.cs
- ProcessModule.cs
- ReadOnlyMetadataCollection.cs
- StaticExtension.cs
- PieceDirectory.cs
- ParagraphResult.cs
- Metafile.cs
- TemplateBamlRecordReader.cs
- XmlDataSource.cs
- NullRuntimeConfig.cs
- BindingCompleteEventArgs.cs
- DataRowComparer.cs
- WorkflowMessageEventArgs.cs
- HttpCacheVaryByContentEncodings.cs
- versioninfo.cs
- Function.cs
- PartialArray.cs
- SamlAuthenticationStatement.cs
- PackageFilter.cs
- DataTransferEventArgs.cs
- ConversionValidationRule.cs
- XmlValueConverter.cs
- MenuItem.cs
- DataControlFieldCollection.cs
- PointAnimation.cs
- MetadataElement.cs
- LinkUtilities.cs
- AmbientProperties.cs
- ControlLocalizer.cs
- InstanceHandleReference.cs
- ManagedIStream.cs
- RuntimeIdentifierPropertyAttribute.cs
- ControlBuilder.cs
- FontFaceLayoutInfo.cs
- WinFormsComponentEditor.cs
- LineVisual.cs
- TdsParser.cs
- DocumentXmlWriter.cs
- InvalidAsynchronousStateException.cs
- WorkflowService.cs
- ManualResetEventSlim.cs
- ProviderException.cs
- DataContractSet.cs
- SqlWebEventProvider.cs
- __Filters.cs
- DataGridViewRowPrePaintEventArgs.cs
- SatelliteContractVersionAttribute.cs
- ILGenerator.cs
- WebPartRestoreVerb.cs
- XmlBinaryReader.cs
- StringStorage.cs
- AuthenticationException.cs
- IgnoreSectionHandler.cs
- TrustSection.cs
- XmlAttributeAttribute.cs
- TypeTypeConverter.cs
- FreeFormDragDropManager.cs
- ResourceDisplayNameAttribute.cs
- HwndSubclass.cs
- RightsManagementErrorHandler.cs
- EntityDataSource.cs
- HostingEnvironmentException.cs
- HttpStaticObjectsCollectionBase.cs
- SettingsAttributeDictionary.cs
- XslNumber.cs
- ContextBase.cs