本文整理汇总了C#中__Native类的典型用法代码示例。如果您正苦于以下问题:C# __Native类的具体用法?C# __Native怎么用?C# __Native使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
__Native类属于命名空间,在下文中一共展示了__Native类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Size = @ref.Size;
this.SizeImageInfo = @ref.SizeImageInfo;
this.ViewCount = @ref.ViewCount;
this.ButtonCount = @ref.ButtonCount;
this.AxeCount = @ref.AxeCount;
this.PovCount = @ref.PovCount;
this.BufferSize = @ref.BufferSize;
this.BufferUsed = @ref.BufferUsed;
this.ImageInfoArrayPointer = @ref.ImageInfoArrayPointer;
if (this.BufferSize > 0 && this.ImageInfoArrayPointer != IntPtr.Zero)
{
int nbImageInfoElements = BufferSize/ sizeof(DeviceImage.__Native);
Images = new DeviceImage[nbImageInfoElements];
var pImageInfo = (DeviceImage.__Native*)this.ImageInfoArrayPointer;
for (int i = 0; i < Images.Length; i++)
{
var image = new DeviceImage();
image.__MarshalFrom(ref *pImageInfo);
pImageInfo++;
}
}
}
示例2: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.FontFace = (@ref.FontFace == IntPtr.Zero) ? null : new FontFace(@ref.FontFace);
// If FontFace != null, adds a reference to it
if (FontFace != null)
((IUnknown) this.FontFace).AddReference();
this.FontSize= @ref.FontEmSize;
this.GlyphCount = @ref.GlyphCount;
if (@ref.GlyphIndices != IntPtr.Zero)
{
Indices = new short[GlyphCount];
if (GlyphCount > 0)
Utilities.Read(@ref.GlyphIndices, Indices, 0, GlyphCount);
}
if (@ref.GlyphAdvances != IntPtr.Zero)
{
Advances = new float[GlyphCount];
if (GlyphCount > 0)
Utilities.Read(@ref.GlyphAdvances, Advances, 0, GlyphCount);
}
if (@ref.GlyphOffsets != IntPtr.Zero)
{
Offsets = new GlyphOffset[GlyphCount];
if (GlyphCount > 0)
Utilities.Read(@ref.GlyphOffsets, Offsets, 0, GlyphCount);
}
this.IsSideways = @ref.IsSideways;
this.BidiLevel = @ref.BidiLevel;
}
示例3: __MarshalTo
// Method to marshal from managed struct tot native
internal unsafe void __MarshalTo(ref __Native @ref)
{
@ref.LocaleName = (this.LocaleName == null) ? IntPtr.Zero : Marshal.StringToHGlobalUni(this.LocaleName);
@ref.Text = (this.Text == null) ? IntPtr.Zero : Marshal.StringToHGlobalUni(this.Text);
@ref.TextLength = (this.Text == null)?0: this.Text.Length;
@ref.ClusterMap = this.ClusterMap;
@ref.TextPosition = this.TextPosition;
}
示例4: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.LocaleName = (@ref.LocaleName == IntPtr.Zero) ? null : Marshal.PtrToStringUni(@ref.LocaleName);
this.Text = (@ref.Text == IntPtr.Zero) ? null : Marshal.PtrToStringUni(@ref.Text, @ref.TextLength);
this.TextLength = @ref.TextLength;
this.ClusterMap = @ref.ClusterMap;
this.TextPosition = @ref.TextPosition;
}
示例5: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(__Native* @ref)
{
this.Format = null;
this.FormatPointer = @ref->FormatPointer;
if (this.FormatPointer != IntPtr.Zero)
this.Format = WaveFormat.MarshalFrom(this.FormatPointer);
this.MaxFrameCount = @ref->MaxFrameCount;
}
示例6: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Category = @ref.Category;
this.Severity = @ref.Severity;
this.Id = @ref.Id;
this.Description = (@ref.PDescription == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(@ref.PDescription, @ref.DescriptionByteLength);
this.DescriptionByteLength = @ref.DescriptionByteLength;
}
示例7: UpdateNative
internal void UpdateNative(ref __Native native, IntPtr pinBuffer)
{
native.Pointer = pinBuffer;
if (managedData != null)
{
native.Size = managedData.Length;
}
}
示例8: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Size = @ref.Size;
this.ObjectSize = @ref.ObjectSize;
this.Flags = @ref.Flags;
this.DataSize = @ref.DataSize;
this.ObjectArrayCount = @ref.ObjectArrayCount;
this.ObjectArrayPointer = @ref.ObjectArrayPointer;
}
示例9: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.AttribId = @ref.AttribId;
this.FaceStart = @ref.FaceStart;
this.FaceCount = @ref.FaceCount;
this.VertexStart = @ref.VertexStart;
this.VertexCount = @ref.VertexCount;
this.BonedIdsPointer = @ref.BonedIdsPointer;
}
示例10: __MarshalTo
// Method to marshal from managed struct tot native
internal unsafe void __MarshalTo(ref __Native @ref)
{
@ref.Size = this.Size;
@ref.Flags = this.Flags;
@ref.BufferBytes = this.BufferBytes;
@ref.Reserved = this.Reserved;
@ref.pFormat = WaveFormat.MarshalToPtr(Format);
@ref.AlgorithmFor3D = this.AlgorithmFor3D;
}
示例11: __MarshalFrom
// Method to marshal from native to managed struct
internal void __MarshalFrom(ref __Native @ref)
{
waveFormatTag = @ref.pcmWaveFormat.waveFormatTag;
channels = @ref.pcmWaveFormat.channels;
sampleRate = @ref.pcmWaveFormat.sampleRate;
averageBytesPerSecond = @ref.pcmWaveFormat.averageBytesPerSecond;
blockAlign = @ref.pcmWaveFormat.blockAlign;
bitsPerSample = @ref.pcmWaveFormat.bitsPerSample;
extraSize = @ref.extraSize;
}
示例12: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.waveFormatTag = @ref.pcmWaveFormat.waveFormatTag;
this.channels = @ref.pcmWaveFormat.channels;
this.sampleRate = @ref.pcmWaveFormat.sampleRate;
this.averageBytesPerSecond = @ref.pcmWaveFormat.averageBytesPerSecond;
this.blockAlign = @ref.pcmWaveFormat.blockAlign;
this.bitsPerSample = @ref.pcmWaveFormat.bitsPerSample;
this.extraSize = @ref.extraSize;
}
示例13: __MarshalFrom
// Method to marshal from native to managed struct
internal unsafe void __MarshalFrom(ref __Native @ref)
{
this.Category = @ref.Category;
this.Priority = @ref.Priority;
this.Pitch = @ref.Pitch;
this.Volume = @ref.Volume;
this.TrackProperties = new TrackProperties[@ref.NumTracks];
fixed (void* ptr = &@ref.TrackPropertiesPointer)
Utilities.Read((IntPtr) ptr, this.TrackProperties, 0, @ref.NumTracks);
}
示例14: __MarshalTo
// Method to marshal from managed struct tot native
internal void __MarshalTo(ref __Native @ref)
{
@ref.pcmWaveFormat.waveFormatTag = waveFormatTag;
@ref.pcmWaveFormat.channels = channels;
@ref.pcmWaveFormat.sampleRate = sampleRate;
@ref.pcmWaveFormat.averageBytesPerSecond = averageBytesPerSecond;
@ref.pcmWaveFormat.blockAlign = blockAlign;
@ref.pcmWaveFormat.bitsPerSample = bitsPerSample;
@ref.extraSize = extraSize;
}
示例15: __MarshalTo
// Method to marshal from managed struct tot native
internal unsafe void __MarshalTo(ref __Native @ref)
{
@ref.AttribId = this.AttribId;
@ref.FaceStart = this.FaceStart;
@ref.FaceCount = this.FaceCount;
@ref.VertexStart = this.VertexStart;
@ref.VertexCount = this.VertexCount;
@ref.BonedIdsPointer = IntPtr.Zero;
if (BoneIds != null)
@ref.BonedIdsPointer = Marshal.AllocHGlobal(BoneIds.Length*sizeof (int));
}