System.Windows.Forms.HexBox.CanPaste C# (CSharp) Method

CanPaste() public method

Return true if Paste method could be invoked.
public CanPaste ( ) : bool
return bool
        public bool CanPaste()
        {
            if (ReadOnly || !this.Enabled) return false;

            if(_byteProvider == null || !_byteProvider.SupportsInsertBytes())
                return false;

            if(!_byteProvider.SupportsDeleteBytes() && _selectionLength > 0)
                return false;

            IDataObject da = Clipboard.GetDataObject();
            if(da.GetDataPresent("BinaryData"))
                return true;
            else if(da.GetDataPresent(typeof(string)))
                return true;
            else
                return false;
        }