Online CodeEditor with Intelligence (C#) - c#

A Google search results in CodeMirrow. I could not find a c# demo and not sure if it support intelligence (or if thats even possible).
Does anyone know any (browser code editor) projects that support Intelligence/auto-completion. Im looking for a project that i can use freely on my own site.

What about ".NET jsFiddle" ???
http://dotnetfiddle.net

I think you should go with CodeMirror, which is the only that I know that has Auto Complete.
You can check a demo here: http://codemirror.net/demo/complete.html.
And it's open source and actively developed, so, you can always contribute with improvements: https://github.com/marijnh/CodeMirror.

try this one (has autocomplete)
http://www.coderun.com/ide/
https://compilr.com (Not sure about autocomplete )

Related

Determine who has a file open using C# - is there a way now?

I need to be able to check who has a file open using C#. I found a few people asked this question before but they were all a long time ago with the latest being in 2012. I was wondering if, in the last 5 years, has Microsoft added this ability to .net or maybe someone came out with a nuget package that is capable.
Here is the latest answer I found
You can use windows internal function NTQuerySystemInformation with undocumented parameter SystemHandleInformation for it. I don't know about c# implementation, but I know delphy code for it, and vb6 code. Check this links, it will help you to make your c# implementation.
Delphi - get what files are opened by an application
https://forum.sysinternals.com/topic14546.html
As far as I know, the standard library still does not have suitable functions for this. There is a popular question about this: https://stackoverflow.com/a/937558/5665527.
Also, if you want to know who opened the file remotely - net file function may be useful (which is accessible via cmd). I believe that there are similar WinAPI functions on MSDN that could be implemented in a similar way.

How to programmatically create custom comment tokens

I am writing a small Visual Studio addin to let the user use more features of the comment tokens (TODO, HACK, etc.). For this I want to extend Visual Studio with new commands (such as TODISCUSS, TODELETE, FIXME, TESTME, etc.). I'd like to do this programmatically when my addin starts.
I already found out how to do this manually: http://msdn.microsoft.com/en-us/library/ekwz6akh%28v=vs.80%29.aspx
Does anyone have an idea how this could be done via the API?
Any ideas or suggestions would be appreciated!
Edit :
See this MSDN Link perhaps digging around in TaskList will get you somewhere.
Original Post :
It's not very clear (to me :) what exactly you want to do. Is it: find, edit, or refactor the tokens and then do something else with the sources? I can suggest this article on Code Project (NRefactory).
Using NRefactory you can do anything and everything with the source files including locating the tokens you want and doing stuff with them. You will also know the files you found them in, line numbers etc.
Perhaps you will be able to use Nrefactory to do all the heavy lifting as far as sources are concerned.

Autoupdating software using intranet

i searched for the topic but didn't find exactly that kind of problem.
I want to create a C# WinForms software which should run only in intranet. If i change the software afterwards i would like to have the application to look automatically in the network for a newer version. Is a newer version available it should replace the old one. Maybe there is some tool or library to achieve that?
Further Information: The software does not use a database and consists only out of one .exe file. No other stuff or files needed.
I don't want to setup a server or something like that for this task. I want it as simple and clean as possible.
Thanks in advance.
Joe
I think clickonce may help you. see http://msdn.microsoft.com/en-us/library/t71a733d(v=vs.80).aspx for more details
I really like the updateSystem.NET-lib, but which is only available in german. If you can understand the easy API, this is exactly what you are searching for.
Here, you can find a little tutorial, also in german.

jQuery AutoComplete missing?

I was building something using jQuery's AutoComplete plugin last week, but today I found that it's not working.
After some debugging, it seems that the external scripts I've been loading no longer exist:
http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.bgiframe.min.js
http://dev.jquery.com/view/trunk/plugins/autocomplete/lib/jquery.dimensions.js
http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js
Even the demo on the plugin page no longer works:
http://docs.jquery.com/Plugins/autocomplete
Was the plugin deprecated over the weekend and I didn't know it? Or is there some way to let them know that the files aren't showing up?
Here's a link to the static delivery on the google CDN:
http://code.google.com/apis/libraries/
I'm not sure they do the plugins, but you can get the main library this way.
Here are some quick links to get your missing scripts:
http://docs.jquery.com/Plugins/bgiframe
http://plugins.jquery.com/project/dimensions
http://docs.jquery.com/Plugins/autocomplete
Like #Paddy said in the comments above, I would HIGHLY recommend pulling these down into your project and creating local references to each instead of relying on the FQDN of the scripts on another host to remain unchanged forever.
UPDATE:
Note that I myself have noticed some downloads going missing recently on jquery.com, so you may have trouble finding the downloads. If so, I would recommend checking if google's cache has a hard link to them - I've been able to find a couple this way.

How to quickly code and run small C# code

There are times when I want to test new code from the forums or when I need to help my friends with specific C# problem. The problem is I don't want to create new "project" in Visual Studio each time just to code/run only this small code.
Java & Eclipse IDE comes up with "Scrapbook" feature which allows the execution of arbitrary Java expressions. What are the choices for C# programmers?
Snippet Compiler is great for this.
LINQPad is also good for testing out all sorts of C#, F# or VB code, not just LINQ queries.
EDIT
I suppose it's time that I mention that Snippet Compiler hasn't been updated in over five years, and is therefore no longer the best option.
However, I undersold LINQPad originally. As Will Dean mentioned in the comments, LINQPad is excellent for all sorts of code, not just LINQ queries. In fact, it has become an indispensable tool for me. I use it daily, not only to quickly test out short snippets, but for relatively complex mini programs. Its advanced output formatting makes it extremely easy to quickly examine intermediate and final results.
A bit late to the party, but I came here while searching for this myself.
The best suitable solution for me was using the C# Interactive-window inside Visual Studio 2015 or later.
You can access it by opening it via View > Other Windows > C# Interactive, or by selecting some c# code and clicking on Execute in Interactive in the right-click context menu.
Here is a link on how to use it: http://dailydotnettips.com/2016/01/12/use-c-interactive-window-for-your-coding-experiment-in-visual-studio-2015/
I know it works in VS2015, I don't think it works in older versions.
The website .NET Fiddle seems like a nice option. It has code completion, code timing, and NuGet Package integration.
From their site:
We are a group of .NET developers who are sick and tired of starting
Visual Studio, creating a new project and running it, just to test
simple code or try out samples from other developers.
This tool was inspired by http://jsfiddle.net, which is just awesome.
In particular, I recommend trying out their MVC mode. On the left side of the screen choose Project Type: MVC.
Here's what I do:
Go to Tools->Options->ProjectsAndSolutions, and disable "Save new projects when created".
Fire up a new VS, Ctrl-Shift-N to create a project, and use that.
Use C# Express to have something that launches more quickly and has less clutter, but still enough power to do most things.
I usually use csc directly from the command line
C:\Users\Greg>csc /o- /debug+
Test.cs
You can run a lot of things in the Immediate window (Debug >> Windows >> Immediate)
For example, you can run the following:
System.IO.File.WriteAllText(#"c:\temp\blah.txt", "Hi there!");
Check also Snippy and the Snippy Addin for Reflector
There's also the interactive C# shell, built on top of Mono:
http://mono-project.com/CsharpRepl
That's similar to what other languages have (for example, irb with Ruby)
Have a look at Introducing the Microsoft “Roslyn” CTP.
The "C# Interactive" window is perfect for this.
Late in here, but if you also want to share the code with others, then .NET Fiddle is the best I have tried so far. For offline solutions, LINQPad definitely would have my vote as well, and not just for LINQ queries.
I just use the scratch console application project that I've defined for just this purpose. I cut out whatever is in the main program and go to town. If I decide that I need to keep whatever I've prototyped, I create a new project and copy to it. Since I do this all the time, the project's always in my recent-projects list, too.
I use a batch file (csc.bat):
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc %1 %2 %3 %4 %5 %6 %7 %8 %9
For vb.net I use this batch file(vbc.bat):
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\vbc %1 %2 %3 %4 %5 %6 %7 /r:system.windows.forms.dll /r:system.data.dll /r:system.dll
For example: C:>csc testit.cs
Each will create a .net .exe file.
This solution is not so good for Windows Forms applications, however.
RoslynPad - nice lightweight open-source alternative to LINQPad.
RoslynPad, https://roslynpad.net/
GitHub: https://github.com/aelij/RoslynPad
This is something I've never liked about visual studio. One thing (and probally the only thing) I miss from VB6 was the ability to create a project, and run it without saving it or anything. Was great for just what you said.
I typically have at least one or two scrap projects of each type, (Console, Winforms, and Web), that I just rotate and use. This way I'm not always creating new projects.
you could have a look into C# Scripting.
C# scripting
this is ment to allow you to build fast scripts without the use of the IDE.
HTH
bones
I always keep a copy of Express Edition running; this can execute and debug projects without needing a proper file location (as long as you don't hit save). Does the job for me...
Try SharpDevelop. It doesn't contain everything, but is good for quick examples. You can open a solution and easily swap out the code to test something else. In the project properties you can change a solution from console to window app via a combobox selection. You can easily translate your code from C# to Boo, Python, Ruby or VB, or from any of these languages to another, starting with whatever your source is. Therefore, if you go looking for a problem solution on the web and can't find one in VB - but do find one in C#, you may be able to convert it.
There is an online web C# compiler and executor: http://www.compileonline.com/compile_csharp_online.php
You can try using ScriptCS. It uses the Roslyn compiler to create a scripting language using C#.
Visual Studio should be a better choice, but it is too heavy. Some simple tests, I often try here.
https://learn.microsoft.com/zh-cn/learn/modules/csharp-write-first/2-exercise-hello-world
or use linqpad and vscode
https://www.linqpad.net/
https://code.visualstudio.com/

Categories