Solved

C# to vb.net

Posted on 2012-03-23
5
609 Views
Last Modified: 2012-04-02
Could somebody translate this to vb.net..

 Action action1 = () =>  this.BeginStoryboard((Storyboard)this.FindResource("BlinkStoryboardFedListBox"));
                Dispatcher.BeginInvoke(action1);
                Action action = () => CustomPaging((int)PagingMode.Next);
                Dispatcher.BeginInvoke(action);
                _timernextitem.Start();


 Action action1 = () => this.BeginStoryboard((Storyboard)this.FindResource("BlinkStoryboardSecondImageFed"));
            Dispatcher.BeginInvoke(action1);
            Action action = () => BindToSecondImages(lstimgpath);
            Dispatcher.BeginInvoke(action);
            _timerforsecimg.Start();
0
Comment
Question by:jamppi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 37758117
Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardFedListBox"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() CustomPaging(CInt(PagingMode.[Next]))
Dispatcher.BeginInvoke(action)
_timernextitem.Start()


Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardSecondImageFed"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Open in new window


http://www.developerfusion.com/tools/convert/csharp-to-vb/
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37758118
Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardFedListBox"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() CustomPaging(CInt(PagingMode.[Next]))
Dispatcher.BeginInvoke(action)
_timernextitem.Start()


Dim action1 As Action = Function() Me.BeginStoryboard(DirectCast(Me.FindResource("BlinkStoryboardSecondImageFed"), Storyboard))
Dispatcher.BeginInvoke(action1)
Dim action As Action = Function() BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Open in new window


http://converter.telerik.com/
0
 

Author Comment

by:jamppi
ID: 37758175
tried that but i get,   'Expression does not produce a Value'
0
 
LVL 28

Expert Comment

by:sammySeltzer
ID: 37758385
I *think* but not sure you can do each of them like this:

Public Function() 
Dim action As Action  
BindToSecondImages(lstimgpath)
Dispatcher.BeginInvoke(action)
_timerforsecimg.Start()

Return action 
End Function

Open in new window

0
 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 250 total points
ID: 37758521
Use the keyword Sub instead of Function in the above solutions. Action corresponds to a function with a void return. The VB equivalent of a function that returns void is a Sub.
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
reading excel file in .net 2 31
How can I do Unit Testing with Session ? 1 23
how to check mis-spellings in a select SQL 2 38
Selenium and Xpath 4 30
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question