Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / MS / Internal / Ink / ClipboardData.cs / 1305600 / ClipboardData.cs
//---------------------------------------------------------------------------- // // File: ClipboardData.cs // // Description: // An abstract clipboard data class // // Features: // // History: // 11/17/2004 waynezen: Created // // Copyright (C) 2001 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Security; namespace MS.Internal.Ink { internal abstract class ClipboardData { //------------------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // // Internal Methods // //------------------------------------------------------------------------------- #region Internal Methods ////// Copy the data to the IDataObject /// /// The IDataObject instance ///Returns true if the data is copied. Otherwise, returns false ////// Critical: This code copies ink content to the clipboard and accepts a dataobject which is /// created under an elevation /// [SecurityCritical] internal bool CopyToDataObject(IDataObject dataObject) { // Check if the data can be copied if ( CanCopy() ) { // Do copy. DoCopy(dataObject); return true; } return false; } ////// Paste the data from the IDataObject /// /// The IDataObject instance internal void PasteFromDataObject(IDataObject dataObject) { // Check if we can paste. if ( CanPaste(dataObject) ) { // Do Paste. DoPaste(dataObject); } } internal abstract bool CanPaste(IDataObject dataObject); #endregion Internal Methods //-------------------------------------------------------------------------------- // // Protected Methods // //-------------------------------------------------------------------------------- #region Protected Methods // Those are the abstract methods which need to be implemented in the derived classes. protected abstract bool CanCopy(); protected abstract void DoCopy(IDataObject dataObject); protected abstract void DoPaste(IDataObject dataObject); #endregion Protected Methods } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: ClipboardData.cs // // Description: // An abstract clipboard data class // // Features: // // History: // 11/17/2004 waynezen: Created // // Copyright (C) 2001 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System; using System.Windows; using System.Security; namespace MS.Internal.Ink { internal abstract class ClipboardData { //------------------------------------------------------------------------------- // // Constructors // //------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // // Internal Methods // //------------------------------------------------------------------------------- #region Internal Methods ////// Copy the data to the IDataObject /// /// The IDataObject instance ///Returns true if the data is copied. Otherwise, returns false ////// Critical: This code copies ink content to the clipboard and accepts a dataobject which is /// created under an elevation /// [SecurityCritical] internal bool CopyToDataObject(IDataObject dataObject) { // Check if the data can be copied if ( CanCopy() ) { // Do copy. DoCopy(dataObject); return true; } return false; } ////// Paste the data from the IDataObject /// /// The IDataObject instance internal void PasteFromDataObject(IDataObject dataObject) { // Check if we can paste. if ( CanPaste(dataObject) ) { // Do Paste. DoPaste(dataObject); } } internal abstract bool CanPaste(IDataObject dataObject); #endregion Internal Methods //-------------------------------------------------------------------------------- // // Protected Methods // //-------------------------------------------------------------------------------- #region Protected Methods // Those are the abstract methods which need to be implemented in the derived classes. protected abstract bool CanCopy(); protected abstract void DoCopy(IDataObject dataObject); protected abstract void DoPaste(IDataObject dataObject); #endregion Protected Methods } } // 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
- DataObjectFieldAttribute.cs
- TreeNodeMouseHoverEvent.cs
- InkCanvasAutomationPeer.cs
- _emptywebproxy.cs
- SoapTypeAttribute.cs
- NameValueSectionHandler.cs
- NavigationProgressEventArgs.cs
- ThreadStaticAttribute.cs
- OdbcException.cs
- HttpListenerContext.cs
- GraphicsContainer.cs
- UriTemplateVariableQueryValue.cs
- InvalidateEvent.cs
- DependencyPropertyConverter.cs
- SiteMapSection.cs
- NativeMethodsCLR.cs
- DbConnectionPoolIdentity.cs
- CodeLinePragma.cs
- InvalidCastException.cs
- ItemDragEvent.cs
- DataChangedEventManager.cs
- SoapEnumAttribute.cs
- EpmSyndicationContentSerializer.cs
- VisualTreeHelper.cs
- SplashScreenNativeMethods.cs
- Int32Rect.cs
- ContentFileHelper.cs
- RSAOAEPKeyExchangeDeformatter.cs
- XmlSchemaValidationException.cs
- IndicShape.cs
- _LoggingObject.cs
- CmsInterop.cs
- DefaultPropertyAttribute.cs
- ViewGenResults.cs
- GridItem.cs
- SubqueryRules.cs
- CompiledAction.cs
- VerticalAlignConverter.cs
- AddressHeaderCollectionElement.cs
- _TransmitFileOverlappedAsyncResult.cs
- QueryAccessibilityHelpEvent.cs
- WorkflowInstance.cs
- TableTextElementCollectionInternal.cs
- CompressedStack.cs
- GenericsInstances.cs
- CodeDomDesignerLoader.cs
- BitmapEffect.cs
- IssuedSecurityTokenParameters.cs
- TypeResolver.cs
- MimeObjectFactory.cs
- ExpressionsCollectionConverter.cs
- PriorityBinding.cs
- WinCategoryAttribute.cs
- CharEntityEncoderFallback.cs
- ChineseLunisolarCalendar.cs
- SerialStream.cs
- TraceContext.cs
- LinkLabelLinkClickedEvent.cs
- KnownBoxes.cs
- SQLSingleStorage.cs
- SQLInt32Storage.cs
- MouseGesture.cs
- CqlParser.cs
- ImageCodecInfoPrivate.cs
- PageEventArgs.cs
- ProviderException.cs
- SafeRegistryHandle.cs
- GeneralTransform2DTo3DTo2D.cs
- SelectorItemAutomationPeer.cs
- QuestionEventArgs.cs
- HashAlgorithm.cs
- DebugHandleTracker.cs
- UnsafeNativeMethods.cs
- HeaderedContentControl.cs
- WebPartCollection.cs
- ToggleProviderWrapper.cs
- ZoneButton.cs
- VirtualizedContainerService.cs
- AutomationPeer.cs
- PageTheme.cs
- ReadOnlyPropertyMetadata.cs
- ReachDocumentReferenceSerializerAsync.cs
- GridProviderWrapper.cs
- CodeTypeMember.cs
- SmtpNegotiateAuthenticationModule.cs
- XamlLoadErrorInfo.cs
- Bitmap.cs
- PowerStatus.cs
- DataGridViewSelectedColumnCollection.cs
- ObjectAnimationUsingKeyFrames.cs
- OutputScopeManager.cs
- SplayTreeNode.cs
- CharAnimationUsingKeyFrames.cs
- ApplicationException.cs
- SafeSecurityHandles.cs
- OSFeature.cs
- TraceInternal.cs
- AssemblyHash.cs
- ItemAutomationPeer.cs
- util.cs