本文整理汇总了C#中Internal类的典型用法代码示例。如果您正苦于以下问题:C# Internal类的具体用法?C# Internal怎么用?C# Internal使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Internal类属于命名空间,在下文中一共展示了Internal类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ReadRDATA
internal override void ReadRDATA(Internal.ByteReader reader)
{
// The format of the data within a DNS TXT record is one or more
// strings, packed together in memory without any intervening gaps
// or padding bytes for word alignment.
//
// The format of each constituent string within the DNS TXT record is
// a single length byte, followed by 0-255 bytes of text data.
// TXT-DATA strings are not guaranteed to consist purely of ASCII printable
// characters though this is usually the case.
List<Datagram> strings = new List<Datagram>();
for (int total = 0; total < Base.RDLENGTH; )
{
byte length = reader.ReadByte();
if (length > 0)
{
if (total + length >= Base.RDLENGTH)
throw new InvalidResponseException(
"Invalid length byte in TXT record: String data would exceed RDLENGTH.");
strings.Add(reader.ReadBytes(length));
}
total += (length + 1);
}
Strings = strings.ToArray();
}
开发者ID:boethin,项目名称:dnstools,代码行数:27,代码来源:TXT.cs
示例2: BuildArrayValue
private Data BuildArrayValue(Internal.ValueNode n)
{
Data data = null;
switch (n.Type)
{
case Internal.ValueNodeType.Statement:
data = new Data();
DataGroup group = BuildGroup(n.Statement);
data.Group = group;
break;
case Internal.ValueNodeType.Integer:
data = new Data();
data.Integer = n.Integer;
break;
case Internal.ValueNodeType.Float:
data = new Data();
data.Float = n.Float;
break;
case Internal.ValueNodeType.Bool:
data = new Data();
data.Bool = n.Boolean;
break;
case Internal.ValueNodeType.String:
data = new Data();
data.String = n.String;
break;
case Internal.ValueNodeType.Array:
data = new Data();
data.Array = BuildArray(n.Array);
break;
}
return data;
}
开发者ID:PearCoding,项目名称:DataLisp-CSharp,代码行数:35,代码来源:DataContainer.cs
示例3: Initialize
/// <summary>
/// Initializes the mechanism.
/// </summary>
/// <param name="connection">The connection.</param>
/// <param name="credentials">The credentials.</param>
/// <returns>The initial step.</returns>
public ISaslStep Initialize(Internal.MongoConnection connection, MongoCredentials credentials)
{
return new ManagedDigestMD5Implementation(
connection.ServerInstance.Address.Host,
credentials.Username,
((PasswordEvidence)credentials.Evidence).Password);
}
开发者ID:petarvucetin,项目名称:mongo-csharp-driver,代码行数:13,代码来源:DigestMD5Mechanism.cs
示例4: MPoolStats
internal MPoolStats(Internal.MempStatStruct stats) {
st = stats.st;
ci = new CacheInfo(st.st_gbytes, st.st_bytes, (int)st.st_max_ncache);
mempfiles = new List<MPoolFileStats>();
foreach (Internal.MPoolFileStatStruct file in stats.files)
mempfiles.Add(new MPoolFileStats(file));
}
开发者ID:rohitlodha,项目名称:DenverDB,代码行数:7,代码来源:MPoolStats.cs
示例5: Parse
public static void Parse(
CharStream stream, string identifier,
Internal.LocaleContext.Builder builder)
{
var startingPos = stream.Position;
try
{
// private identifiers start with an underscore
// and can only be referenced from within an l20n file
bool isPrivate = (identifier.IndexOf('_') == 0);
// an optional index is possible
AST.INode index = null;
Index.PeekAndParse(stream, out index);
// White Space is required
WhiteSpace.Parse(stream, false);
var valuePos = stream.Position;
// Now we need the actual value
var value = Value.Parse(stream);
if ((value as IO.AST.HashValue) == null && index != null)
{
string msg = String.Format(
"an index was given, but a stringValue was given, while a hashValue was expected",
stream.ComputeDetailedPosition(valuePos));
throw new Exceptions.ParseException(msg);
}
// an optional attributes collection is possible
AST.Attributes attributes;
Attributes.PeekAndParse(stream, out attributes);
// White Space is optional
WhiteSpace.Parse(stream, true);
stream.SkipCharacter('>');
var entityAST = new AST.Entity(identifier, isPrivate, index, value, attributes);
try
{
var entity = (Objects.Entity)entityAST.Eval();
builder.AddEntity(identifier, entity);
} catch (Exception e)
{
throw new Exceptions.EvaluateException(
String.Format("couldn't evaluate `{0}`", entityAST.Display()),
e);
}
} catch (Exception e)
{
string msg = String.Format(
"something went wrong parsing an <entity> starting at {0}",
stream.ComputeDetailedPosition(startingPos));
throw new Exceptions.ParseException(msg, e);
}
}
开发者ID:GlenDC,项目名称:L20n.cs,代码行数:60,代码来源:Entity.cs
示例6: Parse
public static void Parse(
CharStream stream,
string identifier, Internal.LocaleContext.Builder builder)
{
var startingPos = stream.Position;
try
{
var macroAST = new AST.Macro(identifier);
stream.SkipCharacter('(');
WhiteSpace.Parse(stream, true);
// variables are optional,
// but we do have them, we need at least one (duh)
if (Expressions.Variable.Peek(stream))
{
macroAST.AddParameter(Macro.ParseVariable(stream));
// more than 1 is possible as well
while (stream.SkipIfPossible(','))
{
WhiteSpace.Parse(stream, true);
macroAST.AddParameter(Macro.ParseVariable(stream));
}
}
stream.SkipCharacter(')');
WhiteSpace.Parse(stream, false);
stream.SkipCharacter('{');
WhiteSpace.Parse(stream, true);
// Parse the Actual Macro Expression
macroAST.SetExpression(Expression.Parse(stream));
WhiteSpace.Parse(stream, true);
stream.SkipCharacter('}');
WhiteSpace.Parse(stream, true);
stream.SkipCharacter('>');
// return the fully parsed macro
try
{
var macro = (Objects.Macro)macroAST.Eval();
builder.AddMacro(identifier, macro);
} catch (Exception e)
{
throw new Exceptions.EvaluateException(
String.Format("couldn't evaluate `{0}`", macroAST.Display()),
e);
}
} catch (Exception e)
{
string msg = String.Format(
"something went wrong parsing a <macro> starting at {0}",
stream.ComputeDetailedPosition(startingPos));
throw new Exceptions.ParseException(msg, e);
}
}
开发者ID:GlenDC,项目名称:L20n.cs,代码行数:60,代码来源:Macro.cs
示例7: BindEnumerableExpression
private static MemberAssignment BindEnumerableExpression(IMappingEngine mappingEngine, PropertyMap propertyMap,
ExpressionRequest request, ExpressionResolutionResult result,
Internal.IDictionary<ExpressionRequest, int> typePairCount)
{
MemberAssignment bindExpression;
Type destinationListType = GetDestinationListTypeFor(propertyMap);
Type sourceListType = null;
// is list
if (result.Type.IsArray)
{
sourceListType = result.Type.GetElementType();
}
else
{
sourceListType = result.Type.GetGenericArguments().First();
}
var listTypePair = new ExpressionRequest(sourceListType, destinationListType, request.IncludedMembers);
var selectExpression = result.ResolutionExpression;
if (sourceListType != destinationListType)
{
var transformedExpression = Extensions.CreateMapExpression(mappingEngine, listTypePair, typePairCount);
selectExpression = Expression.Call(
typeof (Enumerable),
"Select",
new[] {sourceListType, destinationListType},
result.ResolutionExpression,
transformedExpression);
}
if (typeof (IList<>).MakeGenericType(destinationListType)
.IsAssignableFrom(propertyMap.DestinationPropertyType)
||
typeof (ICollection<>).MakeGenericType(destinationListType)
.IsAssignableFrom(propertyMap.DestinationPropertyType))
{
// Call .ToList() on IEnumerable
var toListCallExpression = GetToListCallExpression(propertyMap, destinationListType, selectExpression);
bindExpression = Expression.Bind(propertyMap.DestinationProperty.MemberInfo, toListCallExpression);
}
else if (propertyMap.DestinationPropertyType.IsArray)
{
// Call .ToArray() on IEnumerable
MethodCallExpression toArrayCallExpression = Expression.Call(
typeof (Enumerable),
"ToArray",
new[] {destinationListType},
selectExpression);
bindExpression = Expression.Bind(propertyMap.DestinationProperty.MemberInfo, toArrayCallExpression);
}
else
{
// destination type implements ienumerable, but is not an ilist. allow deferred enumeration
bindExpression = Expression.Bind(propertyMap.DestinationProperty.MemberInfo, selectExpression);
}
return bindExpression;
}
开发者ID:AnatolyKulakov,项目名称:AutoMapper,代码行数:59,代码来源:EnumerableExpressionBinder.cs
示例8: gtk_application_new
public static IntPtr gtk_application_new(string application_id, Internal.GIO.Constants.GApplicationFlags flags)
{
if (LIBRARY_FILENAME == LIBRARY_FILENAME_V2) {
return IntPtr.Zero;
} else {
return gtk_application_new_v3 (application_id, flags);
}
}
开发者ID:alcexhim,项目名称:UniversalWidgetToolkit,代码行数:8,代码来源:Methods.cs
示例9: TransactionStats
internal TransactionStats(Internal.TxnStatStruct stats) {
st = stats.st;
lastCkp = new LSN(st.st_last_ckp.file, st.st_last_ckp.offset);
txns = new List<ActiveTransaction>();
for (int i = 0; i < st.st_nactive; i++)
txns.Add(new ActiveTransaction(
stats.st_txnarray[i], stats.st_txngids[i], stats.st_txnnames[i]));
}
开发者ID:gildafnai82,项目名称:craq,代码行数:8,代码来源:TransactionStats.cs
示例10: Build
internal void Build(Internal.SyntaxTree tree)
{
foreach(Internal.StatementNode n in tree.Nodes)
{
DataGroup group = BuildGroup(n);
_TopGroups.Add(group);
}
}
开发者ID:PearCoding,项目名称:DataLisp-CSharp,代码行数:8,代码来源:DataContainer.cs
示例11: OnGetRootDirectoryFromCommandLineResult
private void OnGetRootDirectoryFromCommandLineResult(Internal.GetRootDirectoryFromCommandLineResult message)
{
var directory = message.RootDirectory;
if (directory != null)
{
SetRootDir(directory);
}
}
开发者ID:eaardal,项目名称:delbert,代码行数:9,代码来源:RootDirectoryActor.cs
示例12: ReplicationStats
internal ReplicationStats(Internal.ReplicationStatStruct stats) {
st = stats;
next = new LSN(st.st_next_lsn.file, st.st_next_lsn.offset);
waiting = new LSN(st.st_waiting_lsn.file, st.st_waiting_lsn.offset);
maxPerm =
new LSN(st.st_max_perm_lsn.file, st.st_max_perm_lsn.offset);
winner = new LSN(st.st_election_lsn.file, st.st_election_lsn.offset);
}
开发者ID:gildafnai82,项目名称:craq,代码行数:9,代码来源:ReplicationStats.cs
示例13: MappingEngine
public MappingEngine(IMapperContext mapperContext,
Internal.IDictionary<TypePair, IObjectMapper> objectMapperCache,
Func<Type, object> serviceCtor)
{
/* Never, ever carry a previously configured engine forward:
that's the whole point of facilitating micro-mapping. */
_mapperContext = mapperContext;
ObjectMapperCache = objectMapperCache;
ServiceCtor = serviceCtor;
_mapperContext.ConfigurationProvider.TypeMapCreated += ClearTypeMap;
}
开发者ID:mwpowellhtx,项目名称:MicroMapper,代码行数:11,代码来源:MappingEngine.cs
示例14: PeekAndParse
public static bool PeekAndParse(
CharStream stream,
string identifier, Internal.LocaleContext.Builder builder)
{
if (stream.PeekNext() != '(')
{
return false;
}
Macro.Parse(stream, identifier, builder);
return true;
}
开发者ID:GlenDC,项目名称:L20n.cs,代码行数:12,代码来源:Macro.cs
示例15: BuildArray
private DataArray BuildArray(Internal.ArrayNode n)
{
DataArray array = new DataArray();
foreach(Internal.ValueNode v in n.Nodes)
{
Data data = BuildArrayValue(v);
if (data != null)
array.Add(data);
}
return array;
}
开发者ID:PearCoding,项目名称:DataLisp-CSharp,代码行数:12,代码来源:DataContainer.cs
示例16: ReadRDATA
internal override void ReadRDATA(Internal.ByteReader reader)
{
if (Base.RDLENGTH != 16)
throw new InvalidResponseException(String.Format(
"Invalid RDLENGTH value {0}: expected 16.",
Base.RDLENGTH));
byte[] buf = reader.ReadBytes(16);
ADDRESS = new IPAddress(buf);
if (ADDRESS.AddressFamily != System.Net.Sockets.AddressFamily.InterNetworkV6)
throw new InvalidResponseException(String.Format(
"Not an IPv6 address: {0}.", ADDRESS.ToString()));
}
开发者ID:boethin,项目名称:dnstools,代码行数:13,代码来源:AAAA.cs
示例17: BindMappedTypeExpression
private static MemberAssignment BindMappedTypeExpression(IMappingEngine mappingEngine, PropertyMap propertyMap,
ExpressionRequest request, ExpressionResolutionResult result, Internal.IDictionary<ExpressionRequest, int> typePairCount)
{
var transformedExpression = ((IMappingEngineRunner)mappingEngine).CreateMapExpression(request, result.ResolutionExpression, typePairCount);
// Handles null source property so it will not create an object with possible non-nullable propeerties
// which would result in an exception.
if (mappingEngine.ConfigurationProvider.MapNullSourceValuesAsNull)
{
var expressionNull = Expression.Constant(null, propertyMap.DestinationPropertyType);
transformedExpression =
Expression.Condition(Expression.NotEqual(result.ResolutionExpression, Expression.Constant(null)),
transformedExpression, expressionNull);
}
return Expression.Bind(propertyMap.DestinationProperty.MemberInfo, transformedExpression);
}
开发者ID:redwyre,项目名称:AutoMapper,代码行数:17,代码来源:MappedTypeExpressionBinder.cs
示例18: GetSignature
public RuntimeMethodSignature GetSignature(Internal.Metadata.NativeFormat.Handle token)
{
switch (token.HandleType)
{
// These are the only valid token types for creating a method signature
case Internal.Metadata.NativeFormat.HandleType.Method:
case Internal.Metadata.NativeFormat.HandleType.MemberReference:
case Internal.Metadata.NativeFormat.HandleType.QualifiedMethod:
case Internal.Metadata.NativeFormat.HandleType.MethodInstantiation:
case Internal.Metadata.NativeFormat.HandleType.MethodSignature:
break;
default:
Environment.FailFast("Unknown and invalid handle type");
break;
}
return RuntimeMethodSignature.CreateFromMethodHandle(_metadataUnit.RuntimeModule, token.ToInt());
}
开发者ID:nattress,项目名称:corert,代码行数:18,代码来源:FixupCellMetadataResolver.cs
示例19: BuildFrom
/// <summary>
/// Construct one or more TestMethods from a given MethodInfo,
/// using available parameter data.
/// </summary>
/// <param name="method">The MethodInfo for which tests are to be constructed.</param>
/// <param name="suite">The suite to which the tests will be added.</param>
/// <returns>One or more TestMethods</returns>
public IEnumerable<TestMethod> BuildFrom(MethodInfo method, Internal.Test suite)
{
ParameterInfo[] parameters = method.GetParameters();
List<TestMethod> tests = new List<TestMethod>();
if (parameters.Length > 0)
{
IEnumerable[] sources = new IEnumerable[parameters.Length];
for (int i = 0; i < parameters.Length; i++)
sources[i] = _dataProvider.GetDataFor(parameters[i]);
foreach (var parms in new CombinatorialStrategy().GetTestCases(sources))
tests.Add(_builder.BuildTestMethod(method, suite, (ParameterSet)parms));
}
return tests;
}
开发者ID:JohanLarsson,项目名称:nunit,代码行数:25,代码来源:TheoryAttribute.cs
示例20: Parse
public static void Parse(CharStream stream, Internal.LocaleContext.Builder builder)
{
var startingPos = stream.Position;
try
{
stream.SkipString("import(");
WhiteSpace.Parse(stream, true);
var path = PureStringValue.Parse(stream);
WhiteSpace.Parse(stream, true);
stream.SkipCharacter(')');
LocalizableObjectsList.ImportAndParse(path, builder);
} catch (Exception e)
{
string msg = String.Format(
"something went wrong parsing an <import_statement> starting at {0}",
stream.ComputeDetailedPosition(startingPos));
throw new Exceptions.ParseException(msg, e);
}
}
开发者ID:GlenDC,项目名称:L20n.cs,代码行数:21,代码来源:ImportStatement.cs
注:本文中的Internal类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论