本文整理汇总了C#中FixedFieldDeclaration类的典型用法代码示例。如果您正苦于以下问题:C# FixedFieldDeclaration类的具体用法?C# FixedFieldDeclaration怎么用?C# FixedFieldDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FixedFieldDeclaration类属于命名空间,在下文中一共展示了FixedFieldDeclaration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleVisitorFixedFieldDeclarationVisited
void HandleVisitorFixedFieldDeclarationVisited (FixedFieldDeclaration node, InspectionData data)
{
foreach (var rule in policy.Rules) {
if (rule.CheckField (node, data))
return;
}
}
示例2: VisitFixedFieldDeclaration
public void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
StartNode(fixedFieldDeclaration);
WriteAttributes(fixedFieldDeclaration.Attributes);
WriteModifiers(fixedFieldDeclaration.ModifierTokens);
WriteKeyword(FixedFieldDeclaration.FixedKeywordRole);
Space();
fixedFieldDeclaration.ReturnType.AcceptVisitor(this);
Space();
WriteCommaSeparatedList(fixedFieldDeclaration.Variables);
Semicolon();
EndNode(fixedFieldDeclaration);
}
示例3: VisitFixedFieldDeclaration
public virtual void VisitFixedFieldDeclaration (FixedFieldDeclaration fixedFieldDeclaration)
{
VisitChildren (fixedFieldDeclaration);
}
示例4: Visit
public override void Visit(FixedField f)
{
var location = LocationsBag.GetMemberLocation(f);
int locationIdx = 0;
var newField = new FixedFieldDeclaration();
AddAttributeSection(newField, f);
AddModifiers(newField, location);
if (location != null && location.Count > 0)
newField.AddChild(new CSharpTokenNode(Convert(location [locationIdx++]), FixedFieldDeclaration.FixedKeywordRole), FixedFieldDeclaration.FixedKeywordRole);
if (f.TypeExpression != null)
newField.AddChild(ConvertToType(f.TypeExpression), Roles.Type);
var variable = new FixedVariableInitializer();
variable.AddChild(Identifier.Create(f.MemberName.Name, Convert(f.MemberName.Location)), Roles.Identifier);
if (f.Initializer != null && !f.Initializer.IsNull) {
variable.AddChild(new CSharpTokenNode(Convert(f.Initializer.Location), Roles.LBracket), Roles.LBracket);
variable.AddChild((Expression)f.Initializer.Accept(this), Roles.Expression);
var bracketLocations = LocationsBag.GetLocations(f.Initializer);
if (bracketLocations != null)
variable.AddChild(new CSharpTokenNode(Convert(bracketLocations [0]), Roles.RBracket), Roles.RBracket);
}
newField.AddChild(variable, FixedFieldDeclaration.VariableRole);
if (f.Declarators != null) {
foreach (var decl in f.Declarators) {
var declLoc = LocationsBag.GetLocations(decl);
if (declLoc != null)
newField.AddChild(new CSharpTokenNode(Convert(declLoc [0]), Roles.Comma), Roles.Comma);
variable = new FixedVariableInitializer();
variable.AddChild(Identifier.Create(decl.Name.Value, Convert(decl.Name.Location)), Roles.Identifier);
variable.AddChild(new CSharpTokenNode(Convert(decl.Initializer.Location), Roles.LBracket), Roles.LBracket);
variable.AddChild((Expression)decl.Initializer.Accept(this), Roles.Expression);
var bracketLocations = LocationsBag.GetLocations(decl.Initializer);
if (bracketLocations != null)
variable.AddChild(new CSharpTokenNode(Convert(bracketLocations [0]), Roles.RBracket), Roles.RBracket);
newField.AddChild(variable, FixedFieldDeclaration.VariableRole);
}
}
if (location != null && location.Count > locationIdx)
newField.AddChild(new CSharpTokenNode(Convert(location [locationIdx]), Roles.Semicolon), Roles.Semicolon);
typeStack.Peek().AddChild(newField, Roles.TypeMemberRole);
}
示例5: VisitFixedFieldDeclaration
public virtual void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
if (this.ThrowException)
{
throw (Exception)this.CreateException(fixedFieldDeclaration);
}
}
示例6: VisitFixedFieldDeclaration
public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
FixAttributesAndDocComment(fixedFieldDeclaration);
FormatCommas(fixedFieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma);
var lastLoc = fixedFieldDeclaration.StartLocation;
curIndent.Push(IndentType.Block);
foreach (var initializer in fixedFieldDeclaration.Variables) {
if (lastLoc.Line != initializer.StartLocation.Line) {
FixStatementIndentation(initializer.StartLocation);
lastLoc = initializer.StartLocation;
}
initializer.AcceptVisitor(this);
}
curIndent.Pop();
FixSemicolon(fixedFieldDeclaration.SemicolonToken);
}
示例7: VisitFixedFieldDeclaration
public StringBuilder VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration, int data)
{
throw new SLSharpException("SL# does not understand the fixed keyword.");
}
示例8: VisitFixedFieldDeclaration
public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
FormatAttributedNode(fixedFieldDeclaration);
FormatCommas(fixedFieldDeclaration, policy.SpaceBeforeFieldDeclarationComma, policy.SpaceAfterFieldDeclarationComma);
if (fixedFieldDeclaration.NextSibling is FieldDeclaration || fixedFieldDeclaration.NextSibling is FixedFieldDeclaration) {
EnsureBlankLinesAfter(fixedFieldDeclaration, policy.BlankLinesBetweenFields);
} else if (IsMember(fixedFieldDeclaration.NextSibling)) {
EnsureBlankLinesAfter(fixedFieldDeclaration, policy.BlankLinesBetweenMembers);
}
var lastLoc = fixedFieldDeclaration.StartLocation;
curIndent.Push(IndentType.Block);
foreach (var initializer in fixedFieldDeclaration.Variables) {
if (lastLoc.Line != initializer.StartLocation.Line) {
FixStatementIndentation(initializer.StartLocation);
lastLoc = initializer.StartLocation;
}
initializer.AcceptVisitor(this);
}
curIndent.Pop ();
}
示例9: Visit
public override void Visit (FixedField f)
{
var location = LocationsBag.GetMemberLocation (f);
var newField = new FixedFieldDeclaration ();
AddAttributeSection (newField, f);
AddModifiers (newField, location);
if (location != null)
newField.AddChild (new CSharpTokenNode (Convert (location [0]), "fixed".Length), FixedFieldDeclaration.Roles.Keyword);
newField.AddChild (ConvertToType (f.TypeName), FixedFieldDeclaration.Roles.Type);
var variable = new FixedVariableInitializer ();
variable.AddChild (new Identifier (f.MemberName.Name, Convert (f.MemberName.Location)), FixedFieldDeclaration.Roles.Identifier);
if (!f.Initializer.IsNull) {
var bracketLocations = LocationsBag.GetLocations (f.Initializer);
if (bracketLocations != null && bracketLocations.Count > 1)
variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), 1), FixedFieldDeclaration.Roles.LBracket);
variable.AddChild ((Expression)f.Initializer.Accept (this), FieldDeclaration.Roles.Expression);
if (bracketLocations != null && bracketLocations.Count > 1)
variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), 1), FixedFieldDeclaration.Roles.RBracket);
}
newField.AddChild (variable, FixedFieldDeclaration.VariableRole);
if (f.Declarators != null) {
foreach (var decl in f.Declarators) {
var declLoc = LocationsBag.GetLocations (decl);
if (declLoc != null)
newField.AddChild (new CSharpTokenNode (Convert (declLoc [0]), 1), FieldDeclaration.Roles.Comma);
variable = new FixedVariableInitializer ();
variable.AddChild (new Identifier (decl.Name.Value, Convert (decl.Name.Location)), FieldDeclaration.Roles.Identifier);
if (!decl.Initializer.IsNull) {
var bracketLocations = LocationsBag.GetLocations (f.Initializer);
if (bracketLocations != null && bracketLocations.Count > 1)
variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), 1), FixedFieldDeclaration.Roles.LBracket);
variable.AddChild ((Expression)decl.Initializer.Accept (this), FieldDeclaration.Roles.Expression);
if (bracketLocations != null && bracketLocations.Count > 1)
variable.AddChild (new CSharpTokenNode (Convert (bracketLocations [0]), 1), FixedFieldDeclaration.Roles.RBracket);
}
newField.AddChild (variable, FixedFieldDeclaration.VariableRole);
}
}
if (location != null)
newField.AddChild (new CSharpTokenNode (Convert (location [1]), 1), FieldDeclaration.Roles.Semicolon);
typeStack.Peek ().AddChild (newField, TypeDeclaration.MemberRole);
}
示例10: VisitFixedFieldDeclaration
public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
var entity = AffectedEntity.Field;
if (fixedFieldDeclaration.Modifiers.HasFlag(Modifiers.Const)) {
entity = AffectedEntity.ConstantField;
} else if (fixedFieldDeclaration.Modifiers.HasFlag(Modifiers.Readonly)) {
entity = AffectedEntity.ReadonlyField;
}
CheckName(fixedFieldDeclaration, entity, fixedFieldDeclaration.NameToken, GetAccessibiltiy(fixedFieldDeclaration, Modifiers.Private));
}
示例11: VisitFixedFieldDeclaration
public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
CheckNode(fixedFieldDeclaration);
}
示例12: VisitFixedFieldDeclaration
public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
if (fixedFieldDeclaration.HasModifier(Modifiers.Static))
{
this.CheckDependency(fixedFieldDeclaration.ReturnType);
base.VisitFixedFieldDeclaration(fixedFieldDeclaration);
}
}
示例13: VisitFixedFieldDeclaration
public override void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
// nothing
}
示例14: VisitFixedFieldDeclaration
public void VisitFixedFieldDeclaration(FixedFieldDeclaration fixedFieldDeclaration)
{
JsonObject declaration = CreateJsonEntityDeclaration(fixedFieldDeclaration);
AddKeyword(declaration, FixedFieldDeclaration.FixedKeywordRole);
declaration.AddJsonValue("variables", GetCommaSeparatedList(fixedFieldDeclaration.Variables));
Push(declaration);
throw new FirstTimeUseException();
}
示例15: VisitFixedFieldDeclaration
public void VisitFixedFieldDeclaration(FixedFieldDeclaration node)
{
NotSupported(node);
}