X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=man%2Fcsharp.1;h=9379658e62e5ec4615a6f61f890f06f56bd458fd;hb=1777aff514b17945b284552aaed85aa1f3789201;hp=8331b6ea5fc1d078b446839337d83b8b4a94a70c;hpb=4323fbeaebf249f016dfdd6dc9b3b52a515f87c4;p=mono.git diff --git a/man/csharp.1 b/man/csharp.1 index 8331b6ea5fc..9379658e62e 100644 --- a/man/csharp.1 +++ b/man/csharp.1 @@ -4,22 +4,62 @@ .. .TH csharp 1 "4 September 2008" .SH NAME -csharp \- Interactive C# Shell +csharp, gsharp \- Interactive C# Shell .SH SYNOPSIS -.B csharp +.B csharp [--attach PID] [-e EXPRESSION] [file1 [file2]] [options] +.P +.B gsharp [file1 [file2]] .SH DESCRIPTION The .I csharp is an interactive C# shell that allows the user to enter and evaluate -C# statements and expressions from the command line. -.PP -This command is a shortcut to invoke the -.I gmcs -command with the -.I \-\- shell -command line option. All of the regular compiler options available -to gmcs are available in the interactive shell. +C# statements and expressions from the command line. The regular +.I mcs +command line options can be used in this version of the compiler. +.PP +The +.I gsharp +command is a GUI version of the C# interpreter that uses Gtk# and +provides an area to attach widgets as well. This version can be +attached to other Gtk# applications in a safe way as it injects itself +into the main loop of a Gtk# application, avoiding any problems +arising from the multi-threaded nature of injecting itself into a +target process. +.PP +Files specified in the command line will be loaded and executed as +scripts. +.PP +Starting with Mono 2.10, the +.I csharp +command can be used as an interpreter executed by executables flagged +with the Unix execute attribute. To do this, make the first line of +your C# source code look like this: +.nf +"#!/usr/bin/csharp" +Console.WriteLine ("Hello, World"); +.fi +.SH OPTIONS +The commands accept all of the commands that are available to the +.I mcs +command, so you can reference assemblies, specify paths, language +level and so on from the command line. In addition, the following +command line options are supported: +.TP +.I "\-\-attach" +This is an advanced option and should only be used if you have a deep +understanding of multi-threading. This option is availble on the +.I csharp +command and allows the compiler to be injected into other processes. +This is done by injecting the C# shell in a separate thread that runs +concurrently with your application. This means that you must take +special measures to avoid crashing the target application while using +it. For example, you might have to take the proper locks before +issuing any commands that might affect the target process state, or +sending commands through a method dispatcher. +.TP +.I "\-e" EXPRESSION +This will evaluate the specified C# EXPRESSION and exit .SH OPERATION Once you launch the csharp command, you will be greeted with the interactive prompt: @@ -179,7 +219,8 @@ csharp> .SH INTERACTIVE EDITING The C# interactive shell contains a line-editor that provides a more advanced command line editing functionality than the operating system -provides. +provides. These are available in the command line version, the GUI +versions uses the standard Gtk# key bindings. .PP The command set is similar to many other applications (cursor keys) and incorporates some of the Emacs commands for editing as well as a @@ -288,13 +329,22 @@ csharp> .PP The return value is a TimeSpan, that you can store in a variable for benchmarking purposes. +.SH GUI METHODS AND PROPERTIES +In addition to the methods and properties available in the console +version there are a handful of extra properties available on the GUI +version. For example a "PaneContainer" Gtk.Container is exposed that +you can use to host Gtk# widgets while prototyping or the "MainWindow" +property that gives you access to the current toplevel window. .SH STARTUP FILES -The C# shell will load all the C# script files and Mono assemblies -located in the ~/.config/csharp directory on Unix. C# script files -are files that have the extension .cs and they should only contain -statements and expressions, they can not contain full class -definitions (at least not as of Mono 2.0). Full class definitions -should be compiled into dlls and stored in that directory. +The C# shell will load all the Mono assemblies and C# script files +located in the ~/.config/csharp directory on Unix. The assemblies are +loaded before the source files are loaded. +.PP +C# script files are files +that have the extension .cs and they should only contain statements +and expressions, they can not contain full class definitions (at least +not as of Mono 2.0). Full class definitions should be compiled into +dlls and stored in that directory. .SH AUTHORS The Mono C# Compiler was written by Miguel de Icaza, Ravi Pratap, Martin Baulig, Marek Safar and Raja Harinath. The development was @@ -308,9 +358,9 @@ gmcs(1), mcs(1), mdb(1), mono(1), pkg-config(1) .SH BUGS To report bugs in the compiler, you must file them on our bug tracking system, at: -http://www.mono-project.com/Bugs +http://www.mono-project.com/community/bugs/ .SH MAILING LIST -The Mono Mailing lists are listed at http://www.mono-project.com/Mailing_Lists +The Mono Mailing lists are listed at http://www.mono-project.com/community/help/mailing-lists/ .SH MORE INFORMATION The Mono C# compiler was developed by Novell, Inc (http://www.novell.com, http) and is based on the @@ -318,5 +368,5 @@ ECMA C# language standard available here: http://www.ecma.ch/ecma1/STAND/ecma-334.htm .PP The home page for the Mono C# compiler is at -http://www.mono-project.com/CSharp_Compiler information about the -interactive mode for C# is available in http://mono-project.com/CsharpRepl +http://www.mono-project.com/docs/about-mono/languages/csharp/ information about the +interactive mode for C# is available in http://mono-project.com/docs/tools+libraries/tools/repl/