当前位置: 首页>>代码示例>>C#>>正文


C# STGMEDIUM类代码示例

本文整理汇总了C#中STGMEDIUM的典型用法代码示例。如果您正苦于以下问题:C# STGMEDIUM类的具体用法?C# STGMEDIUM怎么用?C# STGMEDIUM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


STGMEDIUM类属于命名空间,在下文中一共展示了STGMEDIUM类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetData

			internal uint SetData(FORMATETC pformatetc, STGMEDIUM pmedium, bool release) {
				return E_NOTIMPL;
			}
开发者ID:nlhepler,项目名称:mono,代码行数:3,代码来源:Win32DnD.cs

示例2: STGMEDIUM

        void IDataObject.GetData(FORMATETC[] fmt, STGMEDIUM[] m) {
            STGMEDIUM retMedium = new STGMEDIUM();

            if (fmt == null || fmt.Length < 1)
                return;

            foreach (DataCacheEntry e in this.entries) {
                if (e.Format.cfFormat == fmt[0].cfFormat /*|| fmt[0].cfFormat == InternalNativeMethods.CF_HDROP*/) {
                    retMedium.tymed = e.Format.tymed;

                    // Caller must delete the memory.
                    retMedium.unionmember = DragDropHelper.CopyHGlobal(new IntPtr(e.Data));
                    break;
                }
            }

            if (m != null && m.Length > 0)
                m[0] = retMedium;
        }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:19,代码来源:DataObject.cs

示例3:

 void IDataObject.SetData(FORMATETC[] fmt, STGMEDIUM[] m, int fRelease) {
 }
开发者ID:CforED,项目名称:Node.js-Tools-for-Visual-Studio,代码行数:2,代码来源:DataObject.cs

示例4:

 int IVsSimpleObjectList2.GetClipboardFormat(uint index, uint grfFlags, FORMATETC[] pFormatetc, STGMEDIUM[] pMedium)
 {
     return VSConstants.E_NOTIMPL;
 }
开发者ID:ufosky-server,项目名称:MultiversePlatform,代码行数:4,代码来源:LibraryNode.cs

示例5: STGMEDIUM

        void IDataObject.GetData(FORMATETC[] fmt, STGMEDIUM[] m)
        {
            STGMEDIUM retMedium = new STGMEDIUM();

            if(fmt == null || fmt.Length < 1)
                return;

            SafeGlobalAllocHandle copy = null;
            foreach(DataCacheEntry e in this.entries)
            {
                if(e.Format.cfFormat == fmt[0].cfFormat /*|| fmt[0].cfFormat == InternalNativeMethods.CF_HDROP*/)
                {
                    retMedium.tymed = e.Format.tymed;

                    // Caller must delete the memory.
                    copy = DragDropHelper.CopyHGlobal(e.Data);
                    retMedium.unionmember = copy.DangerousGetHandle();
                    break;
                }
            }

            if (m != null && m.Length > 0)
            {
                m[0] = retMedium;
                if (copy != null)
                    copy.SetHandleAsInvalid();
            }
        }
开发者ID:tunnelvisionlabs,项目名称:MPFProj10,代码行数:28,代码来源:DataObject.cs

示例6: CopyStgMedium

 private static extern int CopyStgMedium(ref STGMEDIUM pcstgmedSrc, ref STGMEDIUM pstgmedDest);
开发者ID:applejian,项目名称:cyberduck,代码行数:1,代码来源:DragDropLib.cs

示例7: CopyMedium

        /// <summary>
        /// Creates a copy of the STGMEDIUM structure.
        /// </summary>
        /// <param name="medium">The data to copy.</param>
        /// <returns>The copied data.</returns>
        private STGMEDIUM CopyMedium(ref STGMEDIUM medium)
        {
            STGMEDIUM sm = new STGMEDIUM();
            int hr = CopyStgMedium(ref medium, ref sm);
            if (hr != 0)
                throw Marshal.GetExceptionForHR(hr);

            return sm;
        }
开发者ID:applejian,项目名称:cyberduck,代码行数:14,代码来源:DragDropLib.cs

示例8: GetClipboardFormat

 /// <summary>
 /// Asks the given list item to renders a specific clipboard format that it supports.
 /// </summary>
 /// <param name="index"></param>
 /// <param name="grfFlags"></param>
 /// <param name="pFormatetc"></param>
 /// <param name="pMedium"></param>
 /// <returns></returns>
 public int GetClipboardFormat(uint index, uint grfFlags, FORMATETC[] pFormatetc, STGMEDIUM[] pMedium)
 {
     return VSConstants.E_NOTIMPL;
 }
开发者ID:IntranetFactory,项目名称:ndjango,代码行数:12,代码来源:ResultList.cs

示例9: STGMEDIUM

        void IDataObject.GetData(FORMATETC[] fmt, STGMEDIUM[] m) {
            STGMEDIUM retMedium = new STGMEDIUM();

            foreach (DataCacheEntry e in this.entries) {
                if (e.format.cfFormat == fmt[0].cfFormat) {
                    retMedium.tymed = e.format.tymed;
                    retMedium.unionmember = CopyHGlobal(e.data);
                    break;
                }
            }

            m[0] = retMedium;
        }
开发者ID:hesam,项目名称:SketchSharp,代码行数:13,代码来源:DataObject.cs

示例10: GetDataHere

        public uint GetDataHere(ref FORMATETC pFormatetc, out STGMEDIUM pMedium)
        {
            Trace.WriteLine("GetDataHere");

            pMedium = new STGMEDIUM();

            return (uint)E_NOTIMPL;
        }
开发者ID:minhnguyen31093,项目名称:Reminiscent,代码行数:8,代码来源:ExtendedRichTextBox.cs

示例11: SetData

        public uint SetData(ref FORMATETC a, ref STGMEDIUM b, bool fRelease)
        {
            //mpFormatetc = pFormatectIn;
            //mpmedium = pmedium;

            Trace.WriteLine("SetData");

            return (int)S_OK;
        }
开发者ID:minhnguyen31093,项目名称:Reminiscent,代码行数:9,代码来源:ExtendedRichTextBox.cs

示例12: GetData

        public uint GetData(ref FORMATETC pFormatetc, ref STGMEDIUM pMedium)
        {
            IntPtr hDst = mBitmap.GetHbitmap();

            pMedium.tymed = (int)TYMED.TYMED_GDI;
            pMedium.unionmember = hDst;
            pMedium.pUnkForRelease = IntPtr.Zero;

            return (uint)S_OK;
        }
开发者ID:minhnguyen31093,项目名称:Reminiscent,代码行数:10,代码来源:ExtendedRichTextBox.cs

示例13: STGMEDIUM

        void IDataObject.GetData(FORMATETC[] fmt, STGMEDIUM[] m)
        {
            STGMEDIUM retMedium = new STGMEDIUM();

            if (fmt == null || fmt.Length < 1)
                return;

            foreach (DataCacheEntry e in this.entries)
            {
                if (e.format.cfFormat == fmt[0].cfFormat)
                {
                    retMedium.tymed = e.format.tymed;
                    retMedium.unionmember = CopyHGlobal(new IntPtr(e.data));
                    break;
                }
            }

            if (m != null && m.Length > 0)
                m[0] = retMedium;
        }
开发者ID:hesam,项目名称:SketchSharp,代码行数:20,代码来源:DataObject.cs

示例14: AddFormatAndMedium

		private static bool AddFormatAndMedium(ClipboardFormats cfFormat, object data) {
			STGMEDIUM	medium;
			FORMATETC	format;
			IntPtr		hmem;
			IntPtr		hmem_ptr;
			byte[]		b;

			switch(cfFormat) {
				case ClipboardFormats.CF_TEXT: {
					b = XplatUIWin32.StringToAnsi ((string)data);
					hmem = XplatUIWin32.CopyToMoveableMemory (b);
					break;
				}

				case ClipboardFormats.CF_UNICODETEXT: {
					b = XplatUIWin32.StringToUnicode ((string)data);
					hmem = XplatUIWin32.CopyToMoveableMemory (b);
					break;
				}

				case ClipboardFormats.CF_HDROP: {
					IEnumerator	e;
					StringBuilder	sb;
					long		hmem_string_ptr;
					IntPtr		string_buffer;
					int		string_buffer_size;

					sb = new StringBuilder();

					// Make sure object is enumerable; otherwise
					if ((data is string) || !(data is IEnumerable)) {
						sb.Append(data.ToString());
						sb.Append('\0');
						sb.Append('\0');
					} else {
						e = ((IEnumerable)data).GetEnumerator();
						while (e.MoveNext()) {
							sb.Append(e.Current.ToString());
							sb.Append('\0');
						}
						sb.Append('\0');
					}

					string_buffer = Marshal.StringToHGlobalUni(sb.ToString());
					string_buffer_size = (int)XplatUIWin32.Win32GlobalSize(string_buffer);

					// Write DROPFILES structure
					hmem = XplatUIWin32.Win32GlobalAlloc(XplatUIWin32.GAllocFlags.GMEM_MOVEABLE | XplatUIWin32.GAllocFlags.GMEM_DDESHARE, 0x14 + string_buffer_size);
					hmem_ptr = XplatUIWin32.Win32GlobalLock(hmem);
					Marshal.WriteInt32(hmem_ptr, 0x14);					// pFiles
					Marshal.WriteInt32(hmem_ptr, 1 * Marshal.SizeOf(typeof(uint)), 0);	// point.x
					Marshal.WriteInt32(hmem_ptr, 2 * Marshal.SizeOf(typeof(uint)), 0);	// point.y
					Marshal.WriteInt32(hmem_ptr, 3 * Marshal.SizeOf(typeof(uint)), 0);	// fNc
					Marshal.WriteInt32(hmem_ptr, 4 * Marshal.SizeOf(typeof(uint)), 1);	// fWide

					hmem_string_ptr = (long)hmem_ptr;
					hmem_string_ptr += 0x14;

					XplatUIWin32.Win32CopyMemory(new IntPtr(hmem_string_ptr), string_buffer, string_buffer_size);
					Marshal.FreeHGlobal(string_buffer);
					XplatUIWin32.Win32GlobalUnlock(hmem_ptr);

					break;
				}

				case ClipboardFormats.CF_DIB: {
					b = XplatUIWin32.ImageToDIB((Image)data);
					hmem = XplatUIWin32.CopyToMoveableMemory (b);
					break;
				}

				default: {
					hmem = IntPtr.Zero;
					break;
				}
			}

			if (hmem != IntPtr.Zero) {
				medium = new STGMEDIUM();
				medium.tymed = TYMED.TYMED_HGLOBAL;
				medium.hHandle = hmem;
				medium.pUnkForRelease = IntPtr.Zero;
				DragMediums.Add(medium);

				format = new FORMATETC();
				format.ptd = IntPtr.Zero;
				format.dwAspect = DVASPECT.DVASPECT_CONTENT;
				format.lindex = -1;
				format.tymed = TYMED.TYMED_HGLOBAL;
				format.cfFormat = cfFormat;
				DragFormats.Add(format);

				return true;
			}

			return false;
		}
开发者ID:nlhepler,项目名称:mono,代码行数:97,代码来源:Win32DnD.cs

示例15: GetDataHere

        /// <summary>
        /// Gets the specified data.
        /// </summary>
        /// <param name="format">The requested data format.</param>
        /// <param name="medium">When the function returns, contains the requested data.</param>
        /// <remarks>Differs from GetData only in that the STGMEDIUM storage is
        /// allocated and owned by the caller.</remarks>
        public void GetDataHere(ref FORMATETC format, ref STGMEDIUM medium)
        {
            // Locate the data
            KeyValuePair<FORMATETC, STGMEDIUM> dataEntry;
            if (GetDataEntry(ref format, out dataEntry))
            {
                STGMEDIUM source = dataEntry.Value;
                medium = CopyMedium(ref source);
                return;
            }

            // Didn't find it. Return an empty data medium.
            medium = default(STGMEDIUM);
        }
开发者ID:applejian,项目名称:cyberduck,代码行数:21,代码来源:DragDropLib.cs


注:本文中的STGMEDIUM类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。