• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IDefinition类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IDefinition的典型用法代码示例。如果您正苦于以下问题:C# IDefinition类的具体用法?C# IDefinition怎么用?C# IDefinition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IDefinition类属于命名空间,在下文中一共展示了IDefinition类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
            }
        }
开发者ID:moljac,项目名称:MonoMobile.SharpSNMP,代码行数:34,代码来源:NormalAgentProfile.cs


示例2: ExtendDefinition

 public override void ExtendDefinition(IDefinition definition)
 {
     // only applies to type definitions
     var typeDef = definition as ITypeDefinition;
     if (typeDef != null)
         typeDef.Namespace = "";
 }
开发者ID:JimmyJune,项目名称:blade,代码行数:7,代码来源:ScriptIgnoreNamespaceExtension.cs


示例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);
             }
         }
     }
 }
开发者ID:Hamsand,项目名称:Swf2XNA,代码行数:28,代码来源:Definition2D.cs


示例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;
        }
开发者ID:FlyingDeveloper,项目名称:blade,代码行数:10,代码来源:ScriptFieldExtension.cs


示例5: FormTable

 public FormTable(IDefinition def)
 {
     _definition = def;
     InitializeComponent();
     cbColumnDisplay.SelectedIndex = 1;
     if (PlatformSupport.Platform == PlatformType.Windows)
     {
         Icon = Properties.Resources.x_office_spreadsheet;
     }
 }
开发者ID:stubarr,项目名称:sharpsnmplib-1,代码行数:10,代码来源:FormTable.cs


示例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;
 }
开发者ID:RUB-SysSec,项目名称:Probfuscator,代码行数:10,代码来源:SourceEmitter.cs


示例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;
		}
开发者ID:nyxojaele,项目名称:Swf2XNA,代码行数:13,代码来源:XamlRenderer.cs


示例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;
            }
        }
开发者ID:JimmyJune,项目名称:blade,代码行数:13,代码来源:ScriptMixinExtension.cs


示例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();
        }
开发者ID:dsgouda,项目名称:buildtools,代码行数:13,代码来源:CSDeclarationHelper.cs


示例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();
        }
开发者ID:dsgouda,项目名称:buildtools,代码行数:13,代码来源:CSDeclarationHelper.cs


示例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;
        }
开发者ID:XieShuquan,项目名称:roslyn,代码行数:14,代码来源:Units.cs


示例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;
        }
开发者ID:JimmyJune,项目名称:blade,代码行数:14,代码来源:ScriptObjectLiteralExtension.cs


示例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;
        }
开发者ID:ekona,项目名称:sharpsnmplib,代码行数:15,代码来源:SearchResult.cs


示例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;
        }
开发者ID:Bia10,项目名称:meshReader,代码行数:16,代码来源:Transformation.cs


示例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");
            }
        }
开发者ID:graphql-dotnet,项目名称:graphql-dotnet,代码行数:17,代码来源:Document.cs


示例16: GetChange

        public SymbolChange GetChange(IDefinition def)
        {
            var symbol = def as ISymbol;
            if (symbol != null)
            {
                return GetChange(symbol);
            }

            // If the def existed in the previous generation, the def is unchanged
            // (although it may contain changed defs); otherwise, it was added.
            if (this.definitionMap.DefinitionExists(def))
            {
                var typeDef = def as ITypeDefinition;
                return (typeDef != null) ? SymbolChange.ContainsChanges : SymbolChange.None;
            }
            return SymbolChange.Added;
        }
开发者ID:pheede,项目名称:roslyn,代码行数:17,代码来源:SymbolChanges.cs


示例17: GetTable

 internal override void GetTable(IDefinition def)
 {
     IList<Variable> list = new List<Variable>();
     int rows = Messenger.Walk(VersionCode, Agent, GetCommunity, new ObjectIdentifier(def.GetNumericalForm()), list, Timeout, WalkMode.WithinSubtree);
     
     // How many rows are there?
     if (rows > 0)
     {
         FormTable newTable = new FormTable(def);
         newTable.SetRows(rows);
         newTable.PopulateGrid(list);
         newTable.Show();
     }
     else
     {
         foreach (Variable t in list)
         {
             Logger.Info(t.ToString());
         }
     }
 }
开发者ID:moljac,项目名称:MonoMobile.SharpSNMP,代码行数:21,代码来源:NormalAgentProfile.cs


示例18: GenerateXamlPart

        public override void GenerateXamlPart(VexObject v, IDefinition def, out string xamlFileName)
        {
            this.v = v;
            this.Log = new StringBuilder();
            xamlFileName = Directory.GetCurrentDirectory() + "/" + v.Name + "_" + def.Id + ".xaml";
            xw = new XamlWriter(xamlFileName, Encoding.UTF8);

            xw.WriteComment(headerComment);

            #if(IS_TRIAL)
            // turn off watermarking for small files
            isWatermarking = true;
            xw.WriteComment(trialComment);
            if (v.Definitions.Count < 15)
            {
                isWatermarking = false;
            }
            #else
            isWatermarking = false;
            #endif

            xw.OpenHeaderTag(def.StrokeBounds.Size.Width, def.StrokeBounds.Size.Height, v.BackgroundColor);

            Dictionary<uint, IDefinition> defList = new Dictionary<uint, IDefinition>();
            defList.Add(1, def);
            WriteDefinitions(defList, true, true);

            //WriteTimelineDefiniton(v.Root, true);
            // Write a rectangle to hold this shape
            Instance inst = new Instance();
            inst.Name = instancePrefix + def.Id;
            inst.InstanceID = 1;
            inst.DefinitionId = def.Id;
            inst.Transformations.Add(new Transform(0, 1000, Matrix.Identitiy, 1, ColorTransform.Identity));
            WriteInstance(def, inst);

            xw.CloseHeaderTag();

            xw.Close();
        }
开发者ID:nyxojaele,项目名称:Swf2XNA,代码行数:40,代码来源:WPFRenderer.cs


示例19: DetermineType

        private static DefinitionType DetermineType(string type, string name, IDefinition parent)
        {
            if (type == typeof(OidValueAssignment).ToString()) 
            {
                return DefinitionType.OidValueAssignment;
            }

            if (type != typeof(ObjectType).ToString())
            {
                return DefinitionType.Unknown;
            }

            if (name.EndsWith("Table", StringComparison.Ordinal))
            {
                return DefinitionType.Table;
            }

            if (name.EndsWith("Entry", StringComparison.Ordinal)) 
            {
                return DefinitionType.Entry;
            }

            return parent.Type == DefinitionType.Entry ? DefinitionType.Column : DefinitionType.Scalar;
        }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:24,代码来源:Definition.cs


示例20: ExtendDefinition

 public override void ExtendDefinition(IDefinition definition)
 {
     definition.Name = _name;
 }
开发者ID:FlyingDeveloper,项目名称:blade,代码行数:4,代码来源:ScriptNameExtension.cs



注:本文中的IDefinition类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IDefinitionAppId类代码示例发布时间:2022-05-24
下一篇:
C# IDefault类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap