本文整理汇总了C#中Identifier类的典型用法代码示例。如果您正苦于以下问题:C# Identifier类的具体用法?C# Identifier怎么用?C# Identifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Identifier类属于命名空间,在下文中一共展示了Identifier类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: findAssignment
public HashSet<Assign> findAssignment(Identifier i, HashSet<Statement> visitedNodes)
{
HashSet<Assign> assignStatements = new HashSet<Assign>();
if (this is Assign && ((Assign)this).identifier.declaration == i.declaration)
{
assignStatements.Add((Assign)this);
return assignStatements;
}
else if (this.cfgPredecessors.Count > 0)
{
foreach (Statement predecessor in this.cfgPredecessors)
{
if (!(visitedNodes.Contains(predecessor)))
{
visitedNodes.Add(predecessor);
assignStatements.UnionWith(predecessor.findAssignment(i, visitedNodes));
}
}
return assignStatements;
}
else
{
throw new AccessException(i.row, i.col, "This value has not been initialised.");
}
}
开发者ID:noilly,项目名称:ginger,代码行数:27,代码来源:SLNode.cs
示例2: DocumentedProperty
public DocumentedProperty(Identifier name, XmlNode xml, PropertyInfo property, Type targetType)
{
Property = property;
Xml = xml;
Name = name;
TargetType = targetType;
}
开发者ID:cdrnet,项目名称:docu,代码行数:7,代码来源:DocumentedProperty.cs
示例3: ExceptHandler
public ExceptHandler(Exp type, Identifier name, SuiteStatement body, string filename, int start, int end)
: base(filename, start, end)
{
this.type = type;
this.name = name;
this.body = body;
}
开发者ID:uxmal,项目名称:pytocs,代码行数:7,代码来源:ExceptHandler.cs
示例4: Control
public Control(ISensor sensor, ISettings settings, float minSoftwareValue,
float maxSoftwareValue)
{
this.identifier = new Identifier(sensor.Identifier, "control");
this.settings = settings;
this.minSoftwareValue = minSoftwareValue;
this.maxSoftwareValue = maxSoftwareValue;
if (!float.TryParse(settings.GetValue(
new Identifier(identifier, "value").ToString(), "0"),
NumberStyles.Float, CultureInfo.InvariantCulture,
out this.softwareValue))
{
this.softwareValue = 0;
}
int mode;
if (!int.TryParse(settings.GetValue(
new Identifier(identifier, "mode").ToString(),
((int)ControlMode.Default).ToString(CultureInfo.InvariantCulture)),
NumberStyles.Integer, CultureInfo.InvariantCulture,
out mode))
{
this.mode = ControlMode.Default;
} else {
this.mode = (ControlMode)mode;
}
}
开发者ID:Ryks,项目名称:open-hardware-monitor,代码行数:27,代码来源:Control.cs
示例5: FunctionInvocationExpression
public FunctionInvocationExpression(Identifier identifier, ExpressionNode[] arguments, bool hasStarModifier)
: this()
{
_name = identifier;
_arguments = arguments;
_hasAsteriskModifier = hasStarModifier;
}
开发者ID:chenzuo,项目名称:nquery,代码行数:7,代码来源:FunctionInvocationExpression.cs
示例6: RelshipNavigationExpr
/// <summary>
/// Initializes relationship navigation expression.
/// </summary>
internal RelshipNavigationExpr(Node refExpr, Node relshipTypeName, Identifier toEndIdentifier, Identifier fromEndIdentifier)
{
_refExpr = refExpr;
_relshipTypeName = relshipTypeName;
_toEndIdentifier = toEndIdentifier;
_fromEndIdentifier = fromEndIdentifier;
}
开发者ID:christiandpena,项目名称:entityframework,代码行数:10,代码来源:NavigationExpr.cs
示例7: Hardware
public Hardware(string name, Identifier identifier, ISettings settings) {
this.settings = settings;
this.identifier = identifier;
this.name = name;
this.customName = settings.GetValue(
new Identifier(Identifier, "name").ToString(), name);
}
开发者ID:sakisds,项目名称:Icy-Monitor,代码行数:7,代码来源:Hardware.cs
示例8: Def
private Instruction Def(Identifier id, Expression src)
{
if (IsLocal(id))
return new Store(new MemoryAccess(MemoryIdentifier.GlobalMemory, EffectiveAddress(id), id.DataType), src);
else
return new Assignment(id, src);
}
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:EscapedAccessRewriter.cs
示例9: MethodParameterInfoContext
public MethodParameterInfoContext(SourceLocation sourceLocation, int parameterIndex, Scope scope, Type expressionType, Identifier methodName)
: base(sourceLocation, parameterIndex)
{
_scope = scope;
_expressionType = expressionType;
_methodName = methodName;
}
开发者ID:chenzuo,项目名称:nquery,代码行数:7,代码来源:MethodParameterInfoContext.cs
示例10: PersonA
public PersonA(Identifier<int> id, string name, int age, int version)
{
_id = id;
_name = name;
_age = age;
_version = version;
}
开发者ID:nertsch,项目名称:outlookcaldavsynchronizer,代码行数:7,代码来源:PersonA.cs
示例11: Setup
public void Setup()
{
mr = new MockRepository();
program = new Program();
proc = new Procedure("testProc", new Frame(PrimitiveType.Word32));
block = proc.AddBlock("l00100000");
trace = new RtlTrace(0x00100000);
r0 = new Identifier("r0", PrimitiveType.Word32, new RegisterStorage("r0", 0, 0, PrimitiveType.Word32));
r1 = new Identifier("r1", PrimitiveType.Word32, new RegisterStorage("r1", 1, 0, PrimitiveType.Word32));
r2 = new Identifier("r2", PrimitiveType.Word32, new RegisterStorage("r2", 2, 0, PrimitiveType.Word32));
sp = new Identifier("sp", PrimitiveType.Word32, new RegisterStorage("sp", 15, 0, PrimitiveType.Word32));
grf = proc.Frame.EnsureFlagGroup(Registers.eflags, 3, "SCZ", PrimitiveType.Byte);
var sc = new ServiceContainer();
var listener = mr.Stub<DecompilerEventListener>();
scanner = mr.StrictMock<IScanner>();
arch = mr.Stub<IProcessorArchitecture>();
program.Architecture = arch;
program.SegmentMap = new SegmentMap(
Address.Ptr32(0x00100000),
new ImageSegment(
".text",
new MemoryArea(Address.Ptr32(0x00100000), new byte[0x20000]),
AccessMode.ReadExecute));
arch.Replay();
program.Platform = new DefaultPlatform(null, arch);
arch.BackToRecord();
arch.Stub(s => s.StackRegister).Return((RegisterStorage)sp.Storage);
arch.Stub(s => s.PointerType).Return(PrimitiveType.Pointer32);
scanner.Stub(s => s.Services).Return(sc);
sc.AddService<DecompilerEventListener>(listener);
}
开发者ID:relaxar,项目名称:reko,代码行数:31,代码来源:BlockWorkitemTests.cs
示例12: LabelStatement
public LabelStatement(Identifier Label, Statement Labeled, TextSpan Location, TextPoint Colon)
:base(Operation.Label,Location)
{
this.Label = Label;
this.Labeled = Labeled;
this.Colon = Colon;
}
开发者ID:alesliehughes,项目名称:olive,代码行数:7,代码来源:LabelStatement.cs
示例13: Match
public bool Match(BinaryExpression exp)
{
if (exp.Operator != Operator.IAdd)
return false;
id = exp.Left as Identifier;
bin = exp.Right as BinaryExpression;
if ((id == null || bin == null) && exp.Operator == Operator.IAdd)
{
id = exp.Right as Identifier;
bin = exp.Left as BinaryExpression;
}
if (id == null || bin == null)
return false;
if (bin.Operator != Operator.SMul && bin.Operator != Operator.UMul && bin.Operator != Operator.IMul)
return false;
Identifier idInner = bin.Left as Identifier;
cInner = bin.Right as Constant;
if (idInner == null ||cInner == null)
return false;
if (idInner != id)
return false;
return true;
}
开发者ID:killbug2004,项目名称:reko,代码行数:28,代码来源:Add_mul_id_c_id_Rule.cs
示例14: Eval
/// <summary>
/// Returns the value that matches the hash key given as the first given parameter.
/// </summary>
public override L20nObject Eval(LocaleContext ctx, params L20nObject[] argv)
{
if (m_Items.Count == 0 || argv.Length < 1)
{
return null;
}
var first = argv [0].Eval(ctx);
Identifier id = first as Identifier;
if (id == null)
{
var str = first as StringOutput;
if (str == null)
{
Logger.Warning("Attributes: first variadic argument couldn't be evaluated as an <Identifier>");
return id;
}
id = new Identifier(str.Value);
}
L20nObject obj;
if (!m_Items.TryGetValue(id.Value, out obj))
{
Logger.WarningFormat("{0} is not a valid <identifier>", id.Value);
return null;
}
return obj;
}
开发者ID:GlenDC,项目名称:L20n.cs,代码行数:34,代码来源:Attributes.cs
示例15: CheckName
void CheckName(TypeDeclaration node, AffectedEntity entity, Identifier identifier, Modifiers accessibilty)
{
TypeResolveResult resolveResult = ctx.Resolve(node) as TypeResolveResult;
if (resolveResult == null)
return;
var type = resolveResult.Type;
if (type.DirectBaseTypes.Any(t => t.FullName == "System.Attribute")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomAttributes, identifier, accessibilty)) {
return;
}
} else if (type.DirectBaseTypes.Any(t => t.FullName == "System.EventArgs")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomEventArgs, identifier, accessibilty)) {
return;
}
} else if (type.DirectBaseTypes.Any(t => t.FullName == "System.Exception")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.CustomExceptions, identifier, accessibilty)) {
return;
}
}
var typeDef = type.GetDefinition();
if (typeDef != null && typeDef.Attributes.Any(attr => attr.AttributeType.FullName == "NUnit.Framework.TestFixtureAttribute")) {
if (CheckNamedResolveResult(resolveResult, node, AffectedEntity.TestType, identifier, accessibilty)) {
return;
}
}
CheckNamedResolveResult(resolveResult, node, entity, identifier, accessibilty);
}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:29,代码来源:InconsistentNamingIssue.cs
示例16: New
public static WearingExpression New(string expression)
{
Identifier[] parsed;
string[] parts = expression.Split(':');
if (parts.Length == 1)
{
parsed = new Identifier[] { Identifier.Get(parts[0]) };
}
else if (parts.Length == 2)
{
Identifier first = Identifier.Get(parts[0]);
string[] others;
if (first == Identifier.DualWielding)
{
others = parts[1].Split('-');
}
else
{
others = parts[1].Split(',');
}
parsed = new Identifier[others.Length + 1];
parsed[0] = first;
for (int i = 0; i < others.Length; i++)
{
parsed[i + 1] = Identifier.Get(others[i]);
}
}
else
{
throw new FormatException();
}
return new WearingExpression(parsed);
}
开发者ID:seanohue,项目名称:iggy,代码行数:35,代码来源:WearingExpression.cs
示例17: OutpReplaceManyUses
public void OutpReplaceManyUses()
{
ProcedureBuilder m = new ProcedureBuilder();
Identifier foo = new Identifier("foo", PrimitiveType.Word32, null);
Identifier bar = new Identifier("bar", PrimitiveType.Word32, null);
Identifier pfoo = new Identifier("pfoo", PrimitiveType.Pointer32, null);
Block block = m.Label("block");
m.Assign(foo, 1);
Statement stmFoo = m.Block.Statements.Last;
m.Assign(bar, foo);
Statement stmBar = m.Block.Statements.Last;
SsaIdentifier ssaFoo = new SsaIdentifier(foo, foo, stmFoo, ((Assignment) stmFoo.Instruction).Src, false);
ssaFoo.Uses.Add(stmBar);
SsaIdentifier ssaBar = new SsaIdentifier(bar, bar, stmBar, ((Assignment) stmBar.Instruction).Src, false);
SsaIdentifierCollection ssaIds = new SsaIdentifierCollection();
ssaIds.Add(foo, ssaFoo);
ssaIds.Add(bar, ssaBar);
OutParameterTransformer opt = new OutParameterTransformer(m.Procedure, ssaIds);
opt.ReplaceDefinitionsWithOutParameter(foo, pfoo);
Assert.AreEqual(3, block.Statements.Count);
Assert.AreEqual("foo = 0x00000001", block.Statements[0].Instruction.ToString());
Assert.AreEqual("*pfoo = foo", block.Statements[1].Instruction.ToString());
Assert.AreEqual("bar = foo", block.Statements[2].Instruction.ToString());
}
开发者ID:nemerle,项目名称:reko,代码行数:28,代码来源:OutParameterTransformerTests.cs
示例18: GetXmlName
public static void GetXmlName( Member member, ref Identifier name, ref Identifier ns ) {
AttributeList attrs = MetadataHelper.GetCustomAttributes( member, SystemTypes.XmlElementAttributeClass );
if( attrs != null ) {
for( int i = 0, n = attrs.Count; i < n; i++ ) {
AttributeNode attr = attrs[i];
if( attr == null ) continue;
Literal litName = MetadataHelper.GetNamedAttributeValue(attr, idElementName);
if (litName == null)
litName = MetadataHelper.GetAttributeValue(attr,0);
Literal litNs = MetadataHelper.GetNamedAttributeValue(attr, idNamespace);
name = (litName != null) ? Identifier.For(litName.Value as String) : Identifier.Empty;
ns = (litNs != null) ? Identifier.For(litNs.Value as String) : Identifier.Empty;
return;
}
}
attrs = MetadataHelper.GetCustomAttributes( member, SystemTypes.XmlAttributeAttributeClass );
if( attrs != null ) {
for( int i2 = 0, n2 = attrs.Count; i2 < n2; i2++ ) {
AttributeNode attr = attrs[i2];
if( attr == null ) continue;
Literal litName = MetadataHelper.GetNamedAttributeValue(attr, idElementName);
if (litName == null)
litName = MetadataHelper.GetAttributeValue(attr,0);
Literal litNs = MetadataHelper.GetNamedAttributeValue(attr, idNamespace);
name = (litName != null) ? Identifier.For(litName.Value as String) : Identifier.Empty;
ns = (litNs != null) ? Identifier.For(litNs.Value as String) : null;
return;
}
}
}
开发者ID:tapicer,项目名称:resource-contracts-.net,代码行数:30,代码来源:XmlHelper.cs
示例19: DocumentedField
public DocumentedField(Identifier name, XmlNode xml, FieldInfo field, Type targetType)
{
Field = field;
Xml = xml;
Name = name;
TargetType = targetType;
}
开发者ID:jujis008,项目名称:docu,代码行数:7,代码来源:DocumentedField.cs
示例20: PropertyIdentifier
public PropertyIdentifier(string name, bool hasGet, bool hasSet, TypeIdentifier typeId)
: base(name)
{
this.typeId = typeId;
HasGet = hasGet;
HasSet = hasSet;
}
开发者ID:jcbozonier,项目名称:docu,代码行数:7,代码来源:PropertyIdentifier.cs
注:本文中的Identifier类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论