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
- PeerObject.cs
- OdbcConnectionString.cs
- DeflateEmulationStream.cs
- InputBindingCollection.cs
- ToolStripSeparator.cs
- TranslateTransform.cs
- DispatchWrapper.cs
- DataListGeneralPage.cs
- AuthenticationModulesSection.cs
- Documentation.cs
- DesignerDataSourceView.cs
- DependencyPropertyConverter.cs
- ConnectionDemuxer.cs
- ExceptionUtil.cs
- ResponseStream.cs
- TypeValidationEventArgs.cs
- JournalNavigationScope.cs
- WorkflowExecutor.cs
- NameValuePermission.cs
- InputScope.cs
- Opcode.cs
- FileLevelControlBuilderAttribute.cs
- DefaultParameterValueAttribute.cs
- LeftCellWrapper.cs
- CompilerWrapper.cs
- util.cs
- ShapingEngine.cs
- _OverlappedAsyncResult.cs
- BaseAddressElementCollection.cs
- OpCodes.cs
- SafeBitVector32.cs
- EnumerableRowCollection.cs
- DirtyTextRange.cs
- Attribute.cs
- ZoomPercentageConverter.cs
- TranslateTransform.cs
- TargetInvocationException.cs
- CompleteWizardStep.cs
- CompiledRegexRunnerFactory.cs
- XmlFormatExtensionAttribute.cs
- CurrencyWrapper.cs
- SectionXmlInfo.cs
- ScriptingProfileServiceSection.cs
- DecimalConstantAttribute.cs
- FileDialog_Vista.cs
- DBSchemaRow.cs
- CaseCqlBlock.cs
- FormsAuthenticationConfiguration.cs
- TextRunProperties.cs
- DTCTransactionManager.cs
- HtmlInputRadioButton.cs
- Converter.cs
- FormViewInsertedEventArgs.cs
- ConsumerConnectionPoint.cs
- IsolatedStoragePermission.cs
- TreeNodeCollection.cs
- X500Name.cs
- DLinqDataModelProvider.cs
- Directory.cs
- VarInfo.cs
- CodeCommentStatement.cs
- TypeDescriptionProvider.cs
- Image.cs
- JavascriptXmlWriterWrapper.cs
- XamlWriter.cs
- OleDbPropertySetGuid.cs
- InvalidDataContractException.cs
- DetailsViewRow.cs
- PageCatalogPart.cs
- HtmlInputText.cs
- InstancePersistenceCommand.cs
- TraceEventCache.cs
- CompoundFileReference.cs
- PointAnimationClockResource.cs
- DataSourceComponent.cs
- HandleCollector.cs
- FormatSettings.cs
- AsymmetricAlgorithm.cs
- CroppedBitmap.cs
- IBuiltInEvidence.cs
- WindowsAuthenticationEventArgs.cs
- DataServiceHost.cs
- RuleRef.cs
- HeaderCollection.cs
- SequenceRange.cs
- HostingEnvironmentSection.cs
- CompositeScriptReference.cs
- UdpDiscoveryEndpointProvider.cs
- HtmlInputImage.cs
- Timer.cs
- NTAccount.cs
- COM2ExtendedBrowsingHandler.cs
- TimeSpanConverter.cs
- NullableDoubleAverageAggregationOperator.cs
- InvokeMethodActivityDesigner.cs
- AmbientLight.cs
- IgnoreFileBuildProvider.cs
- XmlConvert.cs
- ReferentialConstraint.cs
- XamlRtfConverter.cs