Exemple #1
0
        /// <summary>
        /// Create new DataFormatIdentify and add cache.
        /// </summary>
        /// <param name="nativeName"></param>
        /// <returns></returns>
        private static FormatId RegisterFormatId(string nativeName)
        {
            var id = DataObjectUtils.GetFormatId(nativeName);

            _formats.TryAdd(id, new InternalFormatID(nativeName, ""));
            return(new FormatId(id));
        }
Exemple #2
0
        /// <summary>
        /// Create new DataFormatIdentify and add cache.
        /// </summary>
        /// <param name="nativeName"></param>
        /// <returns></returns>
        private static string RegisterFormatId(int id)
        {
            var name = DataObjectUtils.GetFormatName(id);

            _formats.TryAdd(id, new InternalFormatID(name, ""));
            return(name);
        }
        public string GetString(FormatId id, NativeStringType type)
        {
            var       f = DataObjectUtils.GetFormatEtc(id);
            STGMEDIUM s = default;

            try
            {
                DataObject.GetData(ref f, out s);
                return(s.GetString(type));
            }
            finally
            {
                s.Dispose();
            }
        }
        public FORMATETC GetCanonicalFormatEtc(string format)
        {
            var f = DataObjectUtils.GetFormatEtc(format);

            return(GetCanonicalFormatEtc(ref f));
        }
        public bool GetDataPresent(string format, bool autoConvert)
        {
            var f = DataObjectUtils.GetFormatEtc(format);

            return(GetDataPresent(ref f));
        }
        public bool GetDataPresent(int format)
        {
            var f = DataObjectUtils.GetFormatEtc(format);

            return(GetDataPresent(ref f));
        }