public void AppendPropertyAccessors(bool hasGetter, bool hasSetter) { if (!CanAppendPropertyAccessors()) { return; } PropertyAccessors = new InterfaceAccessorsBlock(); if (hasGetter) { PropertyAccessors.AddGetter(); } if (hasSetter) { PropertyAccessors.AddSetter(); } using (Root.Transaction()) { if (ThisParameters != null) { ThisParameters.AppendBlocks(PropertyAccessors); } else { Text.AppendBlocks(PropertyAccessors); } Text.Text = Text.Text.TrimEnd(null); } }
public override void Visit(InterfaceAccessorsBlock block) { Write(" {"); if (block.Getter != null) { Write(" get;"); } if (block.Setter != null) { Write(" set;"); } Write(" }"); }
private void Check() { bool propertyAccessorsFound = false; bool parametersFound = false; bool thisParametersFound = false; foreach (Block b in this.Children) { InterfaceAccessorsBlock acc = b as InterfaceAccessorsBlock; if (acc != null) { if (PropertyAccessors != acc) { PropertyAccessors = acc; } propertyAccessorsFound = true; } ParameterListBlock par = b as ParameterListBlock; if (par != null) { if (par.TypeOfBraces == ParameterListBlock.TypeOfParentheses.Parentheses) { if (Parameters != par) { Parameters = par; } parametersFound = true; } else if (par.TypeOfBraces == ParameterListBlock.TypeOfParentheses.SquareBrackets) { if (ThisParameters != par) { ThisParameters = par; } thisParametersFound = true; } } } if (!propertyAccessorsFound && PropertyAccessors != null) { PropertyAccessors = null; } if (!parametersFound && Parameters != null) { Parameters = null; } if (!thisParametersFound && ThisParameters != null) { ThisParameters = null; } }
public virtual void Visit(InterfaceAccessorsBlock block) { }
public override void Visit(InterfaceAccessorsBlock block) { }