本文整理汇总了C#中RegistryContext类的典型用法代码示例。如果您正苦于以下问题:C# RegistryContext类的具体用法?C# RegistryContext怎么用?C# RegistryContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RegistryContext类属于命名空间,在下文中一共展示了RegistryContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetOverridableName
/// <summary>
/// Reduce a <see cref="Command"/> name, removing type suffixes.
/// </summary>
/// <param name="ctx">
/// A <see cref="RegistryContext"/> defining OpenGL specification information.
/// </param>
/// <param name="specificationName">
/// A <see cref="String"/> that specifies the command name.
/// </param>
/// <returns>
/// It returns a <see cref="String"/> that is the reduced name (suitable for overriding commands) of
/// <paramref name="specificationName"/>.
/// </returns>
public string GetOverridableName(RegistryContext ctx, string specificationName)
{
if (String.IsNullOrEmpty(specificationName))
throw new ArgumentNullException("specificationName");
// Extract extension
string nameExtension = null;
foreach (string word in ctx.ExtensionsDictionary.Words) {
if (specificationName.EndsWith(word)) {
nameExtension = word;
break;
}
}
if (nameExtension != null)
specificationName = specificationName.Substring(0, specificationName.Length - nameExtension.Length);
string postfix = specificationName;
foreach (string word in Words) {
postfix = postfix.Replace(word, String.Empty);
if (postfix.Length == 0)
break;
}
if ((postfix.Length > 0) && specificationName.EndsWith(postfix) && (ctx.ExtensionsDictionary.HasWord(postfix) == false))
specificationName = specificationName.Substring(0, specificationName.Length - postfix.Length);
if (nameExtension != null)
specificationName += nameExtension;
return (specificationName);
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:48,代码来源:SpecWordsDictionary.cs
示例2: WriteDelegateParam
public override void WriteDelegateParam(SourceStreamWriter sw, RegistryContext ctx, Command parentCommand)
{
if (mIsStrong) {
// Strongly typed enum must be casted to delegate call type (int or uint)
sw.Write("({0}){1}", OverridenParameter.ImportType, DelegateCallVarName);
} else
base.WriteDelegateParam(sw, ctx, parentCommand);
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:8,代码来源:CommandParameterStrong.cs
示例3: CommandParameterArrayLength
/// <summary>
/// Construct a CommandParameterArray from the original parameter.
/// </summary>
/// <param name="otherParam"></param>
/// <param name="ctx"></param>
/// <param name="parentCommand"></param>
public CommandParameterArrayLength(CommandParameter otherParam, RegistryContext ctx, Command parentCommand)
: base(otherParam, ctx, parentCommand)
{
if (otherParam == null)
throw new ArgumentNullException("otherParam");
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:14,代码来源:CommandParameterArray.cs
示例4: CommandParameterUnsafe
/// <summary>
/// Construct a CommandParameterUnsafe from the original parameter.
/// </summary>
/// <param name="otherParam"></param>
/// <param name="ctx"></param>
/// <param name="parentCommand"></param>
public CommandParameterUnsafe(CommandParameter otherParam, RegistryContext ctx, Command parentCommand)
: base(otherParam)
{
if (otherParam == null)
throw new ArgumentNullException("otherParam");
if (IsCompatible(ctx, parentCommand, otherParam)) {
_IsPointer = true;
}
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:16,代码来源:CommandParameterUnsafe.cs
示例5: CommandParameterStrong
/// <summary>
/// Construct a CommandParameterStrong from the original parameter.
/// </summary>
/// <param name="otherParam"></param>
/// <param name="ctx"></param>
/// <param name="parentCommand"></param>
public CommandParameterStrong(CommandParameter otherParam, RegistryContext ctx, Command parentCommand)
: base(otherParam)
{
if (otherParam == null)
throw new ArgumentNullException("otherParam");
if (IsCompatible(otherParam, ctx, parentCommand)) {
Type = otherParam.Group;
mIsStrong = true;
}
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:17,代码来源:CommandParameterStrong.cs
示例6: GetArrayLengthParameter
internal static CommandParameter GetArrayLengthParameter(CommandParameter param, RegistryContext ctx, Command parentCommand)
{
List<CommandParameter> arrayLengthParams = parentCommand.Parameters.FindAll(delegate(CommandParameter item) {
return (parentCommand.Parameters.FindIndex(delegate(CommandParameter subitem) { return (item.Length == param.Name); }) >= 0);
});
if (arrayLengthParams.Count > 0)
return (arrayLengthParams[0]);
else
return (null);
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:11,代码来源:CommandParameterArray.cs
示例7: IsCompatible
internal static new bool IsCompatible(RegistryContext ctx, Command parentCommand, CommandParameter param)
{
if (!param.IsManagedArray || param.Length == null)
return (false);
int sizeParamIndex = parentCommand.Parameters.FindIndex(delegate (CommandParameter item) { return (item.Name == param.Length); });
if (sizeParamIndex < 0)
return (false);
return (true);
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:12,代码来源:CommandParameterArray.cs
示例8: Link
public void Link(RegistryContext ctx)
{
foreach (Command command in Commands)
command.Link(ctx);
// Remove enumerants not required by anyone
Commands.RemoveAll(delegate(Command item) {
if (item.RequiredBy.Count == 0)
return (true);
return (false);
});
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:12,代码来源:CommandBlock.cs
示例9: IsCompatible
internal static bool IsCompatible(CommandParameter param, RegistryContext ctx, Command parentCommand)
{
// 'bool' parameters are in Boolean group: conditions below will pass
if (param.GetImplementationType(ctx, parentCommand) == "bool")
return (false);
// Unsafe parameters are not allowed, Group is a requirement
if (!param.IsSafe || param.Group == null)
return (false);
// Check actual existence of strongly typed enum
return (ctx.Registry.Groups.FindIndex(delegate(EnumerantGroup item) { return (item.Name == param.Group); }) >= 0);
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:13,代码来源:CommandParameterStrong.cs
示例10: CommandParameterOut
/// <summary>
/// Construct a CommandParameterOut from the original parameter.
/// </summary>
/// <param name="otherParam"></param>
/// <param name="ctx"></param>
/// <param name="parentCommand"></param>
public CommandParameterOut(CommandParameter otherParam, RegistryContext ctx, Command parentCommand, bool strong)
: base(otherParam)
{
if (otherParam == null)
throw new ArgumentNullException("otherParam");
if (IsCompatible(ctx, parentCommand, otherParam))
Length = "1";
else if (strong && CommandParameterStrong.IsCompatible(ctx, parentCommand, otherParam)) {
Type = otherParam.Group;
mIsStrong = true;
}
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:19,代码来源:CommandParameterOut.cs
示例11: CommandParameterPinned
/// <summary>
/// Construct a CommandParameterPinned from the original parameter.
/// </summary>
/// <param name="otherParam"></param>
/// <param name="ctx"></param>
/// <param name="parentCommand"></param>
public CommandParameterPinned(CommandParameter otherParam, RegistryContext ctx, Command parentCommand, bool strong)
: base(otherParam)
{
if (otherParam == null)
throw new ArgumentNullException("otherParam");
if (IsCompatible(ctx, parentCommand, otherParam)) {
Type = "Object";
TypeDecorators.Clear();
mIsPinned = true;
} else if (strong && CommandParameterStrong.IsCompatible(ctx, parentCommand, otherParam)) {
Type = otherParam.Group;
}
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:20,代码来源:CommandParameterPinned.cs
示例12: IsCompatible
internal static bool IsCompatible(RegistryContext ctx, Command command, CommandParameter param)
{
// Already "out" param?
if (param.GetImplementationTypeModifier(ctx, command) == "out")
return (false);
string implementationType = param.ManagedImplementationType;
// Type[] + IsGetImplementation -> out Type
// Type[] + OutParam -> out Type
// Type[] + OutParamLast -> out Type
if ((param.IsConstant == false) && implementationType.EndsWith("[]") && (param.Length != "1") && ((command.Flags & (CommandFlags.OutParam | CommandFlags.OutParamLast)) != 0))
return (true);
return (false);
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:16,代码来源:CommandParameterOut.cs
示例13: IsCompatible
internal static bool IsCompatible(RegistryContext ctx, Command command, CommandParameter param)
{
switch (ctx.Class.ToLower()) {
case "gl":
break;
default:
return (false);
}
if (param.GetImplementationType(ctx, command) != "IntPtr")
return (false);
if (Regex.IsMatch(param.Name, "offset"))
return (false);
if (param.IsConstant || command.IsGetImplementation(ctx))
return (true);
return (false);
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:18,代码来源:CommandParameterPinned.cs
示例14: GetDelegateTypeModifier
public string GetDelegateTypeModifier(RegistryContext ctx, Command parentCommand)
{
return (null);
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:4,代码来源:CommandParameter.cs
示例15: WriteUnpinCommand
public override void WriteUnpinCommand(SourceStreamWriter sw, RegistryContext ctx, Command parentCommand)
{
if (GetImplementationType(ctx, parentCommand) == "Object")
sw.WriteLine("{0}.Free();", PinnedLocalVarName);
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:5,代码来源:CommandParameterPinned.cs
示例16: WritePinnedVariable
public override void WritePinnedVariable(SourceStreamWriter sw, RegistryContext ctx, Command parentCommand)
{
if (GetImplementationType(ctx, parentCommand) == "Object")
sw.WriteLine("GCHandle {0} = GCHandle.Alloc({1}, GCHandleType.Pinned);", PinnedLocalVarName, ImplementationName);
}
开发者ID:rhynodegreat,项目名称:OpenGL.Net,代码行数:5,代码来源:CommandParameterPinned.cs
示例17: WriteUnpinCommand
public virtual void WriteUnpinCommand(SourceStreamWriter sw, RegistryContext ctx, Command parentCommand)
{
// No code for common parameter
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:4,代码来源:CommandParameter.cs
示例18: WritePinnedVariable
public virtual void WritePinnedVariable(SourceStreamWriter sw, RegistryContext ctx, Command parentCommand)
{
// No code for common parameter
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:4,代码来源:CommandParameter.cs
示例19: WriteCallLogArgParam
public virtual void WriteCallLogArgParam(SourceStreamWriter sw, RegistryContext ctx, Command parentCommand)
{
WriteCallLogArgParam(sw, ImplementationName, GetImplementationType(ctx, parentCommand));
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:4,代码来源:CommandParameter.cs
示例20: WriteCallLogFormatParam
public virtual void WriteCallLogFormatParam(SourceStreamWriter sw, RegistryContext ctx, Command parentCommand, int paramIndex)
{
string implementationType = GetImplementationType(ctx, parentCommand);
bool safeImplementationType = !implementationType.EndsWith("*") && implementationType != "IntPtr";
if (safeImplementationType == false)
sw.Write("0x{{{0}}}", paramIndex);
else
sw.Write("{{{0}}}", paramIndex);
}
开发者ID:MagmaiKH,项目名称:OpenGL.Net,代码行数:10,代码来源:CommandParameter.cs
注:本文中的RegistryContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论