本文整理汇总了C#中IDefinition类的典型用法代码示例。如果您正苦于以下问题:C# IDefinition类的具体用法?C# IDefinition怎么用?C# IDefinition使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDefinition类属于命名空间,在下文中一共展示了IDefinition类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Walk
public override void Walk(IDefinition definition)
{
IList<Variable> list = new List<Variable>();
if (VersionCode == VersionCode.V1)
{
Messenger.Walk(
VersionCode,
Agent,
GetCommunity,
new ObjectIdentifier(definition.GetNumericalForm()),
list,
Timeout,
WalkMode.WithinSubtree);
}
else
{
Messenger.BulkWalk(
VersionCode,
Agent,
GetCommunity,
new ObjectIdentifier(definition.GetNumericalForm()),
list,
Timeout,
10,
WalkMode.WithinSubtree,
null,
null);
}
foreach (Variable v in list)
{
Logger.Info(v.ToString(Objects));
}
}
示例2: ExtendDefinition
public override void ExtendDefinition(IDefinition definition)
{
// only applies to type definitions
var typeDef = definition as ITypeDefinition;
if (typeDef != null)
typeDef.Namespace = "";
}
示例3: AddShapes
public void AddShapes(VexObject vo, IDefinition def, Matrix m)
{
if (def.Name == "circleShape")
{
//Matrix m = orgInst.Transformations[0].Matrix;
Point c = new Point(m.TranslateX, m.TranslateY);
float r = m.ScaleX * 100 / 2;
Shapes.Add(new CircleShape2D(def.Name, c, r));
}
else if (def is Symbol)
{
//Matrix m = orgInst.Transformations[0].Matrix;
AddShape(def.Name, (Symbol)def, m);
}
else if (def is Timeline)
{
foreach (Instance inst in ((Timeline)def).Instances)
{
IDefinition def2 = vo.Definitions[inst.DefinitionId];
if (def2 is Symbol && (def2.UserData & (int)DefinitionKind.OutlineStroke) != 0)
{
//todo: Symbol may have multiple Shapes, and only one/some are red outlines
//Matrix m = inst.Transformations[0].Matrix;
AddShape(def.Name, (Symbol)def2, inst.Transformations[0].Matrix);
}
}
}
}
示例4: ExtendDefinition
public override void ExtendDefinition(IDefinition definition)
{
var memberDef = definition as IMemberDefinition;
if (memberDef == null)
return;
// change property to field
if (memberDef.MemberKind == MemberDefinitionKind.Property)
memberDef.MemberKind = MemberDefinitionKind.Field;
}
示例5: FormTable
public FormTable(IDefinition def)
{
_definition = def;
InitializeComponent();
cbColumnDisplay.SelectedIndex = 1;
if (PlatformSupport.Platform == PlatformType.Windows)
{
Icon = Properties.Resources.x_office_spreadsheet;
}
}
示例6: PrintDefinitionSourceLocations
private bool PrintDefinitionSourceLocations(IDefinition definition) {
bool result = false;
if (this.pdbReader != null) {
foreach (var psLoc in this.pdbReader.GetPrimarySourceLocationsFor(definition.Locations)) {
this.PrintSourceLocation(psLoc);
result = true;
}
}
return result;
}
示例7: GetDefinitionName
protected string GetDefinitionName(IDefinition def)
{
string result;
if (def.Name != null && def.Name != "")
{
result = def.Name;
}
else
{
result = symbolPrefix + def.Id.ToString();
}
return result;
}
示例8: ExtendDefinition
public override void ExtendDefinition(IDefinition definition)
{
var methodDef = definition as MethodDefinition;
if (methodDef == null || methodDef.Symbol == null)
return;
if (methodDef.Symbol.ReducedFrom != null)
{
// use the original method symbol and force non static
methodDef.Symbol = methodDef.Symbol.ReducedFrom;
methodDef.Modifiers.IsStatic = false;
}
}
示例9: GetString
public string GetString(IDefinition definition, int indentLevel = -1)
{
EnsureStringWriter();
_string.Clear();
if (indentLevel != -1)
_stringWriter.SyntaxtWriter.IndentLevel = indentLevel;
_stringWriter.WriteDeclaration(definition);
return _string.ToString();
}
示例10: GetTokenList
public IEnumerable<SyntaxToken> GetTokenList(IDefinition definition, int indentLevel = -1)
{
EnsureTokenWriter();
_tokenizer.ClearTokens();
if (indentLevel != -1)
_tokenizer.IndentLevel = indentLevel;
_tokenWriter.WriteDeclaration(definition);
return _tokenizer.ToTokenList();
}
示例11: DefinitionWithLocation
public DefinitionWithLocation(IDefinition definition,
int startLine, int startColumn, int endLine, int endColumn)
{
Debug.Assert(startLine >= 0);
Debug.Assert(startColumn >= 0);
Debug.Assert(endLine >= 0);
Debug.Assert(endColumn >= 0);
this.Definition = definition;
this.StartLine = (uint)startLine;
this.StartColumn = (uint)startColumn;
this.EndLine = (uint)endLine;
this.EndColumn = (uint)endColumn;
}
示例12: ExtendDefinition
public override void ExtendDefinition(IDefinition definition)
{
var typeDef = definition as ContainerTypeDefinition;
if (typeDef == null)
return;
// set to anonymous type view
typeDef.TypeKind = TypeDefinitionKind.Anonymous;
// set each property to render as a field
foreach (var prop in typeDef.Properties)
prop.MemberKind = MemberDefinitionKind.Field;
}
示例13: SearchResult
public SearchResult(IDefinition definition, uint[] remaining)
{
if (definition == null)
{
throw new ArgumentNullException("definition");
}
if (remaining == null)
{
throw new ArgumentNullException("remaining");
}
Definition = definition;
_remaining = remaining;
}
示例14: GetTransformation
public static Matrix GetTransformation(IDefinition def)
{
Matrix translation;
if (def.Position.X == 0.0f && def.Position.Y == 0.0f && def.Position.Z == 0.0f)
translation = Matrix.Identity;
else
translation = Matrix.CreateTranslation(-(def.Position.Z - Constant.MaxXY),
-(def.Position.X - Constant.MaxXY), def.Position.Y);
var rotation = Matrix.CreateRotationX(MathHelper.ToRadians(def.Rotation.Z))*
Matrix.CreateRotationY(MathHelper.ToRadians(def.Rotation.X))*Matrix.CreateRotationZ(MathHelper.ToRadians(def.Rotation.Y + 180));
if (def.Scale < 1.0f || def.Scale > 1.0f)
return (Matrix.CreateScale(def.Scale)*rotation)*translation;
return rotation * translation;
}
示例15: AddDefinition
public void AddDefinition(IDefinition definition)
{
_definitions.Add(definition);
if (definition is FragmentDefinition)
{
Fragments.Add((FragmentDefinition) definition);
}
else if (definition is Operation)
{
Operations.Add((Operation) definition);
}
else
{
throw new ExecutionError("Unhandled document definition");
}
}