Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Framework / MS / Internal / Ink / ClipboardData.cs / 1 / 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
- TextBoxDesigner.cs
- SQLBinary.cs
- LineVisual.cs
- ModelItemImpl.cs
- Atom10FormatterFactory.cs
- ErrorStyle.cs
- AppearanceEditorPart.cs
- ProtocolsSection.cs
- FormClosingEvent.cs
- ZipIOCentralDirectoryFileHeader.cs
- BrushValueSerializer.cs
- CapabilitiesUse.cs
- ContentPosition.cs
- localization.cs
- XamlStyleSerializer.cs
- Int16AnimationUsingKeyFrames.cs
- FactoryRecord.cs
- DelegateSerializationHolder.cs
- GACIdentityPermission.cs
- HttpResponseWrapper.cs
- CompModSwitches.cs
- BypassElementCollection.cs
- HostingEnvironmentWrapper.cs
- TableAutomationPeer.cs
- CapabilitiesPattern.cs
- TableProviderWrapper.cs
- NamespaceInfo.cs
- RawStylusInput.cs
- ExtensibleClassFactory.cs
- AvTraceFormat.cs
- EndpointAddressMessageFilter.cs
- RequestSecurityToken.cs
- CommandHelpers.cs
- Polyline.cs
- UpdateException.cs
- Visual3DCollection.cs
- ByteAnimationBase.cs
- Vars.cs
- NonClientArea.cs
- TextDecorations.cs
- DataServiceStreamProviderWrapper.cs
- MediaCommands.cs
- UdpContractFilterBehavior.cs
- WebPartConnectionsCancelVerb.cs
- DecimalAnimation.cs
- ObjectNotFoundException.cs
- CommonDialog.cs
- TypeSystem.cs
- XPathAxisIterator.cs
- RunClient.cs
- CodeCompiler.cs
- PropertyGridCommands.cs
- WindowsSecurityTokenAuthenticator.cs
- MemberHolder.cs
- ExpressionVisitor.cs
- ReachUIElementCollectionSerializer.cs
- SystemFonts.cs
- CounterSampleCalculator.cs
- PingReply.cs
- __Filters.cs
- WindowShowOrOpenTracker.cs
- FileDialog_Vista_Interop.cs
- KnownBoxes.cs
- ReflectPropertyDescriptor.cs
- DataControlReferenceCollection.cs
- IIS7UserPrincipal.cs
- HttpListenerContext.cs
- ExpressionBindingCollection.cs
- TemplateAction.cs
- NamedPipeConnectionPool.cs
- XmlJsonReader.cs
- ThreadStateException.cs
- XPathDocumentBuilder.cs
- SwitchElementsCollection.cs
- ProofTokenCryptoHandle.cs
- _FtpControlStream.cs
- ExpandoObject.cs
- CompilerScope.Storage.cs
- ParameterCollection.cs
- XmlDocumentType.cs
- InternalSafeNativeMethods.cs
- Dump.cs
- SetState.cs
- OperationBehaviorAttribute.cs
- TypeSystemProvider.cs
- MessageQueuePermissionEntryCollection.cs
- XmlSerializerFaultFormatter.cs
- InternalResources.cs
- SecurityRuntime.cs
- ResourceDefaultValueAttribute.cs
- NativeRecognizer.cs
- ToolboxSnapDragDropEventArgs.cs
- CorrelationQuery.cs
- XmlHierarchyData.cs
- Deserializer.cs
- InkCollectionBehavior.cs
- GroupBox.cs
- SqlBuffer.cs
- Compiler.cs
- UInt16Storage.cs