icsharpcode

ICSharpCode.Decompiler + Mono.Cecil -> How to generate code for a single method?

∥☆過路亽.° 提交于 2020-01-12 09:15:16
问题 I'm able to use Mono.Cecil and ICSharpCode.Decompiler to generate the code for a type or an assembly. But if I try to generate the code for a single method I'll get an error "Object reference not set to an instance of an object." Can you guys give me any hints about this? Thanks ahead for all the help. Code to generate code for all the types inside an assembly: DirectoryInfo di = new DirectoryInfo(appPath); FileInfo[] allAssemblies = di.GetFiles("*.dll"); foreach (var assemblyFile in

Pressing Enter Key will Add the Selected Item From ListBox to RichTextBox

纵饮孤独 提交于 2019-12-25 01:02:10
问题 related to this topic: Hidden ListBox will appear while Typing Words in RichTextBox im working on a code editor and i just want to know if how can I add items from listbox to textbox using enterkey . further more heres my strings: public String[] ab = { "abstract" }; public String[] am = { "AmbientProperties", "AmbientValueAttribute" }; sample: in richtextbox (rtb) , i type Ab, then hiddenlistbox will appear with "abstract" text on it (already do that) using this code: if (token == "letterA"

ICSharpCode.TextEditor Vertical Scrolling

回眸只為那壹抹淺笑 提交于 2019-12-12 10:59:32
问题 Is it possible to configure vertical scrolling in ICSharpCode.TextEditor such that by default no vertical scrollbar is visible. And that only when someone types a lot of lines (beyond current height of this control) that a vertical scrollbar appears automatically. If yes, how? 回答1: Its easy to add the function yourself: 1) Goto the namespace ICSharpCode.TextEditor and open the TextAreaControl class. The file location is: C:...\ICSharpCode.TextEditor\Project\Src\Gui\TextAreaControl.cs 2) Add a

ICSharpCode.SharpZipLib validate zip file

让人想犯罪 __ 提交于 2019-12-07 00:15:17
问题 Using ICSharpCode.SharpZipLib for C#, how can I validate that the file being passed is actually a valid zip file (not something that has been right clicked and renamed as .zip)? [HttpPost] public ActionResult Upload(HttpPostedFileBase fileData) { if (fileData != null && fileData.ContentLength > 0) { if (Path.GetExtension(fileData.FileName) == ".zip") { var zipFile = Server.MapPath("~/Content/uploads/" + Path.GetFileName(fileData.FileName)); fileData.SaveAs(zipFile); FileStream fs = System.IO