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

C# ICSharpCode类代码示例

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

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



ICSharpCode类属于命名空间,在下文中一共展示了ICSharpCode类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DecompileMethod

        public override void DecompileMethod(ilspy::Mono.Cecil.MethodDefinition method, ICSharpCode.Decompiler.ITextOutput output, DecompilationOptions options)
        {
            var cmethod = GetCompiledMethod(method);

            if ((cmethod != null) && (cmethod.DexMethod != null))
            {
                try
                {
                    var f = new MethodBodyDisassemblyFormatter(cmethod.DexMethod, MapFile);
                    var formatOptions = FormatOptions.EmbedSourceCode | FormatOptions.ShowJumpTargets;
                    if(ShowFullNames) formatOptions |= FormatOptions.FullTypeNames;
                    if(DebugOperandTypes) formatOptions |= FormatOptions.DebugOperandTypes;
                    
                    var s = f.Format(formatOptions);
                    output.Write(s);
                }
                catch (Exception)
                {
                    output.Write("\n\n// Formatting error. Using Fallback.\n\n");
                    FallbackFormatting(output, cmethod);    
                }
                
            }
            else
            {
                output.Write("Method not found in dex");
                output.WriteLine();
            }
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:29,代码来源:DexLanguage.cs


示例2: Inject

        public void Inject(ICSharpCode.ILSpy.TreeNodes.ILSpyTreeNode node, string name, IMetadataTokenProvider member)
        {
            //Name and namespace
            var typeName = node is ModuleTreeNode ? (name.Substring(name.Contains(".") ? name.LastIndexOf('.') + 1 : 0)) : name;
            var typeNamespace = node is ModuleTreeNode ? (name.Substring(0, name.Contains(".") ? name.LastIndexOf('.') : 0)) : string.Empty;

            //Checks that the typename isn't empty
            if (string.IsNullOrEmpty(typeName))
            {
                MessageBox.Show("Please, specify the name of the type", "Type name required", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            //Creates a new class definition
            var c = new TypeDefinition(
                typeNamespace,
                typeName,
                TypeAttributes.Class | TypeAttributes.Interface | TypeAttributes.Public | TypeAttributes.AutoClass | TypeAttributes.AnsiClass | TypeAttributes.Abstract
            )
            {
                IsAnsiClass = true,
            };

            //Adds to the node
            Helpers.Tree.AddTreeNode(node, c, null, null);
        }
开发者ID:95ulisse,项目名称:ILEdit,代码行数:26,代码来源:InterfaceInjector.cs


示例3: RetrieveRegions

		void RetrieveRegions(ICompilationUnit cu, ICSharpCode.NRefactory.Parser.SpecialTracker tracker)
		{
			for (int i = 0; i < tracker.CurrentSpecials.Count; ++i) {
				ICSharpCode.NRefactory.PreprocessingDirective directive = tracker.CurrentSpecials[i] as ICSharpCode.NRefactory.PreprocessingDirective;
				if (directive != null) {
					if (directive.Cmd == "#region") {
						int deep = 1;
						for (int j = i + 1; j < tracker.CurrentSpecials.Count; ++j) {
							ICSharpCode.NRefactory.PreprocessingDirective nextDirective = tracker.CurrentSpecials[j] as ICSharpCode.NRefactory.PreprocessingDirective;
							if (nextDirective != null) {
								switch (nextDirective.Cmd) {
									case "#region":
										++deep;
										break;
									case "#endregion":
										--deep;
										if (deep == 0) {
											cu.FoldingRegions.Add(new FoldingRegion(directive.Arg.Trim(), new DomRegion(directive.StartPosition, nextDirective.EndPosition)));
											goto end;
										}
										break;
								}
							}
						}
						end: ;
					}
				}
			}
		}
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:29,代码来源:Parser.cs


示例4: ToolTipData

			public ToolTipData (ICSharpCode.NRefactory.CSharp.SyntaxTree unit, ICSharpCode.NRefactory.Semantics.ResolveResult result, ICSharpCode.NRefactory.CSharp.AstNode node, CSharpAstResolver file)
			{
				this.Unit = unit;
				this.Result = result;
				this.Node = node;
				this.Resolver = file;
			}
开发者ID:kthguru,项目名称:monodevelop,代码行数:7,代码来源:LanguageItemTooltipProvider.cs


示例5: ColorizeLine

 protected override void ColorizeLine(ICSharpCode.AvalonEdit.Document.DocumentLine line)
 {
     if ((line.LineNumber == LineNumber) && IsEnabled)
     {
         ChangeLinePart(line.Offset, line.EndOffset, element => element.TextRunProperties.SetBackgroundBrush(Brushes.Yellow));
     }
 }
开发者ID:rsrlab,项目名称:Scripting,代码行数:7,代码来源:BreakLineHighlight.cs


示例6: NRefactoryCodeAction

		public NRefactoryCodeAction (string id, string title, ICSharpCode.NRefactory.CSharp.Refactoring.CodeAction act)
		{
			this.IdString = id;
			this.Title = title;
			this.act = act;
			this.DocumentRegion = new Mono.TextEditor.DocumentRegion (act.Start, act.End);
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:7,代码来源:NRefactoryCodeAction.cs


示例7: VisitIdentifierExpression

		public override object VisitIdentifierExpression(ICSharpCode.NRefactory.Ast.IdentifierExpression identifierExpression, object data)
		{
			if (Compare(identifierExpression)) {
				identifiers.Add(identifierExpression);
			}
			return base.VisitIdentifierExpression(identifierExpression, data);
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:7,代码来源:FindReferenceVisitor.cs


示例8: FillTree

		public void FillTree (ICSharpCode.TreeView.SharpTreeView tree,Module module)
		{
			var root = CreateTreeItem(module);
			tree.Root = root;
			
			foreach (var ns in module.Namespaces)
			{
				var namespaceNode = CreateTreeItem(ns);
				tree.Root.Children.Add(namespaceNode);
				
				foreach (var type in ns.Types)
				{
					var typeNode = CreateTreeItem(type);
					namespaceNode.Children.Add(typeNode);

					foreach (var method in type.Methods)
					{
						var methodName = CreateTreeItem(method);
						namespaceNode.Children.Add(methodName);
					}

					foreach (var field in type.Fields)
					{
						var fieldNode = CreateTreeItem(field);
						namespaceNode.Children.Add(fieldNode);
					}
				}
			}
		}
开发者ID:nylen,项目名称:SharpDevelop,代码行数:29,代码来源:Helpers.cs


示例9: VisitLocalVariableDeclaration

		public override object VisitLocalVariableDeclaration (ICSharpCode.NRefactory.Ast.LocalVariableDeclaration localVariableDeclaration, object data)
		{
			object result = base.VisitLocalVariableDeclaration (localVariableDeclaration, data);
			if (localVariableDeclaration.Variables.Count == 0)
				RemoveCurrentNode ();
			return result;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:7,代码来源:ExtractMethodAstTransformer.cs


示例10: VisitVariableDeclaration

 public override object VisitVariableDeclaration(ICSharpCode.NRefactory.Ast.VariableDeclaration variableDeclaration, object data)
 {
     if (!(variableDeclaration.Parent is LocalVariableDeclaration)) {
         this.ReplaceCurrentNode(new ExpressionStatement(new AssignmentExpression(new IdentifierExpression(variableDeclaration.Name), AssignmentOperatorType.Assign, variableDeclaration.Initializer)));
     }
     return base.VisitVariableDeclaration(variableDeclaration, data);
 }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:7,代码来源:ReplaceUnnecessaryVariableDeclarationsTransformer.cs


示例11: IsValid

        public bool IsValid(object owner, ICSharpCode.Core.Condition condition)
        {
            if (!condition.Properties.Contains(NodeTypeKey))
            return false;

              string nodeTypeString = condition.Properties[NodeTypeKey];
              XmlEditor editor = owner as XmlEditor;
              if (editor == null)
            return false;

              XmlViewSingleContent view = LogicalTreeHelper.FindLogicalNode(editor, "xmlView") as XmlViewSingleContent;

              if (view == null || view.ActiveViewer == null)
            return false;
              XmlNode targetNode = view.ActiveViewer.GetCaretNode();
              if (targetNode == null)
            return false;
              if (nodeTypeString.Equals("LeafElement"))
              {
            if (targetNode.NodeType == XmlNodeType.Element && targetNode.ChildNodes.Count == 1 && targetNode.FirstChild.NodeType == XmlNodeType.Text)
              return true;
            return false;
              }
              else
            return targetNode.NodeType.ToString().Equals(nodeTypeString);
        }
开发者ID:harrygg,项目名称:VuGenPowerPack,代码行数:26,代码来源:Conditions.cs


示例12: Complete

 public override void Complete(ICSharpCode.AvalonEdit.Editing.TextArea textArea, ICSharpCode.AvalonEdit.Document.ISegment completionSegment, EventArgs insertionRequestEventArgs)
 {
   var insertion = Action == null ? this.Text : Action.Invoke();
   textArea.Document.Replace(completionSegment, insertion);
   if (insertion.EndsWith("("))
     _parent.ShowCompletions(_control);
 }
开发者ID:rneuber1,项目名称:InnovatorAdmin,代码行数:7,代码来源:SqlGeneralCompletionData.cs


示例13: RawlyIndentLine

		public void RawlyIndentLine(int tabsToInsert, ICSharpCode.AvalonEdit.Document.TextDocument document, DocumentLine line)
		{
			if (!_doBeginUpdateManually)
				document.BeginUpdate();
			/*
			 * 1) Remove old indentation
			 * 2) Insert new one
			 */

			// 1)
			int prevInd = 0;
			int curOff = line.Offset;
			if (curOff < document.TextLength)
			{
				char curChar = '\0';
				while (curOff < document.TextLength && ((curChar = document.GetCharAt(curOff)) == ' ' || curChar == '\t'))
				{
					prevInd++;
					curOff++;
				}

				document.Remove(line.Offset, prevInd);
			}

			// 2)
			string indentString = "";
			for (int i = 0; i < tabsToInsert; i++)
				indentString += dEditor.Editor.Options.IndentationString;

			document.Insert(line.Offset, indentString);
			if (!_doBeginUpdateManually)
				document.EndUpdate();
		}
开发者ID:DinrusGroup,项目名称:D-IDE,代码行数:33,代码来源:DIndentationStrategy.cs


示例14: CreateDataSection

		public override void CreateDataSection (ICSharpCode.Reports.Core.BaseSection section)
		{
			if (section == null) {
				throw new ArgumentNullException("section");
			}
			Size detailSize = Size.Empty;
			Size itemSize = Size.Empty;
			Point rowLoction = Point.Empty;
			if (base.ReportModel.ReportSettings.GroupColumnsCollection.Count > 0)
			{
				
				var groupheader = base.CreateGroupHeader(new Point (GlobalValues.ControlMargins.Left,GlobalValues.ControlMargins.Top));
				base.ReportModel.DetailSection.Items.Add(groupheader);
				
				// Detail
				itemSize = CreateDetail();
				detailSize = new Size(Container.Size.Width,itemSize.Height  + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom);

				
				// GroupFooter
				var groupFooter = base.CreateFooter(new Point(GlobalValues.ControlMargins.Left,80));
				base.ReportModel.DetailSection.Items.Add(groupFooter);
				section.Size = new Size(section.Size.Width,125);
				rowLoction = new Point (Container.Location.X,45);
			}
			else
			{
				itemSize = CreateDetail();
				detailSize = new Size(Container.Size.Width,itemSize.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom);
				section.Size = new Size(section.Size.Width,Container.Size.Height + GlobalValues.ControlMargins.Top + GlobalValues.ControlMargins.Bottom);
				rowLoction = new Point(Container.Location.X,GlobalValues.ControlMargins.Top);
			}
			base.ConfigureDetails (rowLoction,detailSize);
			section.Items.Add(Container as BaseReportItem);
		}
开发者ID:Paccc,项目名称:SharpDevelop,代码行数:35,代码来源:ListLayout.cs


示例15: GetTypeNameForAttribute

		public string GetTypeNameForAttribute(ICSharpCode.NRefactory.CSharp.Attribute attribute)
		{
			return attribute.Type.Annotations
				.OfType<Mono.Cecil.MemberReference>()
				.First()
				.FullName;
		}
开发者ID:manojdjoshi,项目名称:simple-assembly-exploror,代码行数:7,代码来源:ILSpyEnvironmentProvider.cs


示例16: DrawBorder

		public void DrawBorder (iTextSharp.text.pdf.PdfContentByte contentByte,
		                        iTextSharp.text.Rectangle rectangle,
		                        ICSharpCode.Reports.Core.Exporter.IBaseStyleDecorator style)
		{
			if ( contentByte == null) {
				throw new ArgumentNullException("contentByte");
			}

			contentByte.SetColorStroke(style.PdfFrameColor);
			contentByte.SetLineWidth(UnitConverter.FromPixel(baseline.Thickness).Point);
			
			contentByte.MoveTo(rectangle.Left ,rectangle.Top );
			
			contentByte.LineTo(rectangle.Left, rectangle.Top - rectangle.Height);
			
			contentByte.LineTo(rectangle.Left + rectangle.Width, rectangle.Top - rectangle.Height);
			
			contentByte.LineTo(rectangle.Left   + rectangle.Width, rectangle.Top);
			
			contentByte.LineTo(rectangle.Left, rectangle.Top);
			
			contentByte.FillStroke();
			contentByte.ResetRGBColorFill();
			
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:25,代码来源:Border.cs


示例17: ComplexPropertiesMapping

 public ComplexPropertiesMapping(TypeBase type, MappingBase mapping, ICSharpCode.Data.EDMDesigner.Core.EDMObjects.SSDL.EntityType.EntityType table)
 {
     Type = type;
     Mapping = mapping;
     Table = table;
     TPC = true;
 }
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:7,代码来源:ComplexPropertiesMapping.cs


示例18: GetFieldString

        protected override string GetFieldString(ICSharpCode.NRefactory.TypeSystem.IField field, OutputSettings settings)
        {
            if (field == null)
                return "";
            var result = new StringBuilder ();
            bool isEnum = field.DeclaringTypeDefinition != null && field.DeclaringTypeDefinition.Kind == TypeKind.Enum;
            AppendModifiers (result, settings, field);

            if (!settings.CompletionListFomat && settings.IncludeReturnType && !isEnum) {
                result.Append (GetTypeReferenceString (field.ReturnType, settings));
                result.Append (settings.Markup (" "));
            }

            if (!settings.IncludeReturnType && settings.UseFullName) {
                result.Append (GetTypeReferenceString (field.DeclaringTypeDefinition, settings));
                result.Append (settings.Markup ("."));
            }
            result.Append (settings.EmitName (field, FilterName (Format (field.Name))));

            if (settings.CompletionListFomat && settings.IncludeReturnType && !isEnum) {
                result.Append (settings.Markup (" : "));
                result.Append (GetTypeReferenceString (field.ReturnType, settings));
            }
            return result.ToString ();
        }
开发者ID:atsushieno,项目名称:md-typescript,代码行数:25,代码来源:TypeScriptAmbience.cs


示例19: Run

        protected override void Run(ICSharpCode.TextEditor.TextEditorControl textEditor, ICSharpCode.SharpDevelop.Dom.Refactoring.RefactoringProvider provider)
        {
            if (textEditor.ActiveTextAreaControl.SelectionManager.HasSomethingSelected)
            {
                MethodExtractorBase extractor = GetCurrentExtractor(textEditor);
                if (extractor != null) {
                    if (extractor.Extract()) {
                        ExtractMethodForm form = new ExtractMethodForm(extractor.ExtractedMethod, new Func<IOutputAstVisitor>(extractor.GetOutputVisitor));

                        if (form.ShowDialog() == DialogResult.OK) {
                            extractor.ExtractedMethod.Name = form.Text;
                            try {
                                textEditor.Document.UndoStack.StartUndoGroup();
                                extractor.InsertAfterCurrentMethod();
                                extractor.InsertCall();
                                textEditor.Document.FormattingStrategy.IndentLines(textEditor.ActiveTextAreaControl.TextArea, 0, textEditor.Document.TotalNumberOfLines - 1);
                            } finally {
                                textEditor.Document.UndoStack.EndUndoGroup();
                            }
                            textEditor.ActiveTextAreaControl.SelectionManager.ClearSelection();
                        }
                    }
                }
            }
        }
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:25,代码来源:ExtractMethodCommand.cs


示例20: DrawString

		public static void DrawString (Graphics graphics,string text,
		                               ICSharpCode.Reports.Core.Exporter.TextStyleDecorator decorator)
		{
			if (graphics == null) {
				throw new ArgumentNullException("graphics");
			}
			if (decorator == null) {
				throw new ArgumentNullException("decorator");
			}
			StringFormat stringFormat = BuildStringFormat(decorator.StringTrimming,decorator.ContentAlignment);
			
			string formattedString = text;

			if (! String.IsNullOrEmpty(decorator.FormatString)) {
				formattedString = StandardFormatter.FormatOutput(text,decorator.FormatString,decorator.DataType,"yyy");
			}
			
			
			graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
			
			graphics.DrawString (formattedString,decorator.Font,
			                     new SolidBrush(decorator.ForeColor),
			                     new Rectangle(decorator.Location.X,
			                                   decorator.Location.Y,
			                                   decorator.Size.Width,
			                                   decorator.Size.Height),
			                     stringFormat);
		}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:28,代码来源:TextDrawer.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# NRefactory.CSharp类代码示例发布时间:2022-05-24
下一篇:
C# ICLS_Environment类代码示例发布时间: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