本文整理汇总了C#中Internals类的典型用法代码示例。如果您正苦于以下问题:C# Internals类的具体用法?C# Internals怎么用?C# Internals使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Internals类属于命名空间,在下文中一共展示了Internals类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ObjectHolder
internal ObjectHolder(Internals.Context context, Type type, object key) {
this.context = context;
this.type = type;
this.selectSP = null;
// DBNull Bug-Fix by Gerrod Thomas (http://www.Gerrod.com)
this.key = (key is System.DBNull ? null : key);
}
开发者ID:cnporras,项目名称:wilsonormapper,代码行数:7,代码来源:ObjectHolder.cs
示例2: InstallRunGNatives
public static void InstallRunGNatives(this Lua env)
{
env["_VERSION"] = "G#.NET v" + RunGInfo.VERSION;
env["natives"] = new Internals();
env.InstallFunction("read");
env.InstallFunction("clear");
env.InstallFunction("pause");
env.InstallFunction("print", "...");
env.InstallFunction("write", "...");
env.InstallFunction("log", "...");
env.InstallFunction("sleep", "time");
env.InstallFunction("beep", "freq, dur");
env.DoString(
@"function try(func,catch)
local r = {pcall(func)}
if not r[1] then catch(unpack(r)) end
end
function switch(t)
t.case = function (self,x)
local f=self[x] or self.default
if f then
if type(f)==""function"" then
f(x,self)
else
error(""case ""..tostring(x).."" not a function"")
end
end
end
return t
end"
);
}
开发者ID:GSharpDevs,项目名称:RunG,代码行数:33,代码来源:RunGNatives.cs
示例3: SetUnmanagedStructures
// SetUnmanagedStructures
//
// Fills in overlapped Structures used in an async overlapped Winsock call.
// These calls are outside the runtime and are unmanaged code, so we need
// to prepare specific structures and ints that lie in unmanaged memory
// since the overlapped calls may complete asynchronously.
internal void SetUnmanagedStructures(byte[] buffer, int offset, int size, Internals.SocketAddress socketAddress, SocketFlags socketFlags)
{
_messageBuffer = new byte[s_wsaMsgSize];
_wsaBufferArray = new byte[s_wsaBufferSize];
bool ipv4, ipv6;
Socket.GetIPProtocolInformation(((Socket)AsyncObject).AddressFamily, socketAddress, out ipv4, out ipv6);
// Prepare control buffer.
if (ipv4)
{
_controlBuffer = new byte[s_controlDataSize];
}
else if (ipv6)
{
_controlBuffer = new byte[s_controlDataIPv6Size];
}
// Pin buffers.
object[] objectsToPin = new object[(_controlBuffer != null) ? 5 : 4];
objectsToPin[0] = buffer;
objectsToPin[1] = _messageBuffer;
objectsToPin[2] = _wsaBufferArray;
// Prepare socketaddress buffer.
_socketAddress = socketAddress;
_socketAddress.CopyAddressSizeIntoBuffer();
objectsToPin[3] = _socketAddress.Buffer;
if (_controlBuffer != null)
{
objectsToPin[4] = _controlBuffer;
}
base.SetUnmanagedStructures(objectsToPin);
// Prepare data buffer.
_wsaBuffer = (WSABuffer*)Marshal.UnsafeAddrOfPinnedArrayElement(_wsaBufferArray, 0);
_wsaBuffer->Length = size;
_wsaBuffer->Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, offset);
// Setup structure.
_message = (Interop.Winsock.WSAMsg*)Marshal.UnsafeAddrOfPinnedArrayElement(_messageBuffer, 0);
_message->socketAddress = Marshal.UnsafeAddrOfPinnedArrayElement(_socketAddress.Buffer, 0);
_message->addressLength = (uint)_socketAddress.Size;
_message->buffers = Marshal.UnsafeAddrOfPinnedArrayElement(_wsaBufferArray, 0);
_message->count = 1;
if (_controlBuffer != null)
{
_message->controlBuffer.Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(_controlBuffer, 0);
_message->controlBuffer.Length = _controlBuffer.Length;
}
_message->flags = socketFlags;
}
开发者ID:noahfalk,项目名称:corefx,代码行数:63,代码来源:ReceiveMessageOverlappedAsyncResult.Windows.cs
示例4: Load
// ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
private void Load(BfresLoaderContext context)
{
Internal = new Internals();
Internal.Unknown0x00 = context.Reader.ReadByte();
if (Internal.Unknown0x00 != 2)
{
context.Warnings.Add("FmatAttribute.Unknown0x00 has unexpected value of " + Internal.Unknown0x00);
}
Internal.Unknown0x01 = context.Reader.ReadByte();
if (Internal.Unknown0x01 != 0x00 && Internal.Unknown0x01 != 0x02 && Internal.Unknown0x01 != 0x04
&& Internal.Unknown0x01 != 0x12)
{
context.Warnings.Add("FmatAttribute.Unknown0x01 has unexpected value of " + Internal.Unknown0x01);
}
Internal.Unknown0x02 = context.Reader.ReadByte();
if (Internal.Unknown0x02 != 0x00 && Internal.Unknown0x02 != 0x10 && Internal.Unknown0x02 != 0x12
&& Internal.Unknown0x02 != 0x5A)
{
context.Warnings.Add("FmatAttribute.Unknown0x02 has unexpected value of " + Internal.Unknown0x02);
}
Internal.Unknown0x03 = context.Reader.ReadByte();
Internal.Unknown0x04 = context.Reader.ReadSByte();
Internal.Unknown0x05 = context.Reader.ReadByte();
Internal.Unknown0x06 = context.Reader.ReadUInt16();
Internal.Unknown0x08 = context.Reader.ReadUInt32();
if (Internal.Unknown0x08 != 0x80000000)
{
context.Warnings.Add("FmatAttribute.Unknown0x08 has unexpected value of " + Internal.Unknown0x08);
}
Internal.Unknown0x0C = context.Reader.ReadUInt32();
if (Internal.Unknown0x0C != 0)
{
context.Warnings.Add("FmatAttribute.Unknown0x0C has unexpected value of " + Internal.Unknown0x0C);
}
Internal.NameOffset = context.Reader.ReadBfresNameOffset();
Name = Internal.NameOffset.Name;
Internal.Index = context.Reader.ReadByte();
Internal.Unknown0x15 = context.Reader.ReadByte();
if (Internal.Unknown0x15 != 0)
{
context.Warnings.Add("FmatAttribute.Unknown0x15 has unexpected value of " + Internal.Unknown0x15);
}
Internal.Unknown0x16 = context.Reader.ReadUInt16();
if (Internal.Unknown0x16 != 0)
{
context.Warnings.Add("FmatAttribute.Unknown0x16 has unexpected value of " + Internal.Unknown0x16);
}
}
开发者ID:Syroot,项目名称:NintenTools,代码行数:58,代码来源:FmatTextureAttributeSelector.cs
示例5: GetNetSocketAddress
private static System.Net.SocketAddress GetNetSocketAddress(Internals.SocketAddress address)
{
var result = new System.Net.SocketAddress(address.Family, address.Size);
for (int index = 0; index < address.Size; index++)
{
result[index] = address[index];
}
return result;
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:10,代码来源:IPEndPointExtensions.cs
示例6: Load
// ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
private void Load(BfresLoaderContext context)
{
Internal = new Internals();
Internal.NameOffset = context.Reader.ReadBfresNameOffset();
Name = Internal.NameOffset.Name;
Internal.Unknown0x04 = context.Reader.ReadUInt16();
Internal.Unknown0x06 = context.Reader.ReadUInt16();
Value = context.Reader.ReadSingle();
}
开发者ID:Syroot,项目名称:NintenTools,代码行数:11,代码来源:FmdlParameter.cs
示例7: Load
// ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
private void Load(BfresLoaderContext context)
{
Internal = new Internals();
Internal.NameOffset = context.Reader.ReadBfresNameOffset();
Name = Internal.NameOffset.Name;
Internal.TextureOffset = context.Reader.ReadBfresOffset();
// Referenced texture is linked after loading and mapping the raw data.
}
开发者ID:Syroot,项目名称:NintenTools,代码行数:11,代码来源:FmatTextureSelector.cs
示例8: ObjectReader
// Jeff Lanning ([email protected]): Added for OPath support.
internal ObjectReader(Internals.Context context, CompiledQuery query, bool firstLevel, object[] parameters) {
this.context = context;
this.firstLevel = firstLevel;
this.objectType = query.ObjectType;
this.pageIndex = 1;
this.hasEvents = context.Mappings[this.objectType].HasEvents;
this.data = context.Connection.GetDataReader(this.objectType, CommandInfo.Select, query, parameters);
this.firstRead = true;
if (this.data != null) this.hasObjects = this.data.Read();
if (!this.hasObjects) this.Close();
}
开发者ID:cnporras,项目名称:wilsonormapper,代码行数:14,代码来源:ObjectReader.cs
示例9: Create
public static EndPoint Create(this EndPoint thisObj, Internals.SocketAddress socketAddress)
{
if (socketAddress.Family != thisObj.AddressFamily)
{
throw new ArgumentException(SR.Format(SR.net_InvalidAddressFamily, socketAddress.Family.ToString(), thisObj.GetType().FullName, thisObj.AddressFamily.ToString()), "socketAddress");
}
if (socketAddress.Size < 8)
{
throw new ArgumentException(SR.Format(SR.net_InvalidSocketAddressSize, socketAddress.GetType().FullName, thisObj.GetType().FullName), "socketAddress");
}
return socketAddress.GetIPEndPoint();
}
开发者ID:natemcmaster,项目名称:corefx,代码行数:13,代码来源:IPEndPointExtensions.cs
示例10: DefaultServerPagerProcessor
public DefaultServerPagerProcessor(
TagHelperContext context,
TagHelperOutput output,
PagerTagHelper tag,
Internals.PagerOptions options,
ContextualizedHelpers helpers
)
{
this.context = context;
this.output = output;
this.tag = tag;
this.options = options;
this.helpers = helpers;
}
开发者ID:MvcControlsToolkit,项目名称:MvcControlsToolkit.ControlsCore,代码行数:14,代码来源:DefaultServerPagerProcessor.cs
示例11: Load
// ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
private void Load(BfresLoaderContext context)
{
Internal = new Internals();
// Read magic bytes.
if (context.Reader.ReadString(4) != "FSKL")
{
throw new BfresException("FsklSkeleton identifier invalid");
}
Internal.Unknown0x04 = context.Reader.ReadUInt16();
if (Internal.Unknown0x04 != 0)
{
context.Warnings.Add("FsklSkeleton.Unknown0x04 has unexpected value of " + Internal.Unknown0x04);
}
Internal.Unknown0x06 = context.Reader.ReadUInt16();
if (Internal.Unknown0x06 != 0x1100 && Internal.Unknown0x06 != 0x1200)
{
context.Warnings.Add("FsklSkeleton.Unknown0x06 has unexpected value of " + Internal.Unknown0x06);
}
Internal.BoneCount = context.Reader.ReadUInt16();
Internal.InverseIndexCount = context.Reader.ReadUInt16();
Internal.ExtraIndexCount = context.Reader.ReadUInt16();
Internal.Unknown0x0E = context.Reader.ReadUInt16();
if (Internal.Unknown0x0E != 0)
{
context.Warnings.Add("FsklSkeleton.Unknown0x0E has unexpected value of " + Internal.Unknown0x0E);
}
Internal.BoneIndexGroupOffset = context.Reader.ReadBfresOffset();
Internal.BoneArrayOffset = context.Reader.ReadBfresOffset();
Internal.InverseIndexArrayOffset = context.Reader.ReadBfresOffset();
Internal.InverseMatrixArrayOffset = context.Reader.ReadBfresOffset();
if (context.Reader.ReadUInt32() != 0)
{
context.Warnings.Add("FsklSkeleton padding not empty");
}
// Restore the position after the header, to allow consecutive header reads for the parent.
using (context.Reader.TemporarySeek())
{
LoadBones(context);
}
}
开发者ID:Syroot,项目名称:NintenTools,代码行数:48,代码来源:FsklSkeleton.cs
示例12: Load
// ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
private void Load(BfresLoaderContext context)
{
Internal = new Internals();
Internal.Unknown0x00 = context.Reader.ReadUInt32();
Internal.Size = context.Reader.ReadUInt32();
Internal.Unknown0x08 = context.Reader.ReadUInt32();
Internal.Unknown0x0C = context.Reader.ReadUInt16();
Internal.Unknown0x0E = context.Reader.ReadUInt16();
Internal.Unknown0x10 = context.Reader.ReadUInt32();
Internal.DataOffset = context.Reader.ReadBfresOffset();
// Restore the position after the header, to allow consecutive header reads for the parent.
using (context.Reader.TemporarySeek())
{
LoadData(context);
}
}
开发者ID:Syroot,项目名称:NintenTools,代码行数:19,代码来源:FshpIndexBuffer.cs
示例13: Create
public static EndPoint Create(this EndPoint thisObj, Internals.SocketAddress socketAddress)
{
AddressFamily family = socketAddress.Family;
if (family != thisObj.AddressFamily)
{
throw new ArgumentException(SR.Format(SR.net_InvalidAddressFamily, family.ToString(), thisObj.GetType().FullName, thisObj.AddressFamily.ToString()), nameof(socketAddress));
}
if (family == AddressFamily.InterNetwork || family == AddressFamily.InterNetworkV6)
{
if (socketAddress.Size < 8)
{
throw new ArgumentException(SR.Format(SR.net_InvalidSocketAddressSize, socketAddress.GetType().FullName, thisObj.GetType().FullName), nameof(socketAddress));
}
return socketAddress.GetIPEndPoint();
}
System.Net.SocketAddress address = GetNetSocketAddress(socketAddress);
return thisObj.Create(address);
}
开发者ID:ESgarbi,项目名称:corefx,代码行数:21,代码来源:IPEndPointExtensions.cs
示例14: Load
// ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
private void Load(BfresLoaderContext context)
{
Internal = new Internals();
// Read magic bytes.
if (context.Reader.ReadString(4) != "FVTX")
{
throw new BfresException("FvtxVertexData identifier invalid");
}
Internal.AttributeCount = context.Reader.ReadByte();
Internal.BufferCount = context.Reader.ReadByte();
Internal.Index = context.Reader.ReadUInt16();
Internal.NumberOfElements = context.Reader.ReadUInt32();
Internal.Unknown0x0C = context.Reader.ReadUInt32();
if (Internal.Unknown0x0C != 0x00000000 && Internal.Unknown0x0C != 0x01000000
&& Internal.Unknown0x0C != 0x02000000 && Internal.Unknown0x0C != 0x03000000
&& Internal.Unknown0x0C != 0x04000000)
{
context.Warnings.Add("FvtxVertexData.Unknown0x0C has unexpected value of " + Internal.Unknown0x0C);
}
Internal.AttributeArrayOffset = context.Reader.ReadBfresOffset();
Internal.AttributeIndexGroupOffset = context.Reader.ReadBfresOffset();
Internal.BufferArrayOffset = context.Reader.ReadBfresOffset();
if (context.Reader.ReadUInt32() != 0)
{
context.Warnings.Add("FvtxVertexData padding not empty");
}
// Restore the position after the header, to allow consecutive header reads for the parent.
using (context.Reader.TemporarySeek())
{
LoadData(context);
LoadAttributes(context);
}
}
开发者ID:Syroot,项目名称:NintenTools,代码行数:40,代码来源:FvtxVertexBuffer.cs
示例15: SetUnmanagedStructures
// SetUnmanagedStructures
//
// Fills in overlapped structures used in an async overlapped Winsock call.
// These calls are outside the runtime and are unmanaged code, so we need
// to prepare specific structures and ints that lie in unmanaged memory
// since the overlapped calls may complete asynchronously.
internal void SetUnmanagedStructures(byte[] buffer, int offset, int size, Internals.SocketAddress socketAddress, bool pinSocketAddress)
{
// Fill in Buffer Array structure that will be used for our send/recv Buffer
_socketAddress = socketAddress;
if (pinSocketAddress && _socketAddress != null)
{
object[] objectsToPin = null;
objectsToPin = new object[2];
objectsToPin[0] = buffer;
_socketAddress.CopyAddressSizeIntoBuffer();
objectsToPin[1] = _socketAddress.Buffer;
base.SetUnmanagedStructures(objectsToPin);
}
else
{
base.SetUnmanagedStructures(buffer);
}
_singleBuffer.Length = size;
_singleBuffer.Pointer = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, offset);
}
开发者ID:neris,项目名称:corefx,代码行数:29,代码来源:OverlappedAsyncResult.Windows.cs
示例16: Load
// ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
private void Load(BfresLoaderContext context)
{
Internal = new Internals();
Internal.NameOffset = context.Reader.ReadBfresNameOffset();
Name = Internal.NameOffset.Name;
Internal.Unknown0x04 = context.Reader.ReadUInt16();
if (Internal.Unknown0x04 != 1)
{
context.Warnings.Add("FmatMaterial.Unknown0x04 has unexpected value of " + Internal.Unknown0x04);
}
Internal.Unknown0x06 = context.Reader.ReadByte();
Internal.Unknown0x07 = context.Reader.ReadByte();
if (Internal.Unknown0x07 != 0)
{
context.Warnings.Add("FmatMaterial.Unknown0x07 has unexpected value of " + Internal.Unknown0x07);
}
Value = context.Reader.ReadUInt32();
}
开发者ID:Syroot,项目名称:NintenTools,代码行数:24,代码来源:FmatShadowParameter.cs
示例17: Load
// ---- METHODS (PRIVATE) --------------------------------------------------------------------------------------
private void Load(BfresLoaderContext context)
{
Internal = new Internals();
Internal.Unknown0x00 = context.Reader.ReadUInt32();
if (Internal.Unknown0x00 != 4)
{
context.Warnings.Add("FshpLodModel.Unknown0x00 has unexpected value of " + Internal.Unknown0x00);
}
Internal.Unknown0x04 = context.Reader.ReadUInt32();
if (Internal.Unknown0x04 != 4)
{
context.Warnings.Add("FshpLodModel.Unknown0x04 has unexpected value of " + Internal.Unknown0x04);
}
TotalPointCount = context.Reader.ReadUInt32();
Internal.VisibilityGroupCount = context.Reader.ReadUInt16();
Internal.Unknown0x0E = context.Reader.ReadUInt16();
if (Internal.Unknown0x0E != 0)
{
context.Warnings.Add("FshpLodModel.Unknown0x0E has unexpected value of " + Internal.Unknown0x0E);
}
Internal.VisibilityGroupOffset = context.Reader.ReadBfresOffset();
Internal.IndexBufferOffset = context.Reader.ReadBfresOffset();
SkipElements = context.Reader.ReadUInt32();
// Restore the position after the header, to allow consecutive header reads for the parent.
using (context.Reader.TemporarySeek())
{
LoadVisibilityGroup(context);
LoadIndexBuffer(context);
}
}
开发者ID:Syroot,项目名称:NintenTools,代码行数:37,代码来源:FshpLodModel.cs
示例18: DoBind
private void DoBind(EndPoint endPointSnapshot, Internals.SocketAddress socketAddress)
{
// Mitigation for Blue Screen of Death (Win7, maybe others).
IPEndPoint ipEndPoint = endPointSnapshot as IPEndPoint;
if (!OSSupportsIPv4 && ipEndPoint != null && ipEndPoint.Address.IsIPv4MappedToIPv6)
{
SocketException socketException = new SocketException((int)SocketError.InvalidArgument);
UpdateStatusAfterSocketError(socketException);
if (s_loggingEnabled)
{
Logging.Exception(Logging.Sockets, this, "DoBind", socketException);
}
throw socketException;
}
// This may throw ObjectDisposedException.
SocketError errorCode = SocketPal.Bind(
_handle,
socketAddress.Buffer,
socketAddress.Size);
#if TRACE_VERBOSE
try
{
GlobalLog.Print("Socket#" + Logging.HashString(this) + "::Bind() SRC:" + Logging.ObjectToString(LocalEndPoint) + " Interop.Winsock.bind returns errorCode:" + errorCode);
}
catch (ObjectDisposedException) { }
#endif
// Throw an appropriate SocketException if the native call fails.
if (errorCode != SocketError.Success)
{
// Update the internal state of this socket according to the error before throwing.
SocketException socketException = new SocketException((int)errorCode);
UpdateStatusAfterSocketError(socketException);
if (s_loggingEnabled)
{
Logging.Exception(Logging.Sockets, this, "DoBind", socketException);
}
throw socketException;
}
if (_rightEndPoint == null)
{
// Save a copy of the EndPoint so we can use it for Create().
_rightEndPoint = endPointSnapshot;
}
}
开发者ID:ReedKimble,项目名称:corefx,代码行数:48,代码来源:Socket.cs
示例19: DoConnect
private void DoConnect(EndPoint endPointSnapshot, Internals.SocketAddress socketAddress)
{
if (s_loggingEnabled)
{
Logging.Enter(Logging.Sockets, this, "Connect", endPointSnapshot);
}
// This can throw ObjectDisposedException.
SocketError errorCode = SocketPal.Connect(_handle, socketAddress.Buffer, socketAddress.Size);
#if TRACE_VERBOSE
try
{
GlobalLog.Print("Socket#" + Logging.HashString(this) + "::InternalConnect() SRC:" + Logging.ObjectToString(LocalEndPoint) + " DST:" + Logging.ObjectToString(RemoteEndPoint) + " Interop.Winsock.WSAConnect returns errorCode:" + errorCode);
}
catch (ObjectDisposedException) { }
#endif
// Throw an appropriate SocketException if the native call fails.
if (errorCode != SocketError.Success)
{
// Update the internal state of this socket according to the error before throwing.
SocketException socketException = SocketExceptionFactory.CreateSocketException((int)errorCode, endPointSnapshot);
UpdateStatusAfterSocketError(socketException);
if (s_loggingEnabled)
{
Logging.Exception(Logging.Sockets, this, "Connect", socketException);
}
throw socketException;
}
if (_rightEndPoint == null)
{
// Save a copy of the EndPoint so we can use it for Create().
_rightEndPoint = endPointSnapshot;
}
GlobalLog.Print("Socket#" + Logging.HashString(this) + "::DoConnect() connection to:" + endPointSnapshot.ToString());
// Update state and performance counters.
SetToConnected();
if (s_loggingEnabled)
{
Logging.PrintInfo(Logging.Sockets, this, SR.Format(SR.net_log_socket_connected, LocalEndPoint, RemoteEndPoint));
Logging.Exit(Logging.Sockets, this, "Connect", "");
}
}
开发者ID:ReedKimble,项目名称:corefx,代码行数:46,代码来源:Socket.cs
示例20: GetIPProtocolInformation
internal static void GetIPProtocolInformation(AddressFamily addressFamily, Internals.SocketAddress socketAddress, out bool isIPv4, out bool isIPv6)
{
bool isIPv4MappedToIPv6 = socketAddress.Family == AddressFamily.InterNetworkV6 && socketAddress.GetIPAddress().IsIPv4MappedToIPv6;
isIPv4 = addressFamily == AddressFamily.InterNetwork || isIPv4MappedToIPv6; // DualMode
isIPv6 = addressFamily == AddressFamily.InterNetworkV6;
}
开发者ID:ReedKimble,项目名称:corefx,代码行数:6,代码来源:Socket.cs
注:本文中的Internals类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论