本文整理汇总了C#中JET_param类的典型用法代码示例。如果您正苦于以下问题:C# JET_param类的具体用法?C# JET_param怎么用?C# JET_param使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JET_param类属于命名空间,在下文中一共展示了JET_param类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetIntegerParameter
/// <summary>
/// Get a system parameter which is an integer.
/// </summary>
/// <param name="param">The parameter to get.</param>
/// <returns>The value of the parameter.</returns>
private int GetIntegerParameter(JET_param param)
{
int value = 0;
string ignored;
Api.JetGetSystemParameter(this.instance, this.sesid, param, ref value, out ignored, 0);
return value;
}
开发者ID:subTee,项目名称:DSInternals,代码行数:12,代码来源:InstanceParameters.cs
示例2: GetBooleanParameter
/// <summary>
/// Retrieve a boolean parameter.
/// </summary>
/// <param name="param">The parameter to retrieve.</param>
/// <returns>The parameter value.</returns>
private bool GetBooleanParameter(JET_param param)
{
int value = 0;
string ignored;
Api.JetGetSystemParameter(this.instance, JET_SESID.Nil, param, ref value, out ignored, 0);
return 0 != value;
}
开发者ID:925coder,项目名称:ravendb,代码行数:13,代码来源:InstanceParameterTests.cs
示例3: GetBoolParameter
/// <summary>
/// Get a system parameter which is a boolean.
/// </summary>
/// <param name="param">The parameter to get.</param>
/// <returns>The value of the parameter.</returns>
private bool GetBoolParameter(JET_param param)
{
int value = 0;
string ignored;
Api.JetGetSystemParameter(this.instance, this.sesid, param, ref value, out ignored, 0);
return value != 0;
}
开发者ID:subTee,项目名称:DSInternals,代码行数:12,代码来源:InstanceParameters.cs
示例4: SetStringParameter
/// <summary>
/// Set a system parameter which is a string.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private static void SetStringParameter(JET_param param, string value)
{
Api.JetSetSystemParameter(JET_INSTANCE.Nil, JET_SESID.Nil, param, 0, value);
}
开发者ID:nick121212,项目名称:xima_desktop3,代码行数:9,代码来源:SystemParameters.cs
示例5: GetIntPtrParameter
/// <summary>
/// Get a system parameter which is an IntPtr.
/// </summary>
/// <param name="param">The parameter to get.</param>
/// <returns>The value of the parameter.</returns>
private IntPtr GetIntPtrParameter(JET_param param)
{
IntPtr value = IntPtr.Zero;
string ignored;
Api.JetGetSystemParameter(this.instance, this.sesid, param, ref value, out ignored, 0);
return value;
}
开发者ID:nick121212,项目名称:xima_desktop3,代码行数:12,代码来源:Windows8InstanceParameters.cs
示例6: SetIntegerParameter
/// <summary>
/// Set a system parameter which is an integer.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private void SetIntegerParameter(JET_param param, int value)
{
Api.JetSetSystemParameter(this.instance, this.sesid, param, value, null);
}
开发者ID:subTee,项目名称:DSInternals,代码行数:9,代码来源:InstanceParameters.cs
示例7: JetParameter
/// <summary>
/// Initializes a new instance of the JetParameter class.
/// </summary>
/// <param name="param">The parameter identifier.</param>
/// <param name="value">The value of the parameter.</param>
public JetParameter(JET_param param, int value)
{
this.param = param;
this.strValue = null;
this.intValue = value;
}
开发者ID:925coder,项目名称:ravendb,代码行数:11,代码来源:JetParameter.cs
示例8: JetGetSystemParameter
/// <summary>
/// Gets database configuration options.
/// </summary>
/// <param name="instance">The instance to retrieve the options from.</param>
/// <param name="sesid">The session to use.</param>
/// <param name="paramid">The parameter to get.</param>
/// <param name="paramValue">Returns the value of the parameter, if the value is an integer.</param>
/// <param name="paramString">Returns the value of the parameter, if the value is a string.</param>
/// <param name="maxParam">The maximum size of the parameter string.</param>
/// <returns>An ESENT warning code.</returns>
/// <remarks>
/// <see cref="JET_param.ErrorToString"/> passes in the error number in the paramValue, which is why it is
/// a ref parameter and not an out parameter.
/// </remarks>
public static JET_wrn JetGetSystemParameter(JET_INSTANCE instance, JET_SESID sesid, JET_param paramid, ref int paramValue, out string paramString, int maxParam)
{
var intValue = new IntPtr(paramValue);
JET_wrn wrn = Api.Check(Impl.JetGetSystemParameter(instance, sesid, paramid, ref intValue, out paramString, maxParam));
paramValue = intValue.ToInt32();
return wrn;
}
开发者ID:925coder,项目名称:ravendb,代码行数:22,代码来源:Api.cs
示例9: PathParameterTest
/// <summary>
/// Test setting and retrieving a system parameter that uses a path. A relative
/// path is set but a full path is retrieved.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="expected">The path to set it to.</param>
private static void PathParameterTest(JET_param param, string expected)
{
JET_INSTANCE instance;
Api.JetCreateInstance(out instance, "PathParameterTest");
try
{
Api.JetSetSystemParameter(instance, JET_SESID.Nil, param, 0, expected);
int ignored = 0;
string actual;
Api.JetGetSystemParameter(instance, JET_SESID.Nil, param, ref ignored, out actual, 256);
Assert.AreEqual(Path.Combine(Environment.CurrentDirectory, expected), actual);
}
finally
{
Api.JetTerm(instance);
}
}
开发者ID:925coder,项目名称:ravendb,代码行数:25,代码来源:SetGetSystemParameterTests.cs
示例10: SetIntegerParameter
/// <summary>
/// Set a system parameter which is an integer.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private static void SetIntegerParameter(JET_param param, int value)
{
Api.JetSetSystemParameter(JET_INSTANCE.Nil, JET_SESID.Nil, param, value, null);
}
开发者ID:madmonkey,项目名称:managed-esent,代码行数:9,代码来源:SystemParameters.cs
示例11: JetSetSystemParameter
/// <summary>
/// Sets database configuration options.
/// </summary>
/// <param name="instance">
/// The instance to set the option on or <see cref="JET_INSTANCE.Nil"/>
/// to set the option on all instances.
/// </param>
/// <param name="sesid">The session to use.</param>
/// <param name="paramid">The parameter to set.</param>
/// <param name="paramValue">The value of the parameter to set, if the parameter is a JET_CALLBACK.</param>
/// <param name="paramString">The value of the parameter to set, if the parameter is a string type.</param>
/// <returns>An ESENT warning code.</returns>
public static JET_wrn JetSetSystemParameter(JET_INSTANCE instance, JET_SESID sesid, JET_param paramid, JET_CALLBACK paramValue, string paramString)
{
return Api.Check(Impl.JetSetSystemParameter(instance, sesid, paramid, paramValue, paramString));
}
开发者ID:925coder,项目名称:ravendb,代码行数:16,代码来源:Api.cs
示例12: SetBoolParameter
/// <summary>
/// Set a system parameter which is a boolean.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private static void SetBoolParameter(JET_param param, bool value)
{
int setting = value ? 1 : 0;
Api.JetSetSystemParameter(JET_INSTANCE.Nil, JET_SESID.Nil, param, 1, null);
}
开发者ID:madmonkey,项目名称:managed-esent,代码行数:10,代码来源:SystemParameters.cs
示例13: GetIntegerParameter
/// <summary>
/// Get a system parameter which is an integer.
/// </summary>
/// <param name="param">The parameter to get.</param>
/// <returns>The value of the parameter.</returns>
private static int GetIntegerParameter(JET_param param)
{
int value = 0;
string ignored;
Api.JetGetSystemParameter(JET_INSTANCE.Nil, JET_SESID.Nil, param, ref value, out ignored, 0);
return value;
}
开发者ID:madmonkey,项目名称:managed-esent,代码行数:12,代码来源:SystemParameters.cs
示例14: JetGetSystemParameter
/// <summary>
/// Gets database configuration options.
/// </summary>
/// <param name="instance">The instance to retrieve the options from.</param>
/// <param name="sesid">The session to use.</param>
/// <param name="paramid">The parameter to get.</param>
/// <param name="paramValue">Returns the value of the parameter, if the value is an integer.</param>
/// <param name="paramString">Returns the value of the parameter, if the value is a string.</param>
/// <param name="maxParam">The maximum size of the parameter string.</param>
/// <returns>An ESENT warning code.</returns>
/// <remarks>
/// <see cref="JET_param.ErrorToString"/> passes in the error number in the paramValue, which is why it is
/// a ref parameter and not an out parameter.
/// </remarks>
public static JET_wrn JetGetSystemParameter(
JET_INSTANCE instance,
JET_SESID sesid,
JET_param paramid,
ref IntPtr paramValue,
out string paramString,
int maxParam)
{
return Api.Check(Impl.JetGetSystemParameter(instance, sesid, paramid, ref paramValue, out paramString, maxParam));
}
开发者ID:nick121212,项目名称:xima_desktop3,代码行数:24,代码来源:Api.cs
示例15: GetStringParameter
/// <summary>
/// Get a system parameter which is a string.
/// </summary>
/// <param name="param">The parameter to get.</param>
/// <returns>The value of the parameter.</returns>
private string GetStringParameter(JET_param param)
{
int ignored = 0;
string value;
Api.JetGetSystemParameter(this.instance, this.sesid, param, ref ignored, out value, 1024);
return value;
}
开发者ID:subTee,项目名称:DSInternals,代码行数:12,代码来源:InstanceParameters.cs
示例16: StringParameterTest
/// <summary>
/// Test setting and retrieving a system parameter that uses a string.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="expected">The string to set it to.</param>
private static void StringParameterTest(JET_param param, string expected)
{
JET_INSTANCE instance;
Api.JetCreateInstance(out instance, "StringParameterTest");
try
{
Api.JetSetSystemParameter(instance, JET_SESID.Nil, param, 0, expected);
int ignored = 0;
string actual;
Api.JetGetSystemParameter(instance, JET_SESID.Nil, param, ref ignored, out actual, 256);
Assert.AreEqual(expected, actual);
}
finally
{
Api.JetTerm(instance);
}
}
开发者ID:925coder,项目名称:ravendb,代码行数:24,代码来源:SetGetSystemParameterTests.cs
示例17: SetBoolParameter
/// <summary>
/// Set a system parameter which is a boolean.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private void SetBoolParameter(JET_param param, bool value)
{
if (value)
{
Api.JetSetSystemParameter(this.instance, this.sesid, param, 1, null);
}
else
{
Api.JetSetSystemParameter(this.instance, this.sesid, param, 0, null);
}
}
开发者ID:subTee,项目名称:DSInternals,代码行数:16,代码来源:InstanceParameters.cs
示例18: IntegerParameterTest
/// <summary>
/// Test setting and retrieving an integer system parameter.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="expected">The string to set it to.</param>
private static void IntegerParameterTest(JET_param param, int expected)
{
JET_INSTANCE instance;
Api.JetCreateInstance(out instance, "IntParameterTest");
try
{
Api.JetSetSystemParameter(instance, JET_SESID.Nil, param, expected, null);
int actual = 0;
string ignored;
Api.JetGetSystemParameter(instance, JET_SESID.Nil, param, ref actual, out ignored, 0);
Assert.AreEqual(expected, actual);
}
finally
{
Api.JetTerm(instance);
}
}
开发者ID:925coder,项目名称:ravendb,代码行数:24,代码来源:SetGetSystemParameterTests.cs
示例19: SetStringParameter
/// <summary>
/// Set a system parameter which is a string.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="value">The value to set.</param>
private void SetStringParameter(JET_param param, string value)
{
Api.JetSetSystemParameter(this.instance, this.sesid, param, 0, value);
}
开发者ID:subTee,项目名称:DSInternals,代码行数:9,代码来源:InstanceParameters.cs
示例20: BooleanParameterTest
/// <summary>
/// Test setting and retrieving an integer system parameter which
/// is treated as a boolean.
/// </summary>
/// <param name="param">The parameter to set.</param>
/// <param name="expected">The string to set it to.</param>
private static void BooleanParameterTest(JET_param param, bool expected)
{
int value = expected ? 1 : 0;
JET_INSTANCE instance;
Api.JetCreateInstance(out instance, "BoolParameterTest");
try
{
Api.JetSetSystemParameter(instance, JET_SESID.Nil, param, value, null);
int actual = 0;
string ignored;
Api.JetGetSystemParameter(instance, JET_SESID.Nil, param, ref actual, out ignored, 0);
if (expected)
{
Assert.AreNotEqual(0, actual);
}
else
{
Assert.AreEqual(0, actual);
}
}
finally
{
Api.JetTerm(instance);
}
}
开发者ID:925coder,项目名称:ravendb,代码行数:34,代码来源:SetGetSystemParameterTests.cs
注:本文中的JET_param类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论