当前位置: 首页>>代码示例>>C#>>正文


C# ICSharpCode类代码示例

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


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


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