161
I Use This!
Inactive

News

Analyzed about 12 hours ago. based on code collected 1 day ago.
Posted over 15 years ago by martinkonicek
Hi, my gsoc project for this year is all about your productivity. I have been thinking what slows me down most when coding and reading code in SharpDevelop, and I would like to improve this. I will be working on a series of small features ... [More] (ReSharper-like, but not only) which will make everyday work with SharpDevelop faster. The first feature is variable highlighting in the editor   All occurences of the symbol under cursor are highlighted, which improves code readability. See the video. So far I got very positive feedback, you can try it yourself.   Next planned features are: ReSharper like context-aware tooltips, accessible from keyboard - what ReSharper features do you like the most? Better keyboard usability (shortcut for 'Find references' etc.) Snippet variable name prediction (ReSharper like) Better and faster code navigation: go to to method implementation from interface, go to derived class by in-place context menu showing derived classes CodeCompletion shows all classes from all referenced projects and automatically inludes 'using' if needed (already done) In-place rename Auto-implement IDisposable Improve refactorings (if there is time): change signature If you ever missed any feature which would save your time, please comment this blogpost. If it is good, I will implement it.   Cheers and happy coding Martin [Less]
Posted almost 16 years ago by ChristophWille
In the last blog post, I talked about the initial signup message that is sent to our servers.Today, I want to shed some light on how the usage data is stored on the client. The usage data - session information (time spent), environment information ... [More] (OS, et cetera), feature use and exceptions (if any) is stored in a local SQLite database, which is located in the user's roaming profile folder at the following location: C:\Users\<username>\AppData\Roaming\ICSharpCode\SharpDevelop4.0 The file itself is named usageData.dat. Although the extension is non-standard for SQLite, you can use one of the various SQLite management tools to have a look inside at the information (I am using SQLite3 Management Studio here): Point it to the database file (please note that the file doesn't exist if you didn't opt in for UDC): Now you can peruse the tables & information that is stored by UDC (please note that no information will be in the tables once UDC has uploaded sessions - once data for a session has been uploaded successfully, the associated data is purged locally): The tables are: Sessions, Environment, Exceptions, FeatureUses as well as Properties. The latter is used to store the client id (see earlier blog post): That's it - no magic proprietary file format, easy for you to peruse.   [Less]
Posted almost 16 years ago by ChristophWille
Good morning - today is the day: we have reached five million downloads on SourceForge! (the figure does not include downloads from CodePlex, our build server or third-party hosting sites) Congratulations to the team for their hard work over the past nine years and seven months!
Posted almost 16 years ago by siegi44
If you have tried SharpDevelop 4.0 already, you might have noticed that the Alt+Ins code generator is "missing". It is a useful feature, but we did not reimplement it in SharpDevelop 4.0 in WPF, because we wanted to improve the UI. We have moved the ... [More] commands from one dialog to various menu items, which are available when right-clicking on a variable, method, property or class. 1. Implement Abstract Class Simply click on the name of the class in which you want to implement the abstract class and choose “Implement abstract class” from the refactoring context menu. 2. Implement Interface Just as implementing abstract classes, use the menu item from the refactoring menu. 3. Overriding Single Abstract or Virtual Methods To activate this feature simply type “override” in a class and press the spacebar. Then the code completion window presents a list of available overridable methods and properties to override. 4. Special Case: Override ToString() A special case of override code completion is “override ToString()”. Triggering this code completion item inserts a small smart dialog right into the editor: Select the fields you want to use and press the OK button. The resulting code looks like this: 5. Special Case: Override Equals() and GetHashCode() Another special case of override code completion is “Override Equals() and GetHashCode()”. It can be invoked by selecting either Equals() or GetHashCode() from the code completion list. The inserted dialog looks like this: Add operator overloads adds the overloads for comparison operators. Surround with #region adds #region and #endregion around the generated code. After pressing OK, the result looks like this: 6. Generate Property or Getter Generating properties or getters is easily done by selecting either “Create getter” or “Create property” from the refactoring menu. It will create code like the following: class TestClass{    int myInt;        public int MyInt {        get { return myInt; }    }        string myString;        public string MyString {        get { return myString; }        set { myString = value; }    }} 7. Generate Constructor Using the ctor-Snippet allows you to create a constructor. When executed again, it offers a dialog where you can specify additional options, like adding a range check or a check for null: You can change the order of variables by moving them up and down using the buttons on the right. Pressing OK inserts: public TestClass(int myInt, string myString){    if (myInt < lower || myInt > upper)        throw new ArgumentOutOfRangeException("myInt", myInt, "Value must be between " + lower + " and " + upper);    if (myString == null)        throw new ArgumentNullException("myString");    this.myInt = myInt;    this.myString = myString;} Summary We hope that you will like the way the useful Alt+Ins features work in SharpDevelop 4.0. If you have any questions or ideas, please feel free to write a comment or use the forums. In the next blog post I will explain another new feature: Code Snippets. [Less]
Posted almost 16 years ago by DanielGrunwald
Today I have implemented support for choosing the file encoding when loading and saving files inside SharpDevelop. The option to specify an encoding while opening a file is placed in the "Open With" dialog. In earlier SharpDevelop versions, this ... [More] dialog was available only in the project browser's context menu; in SharpDevelop 4 you can now "open with" any file using the main menu: Inside the "Open With" dialog, pick the entry "Text editor (choose encoding)". After that, SharpDevelop will prompt you to specify the file encoding to use for loading the file. The initial selection of the combo box is the automatically detected encoding that SharpDevelop would normally use. How does encoding auto-detection work? First, SharpDevelop checks whether the file has a byte order mark for UTF-8, UTF-16 or UTF-32. If it has, the encoding is trivially detected. Otherwise, SharpDevelop will parse the file and check whether the file is valid UTF-8. If it is and has some bytes >=128, the file is auto-detected to be UTF-8. The UTF-8 encoding is quite restrictive, so false positives are rare. If the file is invalid UTF-8, or if it is a plain ASCII file (no bytes >=128, which is always also valid UTF-8), then we will avoid reading the file as Unicode. Instead, we pick the encoding specified as default in the SharpDevelop Load/Save options. However if that encoding happens to be a Unicode encoding (it'll be UTF-8 by default), then we pick the current Windows ANSI codepage instead. This is done because we already detected the file to be non-UTF8. This means when loading a plain ASCII file and with the SharpDevelop encoding setting of UTF-8, we will still fall back to the ANSI codepage. The reason for this is simple: SharpDevelop always includes the byte order mark when saving files, and we want to avoid adding one to plain ASCII files. When saving a file, SharpDevelop will always use the encoding that was detected (or specified) when loading the file. Starting with SharpDevelop 4, you can use "File > Save with encoding" to save the file using a different encoding instead. A related feature that already existed in SharpDevelop 3.x is that SharpDevelop will warn you if a text file cannot be saved using the current encoding: In this screen shot, Martin's last name cannot be represented in the file's current encoding. Clicking on "Continue" would replace the 'č' with a 'c'. So let's summarize what the "default file encoding" option in the Load/Save options panel does: It's main job, of course, is to specify the encoding used for new files created with SharpDevelop. As a side role, if you use a non-Unicode encoding for this option, then files that were auto-detected as non-Unicode will be opened using that encoding. [Less]
Posted almost 16 years ago by ChristophWille
This is the start of a series of blog posts describing the Usage Data Collector that is built into SharpDevelop 4.0. UDC as it is called for short is intended to help us better understand what features are being used, how developers found out about ... [More] the feature (menu, toolbar, context menu, et cetera), how much time they spent using the feature, and if there were any issues (exceptions). The intention is to find out which features need to be surfaced differently so more people use them, which the popular features are (and thus should be given a higher priority) and a lot more. Before diving into the topic of this blog post, one important piece of architecture information: UDC is not tied to SharpDevelop. We developed it to be reuseable in your applications. Including (a yet to be developed) analysis Web frontend. That's also why we intend to give you a good background on what we collect, how we collect it, how it is transferred - so you have a good understanding whether it is suitable for your userbase. On its new start page, SharpDevelop 4.0 asks you to participate in the customer experience improvement program: If a user wants to participate and clicks the "Save" button, we do send the initial usage data message - for two reasons: first, depending on firewall settings, the user might need to allow SharpDevelop to communicate with the Internet. Doing it right now and there allows the user to see why SharpDevelop wants Internet access. Secondly, we gather Session "0" - information about the version of SharpDevelop, and on top of what platform it is running. In terms of actual data, this is a sample UDC signup message (line 1 has been truncated for xmlns elements): 1: <UsageDataMessage ...> 2: <Sessions> 3: <UsageDataSession> 4: <EndTime i:nil="true" /> 5: <EnvironmentProperties> 6: <UsageDataEnvironmentProperty> 7: <Name>platform</Name> 8: <Value>Win32NT</Value> 9: </UsageDataEnvironmentProperty> 10: <UsageDataEnvironmentProperty> 11: <Name>osVersion</Name> 12: <Value>5.1.2600.196608</Value> 13: </UsageDataEnvironmentProperty> 14: <UsageDataEnvironmentProperty> 15: <Name>processorCount</Name> 16: <Value>1</Value> 17: </UsageDataEnvironmentProperty> 18: <UsageDataEnvironmentProperty> 19: <Name>dotnetRuntime</Name> 20: <Value>4.0.30128.1</Value> 21: </UsageDataEnvironmentProperty> 22: <UsageDataEnvironmentProperty> 23: <Name>appVersion</Name> 24: <Value>4.0.0.5623</Value> 25: </UsageDataEnvironmentProperty> 26: <UsageDataEnvironmentProperty> 27: <Name>language</Name> 28: <Value>es</Value> 29: </UsageDataEnvironmentProperty> 30: <UsageDataEnvironmentProperty> 31: <Name>culture</Name> 32: <Value>es-ES</Value> 33: </UsageDataEnvironmentProperty> 34: <UsageDataEnvironmentProperty> 35: <Name>userAddInCount</Name> 36: <Value>0</Value> 37: </UsageDataEnvironmentProperty> 38: <UsageDataEnvironmentProperty> 39: <Name>architecture</Name> 40: <Value>x86</Value> 41: </UsageDataEnvironmentProperty> 42: </EnvironmentProperties> 43: <Exceptions /> 44: <FeatureUses /> 45: <SessionID>0</SessionID> 46: <StartTime>2010-03-18T12:01:38.5625Z</StartTime> 47: </UsageDataSession> 48: </Sessions> 49: <UserID>cb02e999-4e80-45d2-9773-ed3d80b3937f</UserID> 50: </UsageDataMessage> Please note line #49: each client machine creates a GUID for itself. This GUID is used to map all sessions to a single user - so we can tell whether a single developer is using a feature heavily compared to say a hundred developers using the very same feature lightly. As you can see, the initial message is very small. Once data is being gathered, the messages do increase in size, and contain more information (feature use, exceptions). We will look into those message in future blog posts, as well as how those messages are processed and analyzed. [Less]
Posted almost 16 years ago by MattWard
Here is a walkthrough on how to compile Python packages and modules, such as those provided by the Python Standard Library, so you can distribute your IronPython application as a set of standalone assemblies. If you just want ... [More] to use the Python Standard Library without compiling parts of it into your application then you can add the path to the standard library as described in a previous post on using the Python Standard Library. Prerequisites You will need to have SharpDevelop 3.2 and Python 2.6 installed on your machine. These can be downloaded from the following locations. SharpDevelop 3.2 Python 2.6 Python Modules Included with IronPython Before you start compiling a Python module or package into your application you should check whether it is already included with IronPython or whether you can use the .NET framework instead. A lot of the Python Standard Library modules are already included with IronPython. You can see which ones by using Reflector to look at IronPython.dll and IronPython.Modules.dll. Open these assemblies in Reflector, right click and select Disassemble. In the screenshot below the modules that are included with IronPython are defined by the PythonModule attribute. Alternatively you can use the IronPython Modules Reader application to list all the available modules in IronPython. If you need to use one of the modules provided by IronPython then add a reference to IronPython and IronPython.Modules in your project and then import the module in the normal way: import cmath Compiling a Python Module Now we will look at writing a simple IronPython application that reads in a zip file using the zipfile module from the Python standard library. Our application will read the names of all the files in the zip file and display them in the console window. The code is shown below. import zipfile file = zipfile.ZipFile("test.zip", "r") for name in file.namelist(): print name Now if you create a python console project with SharpDevelop, copy the code above into the Program.py file, compile and run the program you will get an error saying "No module called zipfile". To fix this problem you can add the zipfile.py file from the Python standard library directly into your project. Simply right click your project, select Add Existing Item and browse to the zipfile in the python libs folder (e.g. C:\Python26\lib). If you compile your program again and run it you will get an error about a different module. The zipfile module depends on 13 other modules from the standard library. With a bit of trial and error you can work out which modules are needed. After adding these dependent modules to your project you will have a set of assemblies that do not require the Python Standard library to be installed. The full code for the zip file reader application can be downloaded from the Zip File Reader link at the end of this post. Compiling a Python Package A Python module consists of a single file (e.g. zipfile.py). A Python package is a set of files inside a subdirectory. Compiling a package into your application cannot be done simply by including the files directly in your project. Instead you must compile the package files into a separate class library assembly. As an example we will look at using the json package. We will create a simple application that creates a json string from a dictionary. The code is shown below. import json address = {} address["street"] = "24 22nd Street" address["city"] = "New York" address["state"] = "NY" address["postCode"] = "10021" person = {} person["firstName"] = "John" person["lastName"] = "Smith" person["age"] = 20 person["address"] = address print json.dumps(person) Now to use the json package from our application we need to create a python class library project. Then we need to add all the files from the json package into this project and compile it. Finally in our Json Writer project we need to add a reference to this class library. The screenshot below shows the contents of the two projects. Now this is not quite enough since the json package depends on several modules in the standard library. So now we add these to the json class library project. After adding these modules the json class library project should then contain the files as shown in the screenshot below. You should now be able to compile and run your Json Writer application. The Json Writer application can now be distributed as a set of assemblies without needing the Python Standard Library to be installed. The full code for the Json Writer application can be downloaded from the Json Writer link at the end of this post. Finally here is a link to the license FAQ for Python and Python Standard Library that should be checked before you include the standard library in your application. Downloads SharpDevelop 3.2 Python 2.6 Reflector IronPython Modules Reader Zip File Reader Json Writer [Less]
Posted almost 16 years ago by MattWard
The latest releases of SharpDevelop 3.2 and 4.0 (versions 5611 and above) now include IronRuby 1.0 RC3 which was released yesterday. The IronRuby console (ir.exe) command line option to use Ruby 1.9 mode has changed in ... [More] this release from -19 to -1.9 so if you have an IronRuby project (.rbproj) created with a previous version of SharpDevelop you will need to change the command line used when debugging your application. To do this from the Project menu select Project Options and then update the Start Options Command Line, for example: -1.9 -D Program.rb [Less]
Posted almost 16 years ago by MattWard
SharpDevelopIronPythonIronRuby SharpDevelop 2.2.1 IronPython 1.1* n/a SharpDevelop 3.0 IronPython 2.0 n/a SharpDevelop 3.1 IronPython 2.0.2 IronRuby 0.9.1* SharpDevelop 3.1.1 IronPython 2.6 IronRuby 0.9.1* ... [More] SharpDevelop 3.2 IronPython 2.6.1 RC1 IronRuby 1.0 RC2 SharpDevelop 4.0 (.NET 4.0 RC1) IronPython 2.6.1 RC1 (.NET 4.0 RC1) IronRuby 1.0 RC 2 (.NET 4.0 RC1) * - Available as a separate addin not shipped with SharpDevelop. [Less]
Posted almost 16 years ago by MattWard
This tutorial shows you how to debug an ASP.NET application with SharpDevelop. Before we begin it should be noted that SharpDevelop does not have great ASP.NET support. There is no web forms designer, no intellisense for ASP.NET ... [More] pages (.aspx) and no support for the new style ASP.NET Web Site projects introduced in Visual Studio 2005. You can however create an ASP.NET Web Application project or an ASP.NET Web Service in SharpDevelop. If you are looking for a better ASP.NET experience then you should use Microsoft Visual Web Developer. However if still want to use SharpDevelop then here is how to debug your ASP.NET application. Creating an ASP.NET Application First let us create an ASP.NET Web Application. From the File menu select New, then Solution, to open up the New Project dialog. On the left hand side of this dialog select ASP.NET category underneath the C# category. On the right hand side select the ASP.NET web page project icon. Give project a name and choose where you want the project created and click the Create button. SharpDevelop will then create a basic ASP.NET Web Application project. Download Cassini In order to be able to debug the ASP.NET application we will be using Cassini. Cassini is a lightweight open source web server. It was originally released as a sample by Microsoft. Dmitry Robsman then updated the sample to run under .NET 3.5. After that different versions based on Dmitry's original work were released on codeplex. Any of these versions of Cassini, in the list below, will work with SharpDevelop. The version of Cassini provided by Dmitry requires you to compile the source code. The other versions do not. The Cassini Developer's edition has slightly different command line options compared to the rest so it will not be covered in the following discussion. We will use Cassini++ for the rest of this tutorial. Cassini++ Dmitry Robsman - Cassini v3.5 or Cassini v3.5.0.2 with friendly url/routing support. Cassini 3.5 Developers Edition Download Cassini++ from the link provided and extract the files to a directory on the same machine that you are running SharpDevelop on. Debugging an ASP.NET Application First let us set a breakpoint in our application. Find the Default.aspx.cs file in your project and open it in the text editor. Locate the Page_Load method and set a breakpoint inside this method on the Response.Write line. Now you need to configure the project to run Cassini when you debug your application. From the Project menu select Project Options. In the options dialog select the Debug tab. Set the Start Action to Start external program and enter the path to the Cassini executable. In the Start Options enter the command line that will be passed to Cassini. The Cassini command line is of the form: <physical-path> <port> <virtual-path> In the screenshot below you can see an example command line passed to Cassini. In this case Cassini will listen for requests on port 8080, the virtual path will be set to "/" and the physical path to your project is specified by a using SharpDevelop property ${ProjectDir} which will be replaced when you start debugging. You can put the full path to your project directory here instead of using the ProjectDir property. Save the changes you made to the project options. Then select Run from the Debug menu. Cassini should then start. Click the http://localhost:8080/ hyperlink at the bottom of the Cassini window to visit your application's web page in the default browser. When the page is loaded in the browser the breakpoint in Page_Load should then be hit and you can start debugging. Attach to Process As an alternative to configuring SharpDevelop to start Cassini every time you debug your ASP.NET application you can leave Cassini running and attach to its process when you need to. First on your desktop create a shortcut to Cassini and specify the appropriate Cassini command line as explained earlier. Note that the ${ProjectDir} property cannot be used here so instead you will need to put the full path to your project. Start Cassini by double clicking the shortcut and use a browser to display your web page. Now in SharpDevelop select Attach to Process from the Debug menu. Select the Cassini process and click the Attach button. Now when you press Ctrl+F5 in the browser showing your web page to refresh the page the breakpoint in the Page_Load method should be hit and you can start debugging. [Less]