Quantcast
Channel: SharpDevelop Community
Viewing all 1764 articles
Browse latest View live

.net F 3.5 in .net CF 3.5 umwandeln

$
0
0

Hallo liebe Forumgemeinde.

Seit zwei Tagen durchforste ich nun das WWW nach einer brauchbaren, möglichst detailirten Tutorial wie man mit Sharpdevelop unter VB.Net für das compact framework 3.5 eine Anwendung auf die Beine stellt und habe nichts ernsthaft brauchbares gefunden.

Ich habe das Programm das ich schreiben möchte bereits in VS2008 Express umgesetzt dann aber festgestellt das hier das CF 3.5 nicht dabei ist.
Also ein neuer Versuch mit Sharpdevelop denn für dieses einem mal wo ich das benötige (danach nie wieder) werd ich kein VS2008 Pro kaufen.

Es tauchen nun massig fehler in meinem Programm auf und auch hier habe ich wieder nichts brauchbares gefunden das von 0 an erläutert was ich machen muss um meine version auf CF 3.5 zu bringen und das Programm anschließend auf den Scanner (den ich programmieren möchte) bekomme.
Mein Programm ist unter VB ein Witz.
Scanner scannt einen Barcode, zeigt diesen in txtart an setzt dann automatisch den fokus auf txtmen, die Menge wird händisch eingetragen und ein druck auf Enter speichert das Ganze in der Datei art.txt ( z.b. 12548;15) fokus wieder in txtart alle variablen löschen das ganze wieder von vorn immer Zeile für Zeile in art.txt.

in vb schaut mein code so aus:
Imports System.IO
Public Class Scanits

Dim art As String
Dim menge As String
Dim zeile As String
Public Sub txtart_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtart.KeyPress
If e.KeyChar = Chr(13) Then
art = txtart.Text
txtmen.Focus()
End If
End Sub
Private Sub txtmen_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtmen.KeyPress
Dim dat As System.IO.StreamWriter
dat = New StreamWriter("c:\art.txt", True)
If e.KeyChar = Chr(13) Then
menge = txtmen.Text
zeile = art + ";" + menge
vbNewLine.ToString()
dat.WriteLine(zeile)
lbllastart.Text = art
lbllastmen.Text = menge
art = ("")
menge = (art)
zeile = (art)
txtart.Text = (art)
txtmen.Text = (art)
txtart.Focus()
End If
dat.Close()
dat = Nothing
End Sub

Tut was es soll und ist ganz einfach. Nun zerbreche ich an der Aufgabe dem Honeywell ScanPal 5100 dem ich für meinen Test geliehen bekommen habe das auch in CF 3.5 bei zu bringen geschweige denn das auf den Scanner überhaupt rauf zu bringen.

Kann mir dabei jemand helfen?


SharpZipLib and .Net 4.5

$
0
0

 

Any plans for a SharpZipLib release for .Net 4.5?  I see the download lists versions for .Net 1,1. 2.0, 3.5 and 4.0...

Binary AvalonEdit.4.3.1.9430.nupkg - .Net 3.5 - Not Working

$
0
0

I have tried using the 3.5 version of the binary but the AvalonEdit.Sample totally fails to run displaying the message AvalonEdit.Sample has stopped working. The problem appears to be with the DropDownButton.cs class as it is missing the public access modifier. I assume that the class is mean't to be public. Anyway making the change in source code and re-compiling for .Net 3.5 fixes the problem for my requirements  but I thought I should advise you in case anyone else has the same problem with this version of the download from Nuget.

Regards pianoboy

 

 

Find/Replace interface for Avalon edit

$
0
0

Just wondering if there was any plans to add a find/replace interface to the AvalonEdit control?

If not, what is the best way to search for text using regular expressions (specifically, .Net Regex class)?

Crash when entering items in the menuStrip

$
0
0

The following message (crash report) occurs when I add a menustrip to my Windows Form and enter some text in the menu item (where it says 'Type Here') and press Enter.

SharpDevelop Version : 4.3.3.9663-463ee024
.NET Version         : 4.0.30319.18051
OS Version           : Microsoft Windows NT 6.2.9200.0
Current culture      : English (United States) (en-US)
Running under WOW6432, processor architecture: x86-64
Working Set Memory   : 277612kb
GC Heap Memory       : 92375kb

Exception thrown:
System.ArgumentException: Win32 handle passed to Cursor is not valid or is the wrong type.
   at System.Windows.Forms.Cursor..ctor(IntPtr handle)
   at System.Windows.Forms.Design.Behavior.BehaviorService.SetAppropriateCursor(Cursor cursor)
   at System.Windows.Forms.Design.Behavior.BehaviorService.PropagateHitTest(Point pt)
   at System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

---- Recent log messages:
10:52:47.506 [1] DEBUG - Forms designer: Component added/removed/renamed, Loading=False, Unloading=False
10:52:47.568 [1] DEBUG - ActiveContentChanged to ICSharpCode.FormsDesigner.FormsDesignerViewContent
10:52:48.720 [1] DEBUG - Forms designer: Initializing nested service container of toolStripMenuItem1 [System.Windows.Forms.ToolStripMenuItem] using Reflection
10:52:48.725 [1] DEBUG - Forms designer: Component added/removed/renamed, Loading=False, Unloading=False
10:52:48.726 [1] DEBUG - Forms designer: ComponentChanged: File, Member=DropDownItems, OldValue=<null>, NewValue=<null>; Loading=False; Unloading=False
10:52:53.282 [1] ERROR - ThreadException caught
--> Exception:
System.ArgumentException: Win32 handle passed to Cursor is not valid or is the wrong type.
   at System.Windows.Forms.Cursor..ctor(IntPtr handle)
   at System.Windows.Forms.Design.Behavior.BehaviorService.SetAppropriateCursor(Cursor cursor)
   at System.Windows.Forms.Design.Behavior.BehaviorService.PropagateHitTest(Point pt)
   at System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
10:53:08.406 [1] DEBUG - Forms designer: Initializing nested service container of exitToolStripMenuItem [System.Windows.Forms.ToolStripMenuItem] using Reflection
10:53:08.411 [1] DEBUG - Forms designer: Component added/removed/renamed, Loading=False, Unloading=False
10:53:08.413 [1] DEBUG - Forms designer: ComponentChanged: File, Member=DropDownItems, OldValue=<null>, NewValue=<null>; Loading=False; Unloading=False
10:53:08.413 [1] DEBUG - Forms designer: ComponentChanged: Exit, Member=Text, OldValue=, NewValue=Exit; Loading=False; Unloading=False
10:53:08.421 [1] DEBUG - Forms designer: Component added/removed/renamed, Loading=False, Unloading=False
10:53:08.421 [1] DEBUG - Forms designer: ComponentChanged: File, Member=DropDownItems, OldValue=<null>, NewValue=<null>; Loading=False; Unloading=False
10:54:27.110 [1] DEBUG - Forms designer: Initializing nested service container of toolStripMenuItem1 [System.Windows.Forms.ToolStripMenuItem] using Reflection
10:54:27.115 [1] DEBUG - Forms designer: Component added/removed/renamed, Loading=False, Unloading=False
10:54:27.116 [1] DEBUG - Forms designer: ComponentChanged: File, Member=DropDownItems, OldValue=<null>, NewValue=<null>; Loading=False; Unloading=False
10:54:28.788 [1] DEBUG - Forms designer: Initializing nested service container of testToolStripMenuItem [System.Windows.Forms.ToolStripMenuItem] using Reflection
10:54:28.793 [1] DEBUG - Forms designer: Component added/removed/renamed, Loading=False, Unloading=False
10:54:28.795 [1] DEBUG - Forms designer: ComponentChanged: File, Member=DropDownItems, OldValue=<null>, NewValue=<null>; Loading=False; Unloading=False
10:54:28.795 [1] DEBUG - Forms designer: ComponentChanged: test, Member=Text, OldValue=, NewValue=test; Loading=False; Unloading=False
10:54:28.802 [1] DEBUG - Forms designer: Component added/removed/renamed, Loading=False, Unloading=False
10:54:28.802 [1] DEBUG - Forms designer: ComponentChanged: File, Member=DropDownItems, OldValue=<null>, NewValue=<null>; Loading=False; Unloading=False
10:54:30.439 [1] DEBUG - Forms designer: Initializing nested service container of toolStripMenuItem1 [System.Windows.Forms.ToolStripMenuItem] using Reflection
10:54:30.443 [1] DEBUG - Forms designer: Component added/removed/renamed, Loading=False, Unloading=False
10:54:30.444 [1] DEBUG - Forms designer: ComponentChanged: contextMenuStrip1 [System.Windows.Forms.ContextMenuStrip], Name: contextMenuStrip1, Items: 3, Member=Items, OldValue=<null>, NewValue=<null>; Loading=False; Unloading=False
10:54:31.840 [1] ERROR - ThreadException caught
--> Exception:
System.ArgumentException: Win32 handle passed to Cursor is not valid or is the wrong type.
   at System.Windows.Forms.Cursor..ctor(IntPtr handle)
   at System.Windows.Forms.Design.Behavior.BehaviorService.SetAppropriateCursor(Cursor cursor)
   at System.Windows.Forms.Design.Behavior.BehaviorService.PropagateHitTest(Point pt)
   at System.Windows.Forms.Design.Behavior.BehaviorService.AdornerWindow.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

---- Post-error application state information:
Installed 3rd party AddIns: [KeyShortcutEditorAddin 0.0.0.0, Enabled=False, Action=Install], [RemoveUnusedRef 1.0.0, Enabled=False, Action=Install], [ThemeTool 0.0.0.0, Enabled=False, Action=Install]
Workbench.ActiveContent: ICSharpCode.FormsDesigner.FormsDesignerViewContent
ProjectService.OpenSolution: [Solution: FileName=c:\Users\Maurits\Documents\SharpDevelop\Projects\Beg C# Obj Oriented Prog\Activity7_3\Beginning CSharp.sln, HasProjects=True, ReadOnly=False]
ProjectService.CurrentProject: [CSharpProject: Activity8_1]

 

Switch panels when switching views

$
0
0

I would like SharpDevelop to switch my Projects/Tools panel to Tools when I am switching my editor from the Source view to the Design View. So always when I am in Design mode, I want the tools panel be visible.

 

Undo creation of event handlers

$
0
0

When I double click a component in the Design view, a click event is registered and an event handler is automatically generated. This is great when you want that, but if you double clicked the component by accident, it is a lot of work to undo the creation of the event handler. I would like to be able to undo all that (registering the event to the handler and the generation of the handler function itself) with one undo action (CTRL+Z or by clicking Edit=>Undo in the menu).

 

Design view disabled when creating new Windows Form Project

$
0
0

When you start a new project by adding a new Windows Form project to your solution, the MainForm.cs file will be opened, but you cannot choose between Design and Source viewmode. When you remove this file and add a Form yourself, or even when you close it and open it again, both the Design and the Source views are available. This should be available from the start.

 


Incorporate charts such as pie & line charts

$
0
0

Hi,

I would like to know if I can create line pie and line charts using sharpdeveloper. Or is this a function that will come later.

example of what I want to try and do.

There is a chart tool where you can add your values and plot in various styles

Here's a simple example of creating a line graph with a single series containing 3 data points.

Drag a chart to your form and add this code

01PrivateSubForm1_Load(ByValsender AsSystem.Object, ByVale AsSystem.EventArgs) HandlesMyBase.Load
02     Chart1.Series.Clear()
03     Chart1.Titles.Add("Demo")
04     'Create a new series and add data points to it.
05     Dims AsNewSeries
06     s.Name = "aline"
07     'Change to a line graph.
08     s.ChartType = SeriesChartType.Line
09     s.Points.AddXY("1990", 27)
10     s.Points.AddXY("1991", 15)
11     s.Points.AddXY("1992", 17)
12     'Add the series to the Chart1 control.
13     Chart1.Series.Add(s)
14 EndSub

You will need to add Imports System.Windows.Forms.DataVisualization.Charting

Of course you would have to iterate through your data and add points based on your information.

SharpZipLib issue while adding reference Windows Phone

$
0
0

I am trying to add dll of SharpZipLib to my Windows Phone 8 project. It gives me following error while adding

a reference to a higher version or incompatible assembly cannot be added to the project

Here is a screen shot

Error

 

Can some one please help me ? How can I solve this issue?

AvalonEdit autocompletion didnt work as expected

$
0
0

i have a strange effect in the avalonedit control. i use the following code to add the common .net assemblies(mscorlib, System and so on) and an external library(NetOffice)

IProjectContent result = _contentRegistry.GetProjectContentForReference(assemblyName, assemblyLocation);
_projectContent.ReferencedContents.Add(result);

now use the control at runtime and type the follwing code in a class method(syntax is okay for the whole textfile)

NetOffice.ExcelApi.Application app = new NetOffice.ExcelApi.Application();
int i = app.Caller.GetHashCode();

the Caller property is System.Object but didnt see the intellisense here(the 4 wellknown mehthods). all other completion things works fine! i do something wrong or may the reason is because NetOffice is bit a strange in class definitions. this is -a part- of the NetOffice.ExcelApi.Application definition:

public class Appication : Application
{
  //..
}

public class _Application : _Application_
{
    public object Caller { get;}
}

public class _Application_ : COMObject
{
    public object Caller(object index);
    public object get_Caller(object index); 
}

is it possible this strange definition cause problems or i do something wrong?

*thanks for clearification
Sebastian

Code Template Location in 4.1?

$
0
0

Where are code template definitions stored? (Not the data\templates new-file oriented ones, I mean the keyboard shortcuts listed in "Tools|Options|Coding|Code Templates").

I'd like to be able to...

1. preserve them across SD updates - it gets very tiresome re-creating them every time an otherwise welcome improvement appears

2. edit them more easily than through the rather difficult and obscure interface - does a text file (XML or other) exist?

3. selectively load groups of templates via something other than file extension (I have shortcuts that I'd like to select based on some criteria other than language)

4. understand what "Keyboard Mapping" really means and how its relationship with "Template" works. For example, it's not clear (to my feeble brain) why "if" and "ifelse" both have keyboard mapping of "if". Or what "event" means...

 

Where is the Forms Designer tab?

$
0
0

Dear all,

I am trying to use the SharpDevelop. I have read that when editing a form file (.cs) one can switch to the Forms Designer by clicking a tab at the bottom of the code window. One example is shown in this page:

http://community.sharpdevelop.net/blogs/mattward/articles/FeatureTourVisuallyDesigningForms.aspx

However, I can never find such a tab when I view a default .cs file after creating a simple ASP.net webpage project -- there is no tab at all below the code window, no matter the default, plain or debug layout is being used. I am using version 4.3.3.9663-463ee024. Is the Forms Designer still there? If yes, how can I invoke it?

Thanks in advance.

Pengi.

Error on new project creation with subversion 1.83

$
0
0

Hye dear SharpDevelop Team !

 

An error has occured when I create a new project with subversion 1.83 installed on my win7 x64 ...

 

The project has weel been created but SharpDevelop have crashed just after open the first class (MyClass.cs with library project).. No trace of the new project in the solution tree 

This is due to an error of subversion, I think. 

When i (re) open the solution, the new project appears

one bug

$
0
0

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using System.Xml.Serialization;

         public static void ReadOpenLog()
        {
            if (File.Exists("OpenLog.xml"))
            {
                using (StreamReader reader = new StreamReader("OpenLog.xml"))
                {
                    try {
                        XmlSerializer xs = new XmlSerializer(typeof(List<string>));//Bug,use VS2012 this is ok.
                        HistoryFiles = xs.Deserialize(reader) as List<string>;
                    } catch (Exception ex) {
                        MessageBox.Show(ex.Message);
                        throw;
                    }

                }
            }
        }


one bug

$
0
0

SharpDevelop Version : 5.0.0.3420-alpha-4322d540

.NET Version         : 4.0.30319.18052

OS Version           : Microsoft Windows NT 6.1.7601 Service Pack 1

Current culture      : Chinese (Simplified, PRC) (zh-CN)

Running under WOW6432, processor architecture: x86-64

Working Set Memory   : 204012kb

GC Heap Memory       : 54152kb

 

Exception thrown:

System.ArgumentException: The assembly was not from the debugger type system

   at Debugger.TypeSystemExtensions.GetReferences(Module module)

   at ICSharpCode.SharpDevelop.Gui.Pads.DebuggerModuleModel.CreateAssemblyModel(Module module)

   at ICSharpCode.SharpDevelop.Gui.Pads.DebuggerModuleModel..ctor(Module module)

   at ICSharpCode.SharpDevelop.Gui.Pads.DebuggerProcessAssemblyList.ModuleLoaded(Object sender, ModuleEventArgs e)

   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)

   at Debugger.Process.OnModuleLoaded(Module module)

   at Debugger.ManagedCallback.LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule)

   at Debugger.ManagedCallbackSwitch.LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule)

   at Debugger.ManagedCallbackProxy.<>c__DisplayClass1c.<LoadModule>b__1b()

   at Debugger.MTA2STA.<>c__DisplayClass4.<EnqueueCall>b__1()

   at Debugger.MTA2STA.PerformCall()

   at Debugger.MTA2STA.PerformAllCalls()

   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)

   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)

   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

 

---- Recent log messages:

21:18:23.562 [31] DEBUG - Received command ReportEvent

21:18:23.563 [31] DEBUG - Received command ReportEvent

21:18:23.564 [31] DEBUG - Received command ReportEvent

21:18:23.572 [31] DEBUG - Received command ReportEvent

21:18:23.572 [31] DEBUG - Received command ReportEvent

21:18:23.573 [31] DEBUG - Received command BuildDone

21:18:23.573 [31] INFO - Finished building OYits.Designer, success=True

21:18:23.573 [31] INFO - Start building 

21:18:23.573 [5] INFO - Finished building , success=True

21:18:23.574 [1] INFO - Debugger Command: Start (withDebugger=True)

21:18:23.574 [1] INFO - Loading addin Debugger

21:18:23.619 [1] INFO - Loading addin ILSpyAddIn

21:18:23.645 [1] DEBUG - Service startup: ICSharpCode.SharpDevelop.Editor.Bookmarks.IBookmarkManager

21:18:23.650 [1] INFO - Saving layout file: C:\Users\LinZhiJun\AppData\Roaming\ICSharpCode\SharpDevelop5\layouts\Default.xml

21:18:23.654 [1] INFO - Loading layout file: C:\Program Files (x86)\SharpDevelop\5.0\data\layouts\Debug.xml, hideAllLostPads=False

21:18:23.707 [1] DEBUG - ChooseLayoutCommand.LayoutChanged(object,EventArgs)

21:18:23.707 [1] DEBUG - ChooseLayoutCommand.Run()

21:18:23.708 [1] INFO - Saving layout file: C:\Users\LinZhiJun\AppData\Roaming\ICSharpCode\SharpDevelop5\layouts\Debug.xml

21:18:23.858 [1] DEBUG - Service startup: ICSharpCode.SharpDevelop.Dom.ClassBrowser.IClassBrowser

21:18:23.858 [1] DEBUG - Creating pad ICSharpCode.SharpDevelop.Dom.ClassBrowser.ClassBrowserPad...

21:18:23.874 [1] DEBUG - Service startup: ICSharpCode.SharpDevelop.Dom.IModelFactory

21:18:23.883 [1] DEBUG - Service startup: ICSharpCode.SharpDevelop.Dom.ITreeNodeFactory

21:18:23.893 [1] DEBUG - ActiveContentChanged to 

21:18:23.938 [1] DEBUG - Creating pad ICSharpCode.SharpDevelop.Gui.Pads.CallStackPad...

21:18:27.143 [1] ERROR - ThreadException caught

--> Exception:

System.ArgumentException: The assembly was not from the debugger type system

   at Debugger.TypeSystemExtensions.GetReferences(Module module)

   at ICSharpCode.SharpDevelop.Gui.Pads.DebuggerModuleModel.CreateAssemblyModel(Module module)

   at ICSharpCode.SharpDevelop.Gui.Pads.DebuggerModuleModel..ctor(Module module)

   at ICSharpCode.SharpDevelop.Gui.Pads.DebuggerProcessAssemblyList.ModuleLoaded(Object sender, ModuleEventArgs e)

   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)

   at Debugger.Process.OnModuleLoaded(Module module)

   at Debugger.ManagedCallback.LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule)

   at Debugger.ManagedCallbackSwitch.LoadModule(ICorDebugAppDomain pAppDomain, ICorDebugModule pModule)

   at Debugger.ManagedCallbackProxy.<>c__DisplayClass1c.<LoadModule>b__1b()

   at Debugger.MTA2STA.<>c__DisplayClass4.<EnqueueCall>b__1()

   at Debugger.MTA2STA.PerformCall()

   at Debugger.MTA2STA.PerformAllCalls()

   at System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)

   at System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)

   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)

   at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

 

---- Post-error application state information:

Installed 3rd party AddIns: 

ProjectService.CurrentSolution: [Solution F:\项目\OYits.Designer\OYits.Designer.sln with 9 projects]

ProjectService.CurrentProject: [CSharpProject: OYits.Designer]

Workbench.ActiveContent: <null>

Incorrect conversion of empty arrays (VB.NET to C#)

$
0
0

The following VB-code

Public Class SomeClass
    
    Public Function ReturnArray As Int32()
        Return New Int32() {}
    End Function
    
End Class

is converted into the following (not compilable) C# code:

public class SomeClass {

    public Int32[ ReturnArray() {
        return new Int32[];
    }

}

Expected result (preferred):

public class SomeClass {

    public Int32[ ReturnArray() {
        return new Int32[] {};
    }

}

or alternatively (a bit less preferred because of change of style):

public class SomeClass {

    public Int32[ ReturnArray() {
        return new Int32[0];
    }

}

Best regards, C.

Double-parenthesis when converting from VB.Net to C#

$
0
0

Hello SharpDeveloper

I'm nearly too shy to post it, but although it is such a minor issue it gives me a lot of manual work:

Coming from a Java-background, I like to write VB code that includes parenthesis around an "if" clause or another statement where Java/C# requires parenthesis. When I now convert such VB code into C#, the parenthesis are doubled which is quite a bit tautologous, e.g. the following VB code:

 Public Sub SomeMethod(aValue As Int32)
  If (aValue < 10) Then
   DoSomething()
  End If
 End Sub

is converted into:

  public void SomeMethod(Int32 aValue)
  {
   if ((aValue < 10)) {
    DoSomething();
   }
  }

expected result:

  public void SomeMethod(Int32 aValue)
  {
   if (aValue < 10) {
    DoSomething();
   }
  }

Watch out when addressing this issue, the following conversion of course still needs double-parenthesis:

 Public Sub SomeMethod(aValue As Int32)
  If (aValue > 3) AndAlso (aValue < 10) Then
   DoSomething()
  End If
 End Sub

Does now and always must result in:

public void SomeMethod(Int32 aValue)
  {
   if ((aValue > 3) && (aValue < 10)) {
    DoSomething();
   }
  }

Best regards
C.

using resx files

$
0
0

Hello,

 

i tried to add a image as a ressource to my project.

For that i double click the *.resx file and end up where i can add a ressource.

I did this and add my image here.

But after i changed somethin and compiled the project again the ressource i added are no longer

listed in the editor ( double click on the resx file )

 

What did i wrong here?

Thanks

Matthias

Design View Unavailable

$
0
0

So apparently this didnt actually post when I hit "post"

I'm getting the following text when I try to view my form in the Design tab:

 

Failed to load designer. Check the source code for syntax errors and check if all references are available.

ICSharpCode.FormsDesigner.FormsDesignerLoadException: System.ComponentModel.Design.Serialization.CodeDomSerializerException: The variable 'GlobalVariables' is either undeclared or was never assigned.
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyReferenceExpression(IDesignerSerializationManager manager, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)

System.ComponentModel.Design.Serialization.CodeDomSerializerException: The variable 'GlobalVariables' is either undeclared or was never assigned.
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.Error(IDesignerSerializationManager manager, String exceptionText, String helpLink)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyReferenceExpression(IDesignerSerializationManager manager, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(IDesignerSerializationManager manager, String name, CodeExpression expression)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializePropertyAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement, CodePropertyReferenceExpression propertyReferenceEx, Boolean reportError)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeAssignStatement(IDesignerSerializationManager manager, CodeAssignStatement statement)
   at System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeStatement(IDesignerSerializationManager manager, CodeStatement statement)


   at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadDesigner()
   at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadAndDisplayDesigner()
   at ICSharpCode.FormsDesigner.FormsDesignerViewContent.LoadInternal(OpenedFile file, Stream stream)
   at ICSharpCode.SharpDevelop.Gui.AbstractViewContentHandlingLoadErrors.Load(OpenedFile file, Stream stream)

 

Any insight into what is causing this would be much appreciated.

Viewing all 1764 articles
Browse latest View live