1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- using System;
- using System.Runtime.InteropServices;
- using TDMS.Common;
- namespace TDMS.Externals
- {
- internal partial class DDC : DIAdemConnectivity
- {
- /// <summary>
- /// 设置文件属性的值
- /// </summary>
- /// <param name="file">文件句柄</param>
- /// <param name="property">文件属性的名称</param>
- /// <param name="__arglist">可变参数列表,用于传递属性的值</param>
- /// <returns>执行结果。0 表示成功,负数表示错误代码</returns>
- [DllImport(DLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "DDC_SetFileProperty")]
- public static extern Error SetFileProperty(IntPtr file, string property, __arglist);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetFilePropertyTimestampComponents")]
- public static extern Error SetFilePropertyTimestampComponents(IntPtr file,
- string property,
- uint year,
- uint month,
- uint day,
- uint hour,
- uint minute,
- uint second,
- double milliSecond);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_SetFilePropertyV")]
- public static extern Error SetFilePropertyV(IntPtr file, string property, IntPtr args);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFileProperty")]
- public static extern Error GetFileProperty(IntPtr file,
- string property,
- ref byte value,
- uint valueSizeInBytes);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyTimestampComponents")]
- public static extern Error GetFilePropertyTimestampComponents(IntPtr file,
- string property,
- out uint year,
- out uint month,
- out uint day,
- out uint hour,
- out uint minute,
- out uint second,
- out double milliSecond,
- out uint weekDay);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFileStringPropertyLength")]
- public static extern Error GetFileStringPropertyLength(IntPtr file, string property, out uint length);
- [DllImport(DLL, CallingConvention = CallingConvention.Cdecl, EntryPoint = "DDC_CreateFileProperty")]
- public static extern Error CreateFileProperty(IntPtr file,
- string property,
- TDMSDataType dataType,
- __arglist);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateFilePropertyTimestampComponents")]
- public static extern Error CreateFilePropertyTimestampComponents(IntPtr file,
- string property,
- uint year,
- uint month,
- uint day,
- uint hour,
- uint minute,
- uint second,
- double milliSecond);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_CreateFilePropertyV")]
- public static extern Error CreateFilePropertyV(IntPtr file,
- string property,
- TDMSDataType dataType,
- IntPtr args);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_FilePropertyExists")]
- public static extern Error FilePropertyExists(IntPtr file, string property, out bool exists);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetNumFileProperties")]
- public static extern Error CountFileProperties(IntPtr file, out uint numProperties);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyNames")]
- public static extern Error GetFilePropertyNames(IntPtr file, IntPtr[] propertyNames, uint numPropertyNames);
- [DllImport(DLL, CallingConvention = CallingConvention.StdCall, EntryPoint = "DDC_GetFilePropertyType")]
- public static extern Error GetFilePropertyType(IntPtr file, string property, out TDMSDataType dataType);
- }
- }
|