tag:feedback.developerfusion.com,2008-02-07:/forums/5477-code-converterCode Converter on UserVoice2012-02-02T14:29:44-08:00tag:feedback.developerfusion.com,2008-02-07:Event/106742032012-02-02T14:29:44-08:002012-02-02T14:29:44-08:00Dim b(b1.Length + b2.Length - 3) As Byte<p>Mark suggested:<br />VB
Dim b(b1.Length + b2.Length - 3) As Byte
Converted C#
byte[] b = new byte[b1.Length + b2.Length - 2];
Why is it changing my math?
I've been using this converter to teach myself C#. Great tool.</p>Marktag:feedback.developerfusion.com,2008-02-07:Event/106724782012-02-02T10:12:38-08:002012-02-02T10:12:38-08:00Cannont convert Nullable property using ?<p>Kyle Schultz suggested:<br />When trying to convert from VB.Net to C# (or vice versa), if you have a nullable property that is created using the ? and not Nullable<> the post back on your page is not ready correctly.
Public Property CurrentDate As DateTime?
I should be able to pass that and get
public DateTime? CurrentDate { get; set; }</p>Kyle Schultztag:feedback.developerfusion.com,2008-02-07:Event/105650312012-01-16T09:49:20-08:002012-01-16T09:49:20-08:00I have a problem converting this code:<p>Gromhelm suggested:<br />public static readonly DependencyProperty ProgressProperty = DependencyProperty.RegisterAttached("Progress", typeof(double), typeof(ViewportAnimation), new PropertyMetadata(0.0, new PropertyChangedCallback(delegate(DependencyObject o, DependencyPropertyChangedEventArgs e) { ((ViewportAnimation)o).ProgressChanged(e); }))); VB.Net Converter gives me this:
Public Shared ReadOnly ProgressProperty As DependencyProperty = DependencyProperty.RegisterAttached("Progress", GetType(Double), GetType(ViewportAnimation), New PropertyMetadata(0.0, New PropertyChangedCallback(Function(o As DependencyObject, e As DependencyPropertyChangedEventArgs) Do
DirectCast(o, ViewportAnimation).ProgressChanged(e)
End Function)))
There seems to be a problem converting the function, but I don't know how to solve it.</p>Gromhelmtag:feedback.developerfusion.com,2008-02-07:Event/105588342012-01-15T08:01:16-08:002012-01-15T08:01:16-08:00Service Down [updated]<p>"Sorry, the service appears to be down at the moment. Please try again later - or contact us if the problem persists".</p><p>tb said:<br /><div class="ugc"><p>I'm getting this message again.</p></div></p>tbtag:feedback.developerfusion.com,2008-02-07:Event/105493602012-01-13T06:23:20-08:002012-01-13T06:23:20-08:00LINQ VB.Net -> C# (where clause)<p>Some dude suggested:<br />In this case, the converter doesn't work
p.s. this syntaxe is valid in VB.Net
From a In ListOfA
Select a
Where a Is A
If we change the Where clause position, just like we do in C# in fact, it works :
From a In ListOfA
Where a Is A
Select a</p>Some dudetag:feedback.developerfusion.com,2008-02-07:Event/105477622012-01-12T23:13:00-08:002012-01-12T23:13:00-08:00Convert this to vb<p>imperialx suggested:<br />CloudStorageAccount.SetConfigurationSettingPublisher((configName, configSetter) =>
{
configSetter(ConfigurationManager.AppSettings[configName]);
});</p>imperialxtag:feedback.developerfusion.com,2008-02-07:Event/104713032011-12-30T06:39:17-08:002011-12-30T06:39:17-08:00Pointers don't get converted properly<p>haiyyu suggested:<br />This line of code:
int* a = &b;
gets converted into this:
Dim a As Pointer(Of Integer) = AddressOfb
As you can see, there is a space missing between AddressOf and b.</p>haiyyutag:feedback.developerfusion.com,2008-02-07:Event/104660502011-12-29T05:09:14-08:002011-12-29T05:09:14-08:00when converting string functions to vb it suggests to use string.* wich do not exists<p>Wilfred suggested:<br />When converting the followong vb code to c# it suggests to use strings.mid() function in c# wich appears not to exists.
Private Sub stringmid(ByVal str As String)
Dim mystr As String
mystr = Mid(str, 2)
End Sub
converts to
private void stringmid(string str)
{
string mystr = null;
mystr = Strings.Mid(str, 2);
}</p>Wilfredtag:feedback.developerfusion.com,2008-02-07:Event/104344932011-12-21T12:40:17-08:002011-12-21T12:40:17-08:00directcast [updated]<p>The c# line converted to
DayPilotMonth1.StartDate = (DateTime)e.Data["start"];
DayPilotMonth1.StartDate = DirectCast(e.Data("start"), DateTime)
give the error Value of type 'DayPilot.Json.JsonData' cannot be converted to 'Date'.
Changting this to ctype fixed the problem</p><p>Simon said:<br /><div class="ugc"><p>Thank you</p></div></p>Simontag:feedback.developerfusion.com,2008-02-07:Event/104109742011-12-16T08:36:41-08:002011-12-16T08:36:41-08:00Service Down [is now completed]<p>"Sorry, the service appears to be down at the moment. Please try again later - or contact us if the problem persists".</p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/104109732011-12-16T08:36:41-08:002011-12-16T08:36:41-08:00Service Down [updated]<p>"Sorry, the service appears to be down at the moment. Please try again later - or contact us if the problem persists".</p><p>james.crowley (admin) responded:<br /><div class="ugc"><p>Sorry about that - fixed now</p></div></p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/103175292011-11-29T12:02:08-08:002011-11-29T12:02:08-08:00Convert to VB.net [updated]<p><script language="javascript">
function openPopup(strOpen)
{
open(strOpen, "Info",
"status=1, width=300, height=200, top=100, left=300");
}
</script>
This won't convert to vb.net</p><p>Jessica C said:<br /><div class="ugc"><p>error: line 1 col 1: EOF expected</p></div></p>Jessica Ctag:feedback.developerfusion.com,2008-02-07:Event/103175212011-11-29T12:01:38-08:002011-11-29T12:01:38-08:00Convert to VB.net<p>Jessica C suggested:<br /><script language="javascript">
function openPopup(strOpen)
{
open(strOpen, "Info",
"status=1, width=300, height=200, top=100, left=300");
}
</script>
This won't convert to vb.net</p>Jessica Ctag:feedback.developerfusion.com,2008-02-07:Event/102818272011-11-23T05:20:56-08:002011-11-23T05:20:56-08:00BitWise operations<p>NicoJuice suggested:<br />public bool IsInRole(Role role) {
Role userRole = (Role)this.Role;
return ((userRole & role) == role);
}
[Flags]
public enum Role {
Student = 1, // 0001
Employer = 2, // 0010
Staff = 4, // 0100
Admin = 8 // 1000
}</p>NicoJuicetag:feedback.developerfusion.com,2008-02-07:Event/102400572011-11-16T08:22:17-08:002011-11-16T08:22:17-08:00Function declaration doesn't convert [updated]<p>The following returns an error:
"-- line 1 col 1: EOF expected" - Why would an EOF be expected at the beginning of the code to be translated??? Here is the code:
Function xmlAddElement(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs, ByVal strID As String, ByVal strErrType As String) As XElement</p><p>james.crowley (admin) responded:<br /><div class="ugc"><p>Hey - try adding an End Function to the code - that should do the trick.</p></div></p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/102330432011-11-15T09:28:17-08:002011-11-15T09:28:17-08:00Function declaration doesn't convert<p>Fletcher suggested:<br />The following returns an error:
"-- line 1 col 1: EOF expected" - Why would an EOF be expected at the beginning of the code to be translated??? Here is the code:
Function xmlAddElement(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.UnhandledExceptionEventArgs, ByVal strID As String, ByVal strErrType As String) As XElement</p>Fletchertag:feedback.developerfusion.com,2008-02-07:Event/101139392011-10-27T00:45:46-07:002011-10-27T00:45:46-07:00return objDataAccess.GetDataSet.Tables(0); [updated]<p>return objDataAccess.GetDataSet.Tables(0);</p><p>IMRAN SAEED said:<br /><div class="ugc"><p>VB.net Code= Return objDataAccess.GetDataSet.Tables(0) working fine
<br />But
<br />C#.Net Code= return objDataAccess.GetDataSet.Tables(0); not working fine.Mistake is here in C#
<br />Non-Invocable member System.Data.Dataset.Tables cannot be used like a method</p></div></p>IMRAN SAEEDtag:feedback.developerfusion.com,2008-02-07:Event/101139242011-10-27T00:42:32-07:002011-10-27T00:42:32-07:00return objDataAccess.GetDataSet.Tables(0);<p>IMRAN SAEED suggested:<br />return objDataAccess.GetDataSet.Tables(0);</p>IMRAN SAEEDtag:feedback.developerfusion.com,2008-02-07:Event/100983412011-10-25T03:34:53-07:002011-10-25T03:34:53-07:00Full project conversion [is now completed]<p>Would be awesome to upload a pile of files, having them spit back out in converted form</p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/100983402011-10-25T03:34:53-07:002011-10-25T03:34:53-07:00Full project conversion [updated]<p>Would be awesome to upload a pile of files, having them spit back out in converted form</p><p>james.crowley (admin) responded:<br /><div class="ugc"><p>We've now implemented this - let us know how you get on!</p></div></p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/100211462011-10-15T14:46:37-07:002011-10-15T14:46:37-07:00should provide the conversion in following way such as VB.NET to C# 1.0, 2.0 and so on... [updated]<p>There should be an option to convert the vb.net to c# 1.0 , vb.net to c# 2.0 and so on because there is lot of difference come with new release of C# if some one wants in old it will help the user</p><p>Anonymous said:<br /><div class="ugc"><p>thank you</p></div></p>Anonymoustag:feedback.developerfusion.com,2008-02-07:Event/99489632011-10-04T13:14:41-07:002011-10-04T13:14:41-07:00i++; fails<p>Gutte suggested:<br />When converting the following from C# to VB.NET it fails to convert correctly.
int i=5;
int j=i++;
//i=6 and j=5
It sets Dim j = System.Math.Max(System.Threading.Interlocked.Increment(i),i-1)
Not possible for i-1 to be greater than i+1</p>Guttetag:feedback.developerfusion.com,2008-02-07:Event/99414382011-10-03T13:27:46-07:002011-10-03T13:27:46-07:00Implementing an Interface<p>Logan Young suggested:<br />C# code to implement an interface:
using System.ServiceModel;
[CallbackBehavior(ConcurrencyMode = ConcurrencyMode.Multiple)]
internal class Callback : MyInterface
Did not convert properly to VB.NET. The conversion had "Inherits MyInterface". It should've had "Implements MyInterface"</p>Logan Youngtag:feedback.developerfusion.com,2008-02-07:Event/97754122011-09-15T16:38:32-07:002011-09-15T16:38:32-07:00Getting error message from conversion [is now completed]<p>Getting several messages "Sorry, the service appears to be down at the moment. Please try again later - or contact us if the problem persists". This just started today 9/15/2011. Having issues with server?</p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/97754112011-09-15T16:38:32-07:002011-09-15T16:38:32-07:00Getting error message from conversion [updated]<p>Getting several messages "Sorry, the service appears to be down at the moment. Please try again later - or contact us if the problem persists". This just started today 9/15/2011. Having issues with server?</p><p>james.crowley (admin) responded:<br /><div class="ugc"><p>Hi Rick - this should be fixed now, but please do let us know if you see it again.</p></div></p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/97659922011-09-14T08:55:42-07:002011-09-14T08:55:42-07:00This Linq statement doesn't translate from VB to C# [is now completed]<p> Dim Table1() As String = {"One", "Two", "Three"}
Dim Table2() As String = {"One", "Three", "Four"}
Dim Results = From Value In Table1 Where Not Table2.Contains(Value)
The resulting C# for the Linq is just
var Results = ;</p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/97659912011-09-14T08:55:42-07:002011-09-14T08:55:42-07:00This Linq statement doesn't translate from VB to C# [updated]<p> Dim Table1() As String = {"One", "Two", "Three"}
Dim Table2() As String = {"One", "Three", "Four"}
Dim Results = From Value In Table1 Where Not Table2.Contains(Value)
The resulting C# for the Linq is just
var Results = ;</p><p>james.crowley (admin) responded:<br /><div class="ugc"><p>This is fixed.</p></div></p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/97659862011-09-14T08:54:52-07:002011-09-14T08:54:52-07:00X = new ColorBlend(4); X.Colors = { C2, C3, C3, C2 }; [is now completed]<p>I am getting a huge error here . . .please if anyone knows how to correct this leave a quick feedback!
X = new ColorBlend(4);
X.Colors = {
C2,
C3,
C3,
C2
};</p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/97659852011-09-14T08:54:52-07:002011-09-14T08:54:52-07:00X = new ColorBlend(4); X.Colors = { C2, C3, C3, C2 }; [updated]<p>I am getting a huge error here . . .please if anyone knows how to correct this leave a quick feedback!
X = new ColorBlend(4);
X.Colors = {
C2,
C3,
C3,
C2
};</p><p>james.crowley (admin) responded:<br /><div class="ugc"><p>This appears to work fine for us now? Let me know if you are still getting the problem - please post before/after code. Thanks</p></div></p>james.crowleytag:feedback.developerfusion.com,2008-02-07:Event/97187172011-09-06T13:01:52-07:002011-09-06T13:01:52-07:00CS -> VB lamba quirk<p>John Wood suggested:<br />C# implementation:
Array.ForEach(
Enum.GetNames(typeof(LightStyle)),
s => m_lightstyle.Items.Add(new ListItem(s))
);
Due to VB inline functions requiring a return value, here is probably a better interpretation.
VB Implementation:
For Each s As String In [Enum].GetNames(GetType(LightStyle))
Me._lightStyle.Items.Add(New ListItem(s))
Next
</p>John Woodtag:feedback.developerfusion.com,2008-02-07:Event/96915902011-09-02T04:51:56-07:002011-09-02T04:51:56-07:00when converting from VB to C# translate AND to && - important bug that woul dbe very hard to pick up<p>Andrei Chevenkov suggested:<br />AND in VB translates to && in C# in most if exoressions</p>Andrei Chevenkovtag:feedback.developerfusion.com,2008-02-07:Event/95791912011-08-22T21:03:45-07:002011-08-22T21:03:45-07:00problem with unary minus<p>Luiz Felipe suggested:<br />digit = int.Parse(number.Substring(i-1, 1));
//ha em, your parser has a bug in unary expressions
i switched the expression with (i+(–1))
now it works</p>Luiz Felipetag:feedback.developerfusion.com,2008-02-07:Event/95701652011-08-22T08:29:20-07:002011-08-22T08:29:20-07:00Braces<p>roncli suggested:<br />A c# construct such as this:
MyObject i;
{
i = new MyObject();
}
i.Run()
Is converted to this:
Dim i As MyObject
If True Then
i = New MyObject()
End If
i.Run()
This produces a compiler warning, saying that i may not be initialized. A better conversion would be like this:
Dim i As MyObject
With Nothing
i = New MyObject()
End With
i.Run()
</p>ronclitag:feedback.developerfusion.com,2008-02-07:Event/95279212011-08-19T04:52:49-07:002011-08-19T04:52:49-07:00C# to Python huge error.<p>Mikhail Akushsky suggested:<br />From
public partial class AllDepViewFieldCollection : RowDataAdapterCollection<AllDepViewField> converts to
class AllDepViewFieldCollection(RowDataAdapterCollection).
Where is generic type parameter?!!</p>Mikhail Akushskytag:feedback.developerfusion.com,2008-02-07:Event/94746192011-08-16T08:34:18-07:002011-08-16T08:34:18-07:00Comparing potentially null variables<p>Tevildo suggested:<br />string x = null;
if(string.Empty == x)
{
System.Console.WriteLine("Shouldn't get here");
}
On conversion, the if statement uses = (If String.Empty = x) which will evaluate to true when x is nothing, but will not evaluate to true when x is null in C#.</p>Tevildotag:feedback.developerfusion.com,2008-02-07:Event/92857252011-08-01T23:06:03-07:002011-08-01T23:06:03-07:00Implementing Event Handler<p>Avinash suggested:<br /> public event EventHandler CanExecuteChanged
{
add
{
if (!_isAutomaticRequeryDisabled)
{
CommandManager.RequerySuggested += value;
}
CommandManagerHelper.AddWeakReferenceHandler(ref _canExecuteChangedHandlers, value, 2);
}
remove
{
if (!_isAutomaticRequeryDisabled)
{
CommandManager.RequerySuggested -= value;
}
CommandManagerHelper.RemoveWeakReferenceHandler(_canExecuteChangedHandlers, value);
}
}
The Above code doesnt properly get converted to vb.net. Am new to vb.net & hence , was wondering is it possible by language syntax. Please let me know , if anyone knows.
Thanks.</p>Avinashtag:feedback.developerfusion.com,2008-02-07:Event/90826192011-07-20T07:43:13-07:002011-07-20T07:43:13-07:00intptr == int after conversion from vb.net [updated]<p>It's not possible in c# to confront an int pointer with an integer type
</p><p>Giovanni Bonnie said:<br /><div class="ugc"><p>Thats the problem in subject, thanks</p></div></p>Giovanni Bonnietag:feedback.developerfusion.com,2008-02-07:Event/90826132011-07-20T07:42:38-07:002011-07-20T07:42:38-07:00intptr == int after conversion from vb.net<p>Giovanni Bonnie suggested:<br />It's not possible in c# to confront an int pointer with an integer type
</p>Giovanni Bonnietag:feedback.developerfusion.com,2008-02-07:Event/88017612011-07-05T22:21:51-07:002011-07-05T22:21:51-07:00line 1 col 4: EOF expected<p>Brandon Johnson suggested:<br /> Dim Dox As XDocument = XDocument.Load("")
For Each Save As XElement In Dox...<Save>
Dim Title As XElement = Save.Nodes(0)
Dim Game As XElement = Save.Nodes(1)
Dim Des As XElement = Save.Nodes(2)
Dim Author As XElement = Save.Nodes(3)
Dim Hash As XElement = Save.Nodes(4)
Dim TitleID As XElement = Save.Nodes(5)
Next</p>Brandon Johnsontag:feedback.developerfusion.com,2008-02-07:Event/87179652011-07-01T02:59:23-07:002011-07-01T02:59:23-07:00Add Intelligence to code conversion to weed out common errors and peculiarities<p>Vaibhav Garg suggested:<br />There are multiple special cases where hard logic cant decide which way to go. e.g:
1. Array variables, Known properties like ViewState, Session etc
Current: Request.QueryString("key") -> Request.QueryString("key");
Correct: Request.QueryString("key") -> Request.QueryString["key"];
2. Optional brackets in VB methods are not so optional in C#
Current: myvar.ToString -> mycar.ToString;
Correct: myvar.ToString -> mycar.ToString();
2. Char literals
Current: If "hello"(0) = "h" Then : End If -> if("hello"[0] == "h") { }
Correct: If("hello"(0) = "h") Then : End if -> if("hello"[0] == 'h') { }
and other similar peculiarities..
There could be a variety of solutions, specially for known .Net properties/items like ViewState etc where you can reflect on and identify the type etc.
You can also keep track for declarations to identify the type of a item so that correct conversion can be done, known array types for example.
There can also be a advanced settings mode to the converter, where a user can specify known array types for example.
These attempts at intelligence can be controlled via the settings so that the User can decide it is it good for them or not.
I would also love the ability to specify my own custom code that would be run after/before conversion, sort of like creating onBeforeConvertion and onAfterConvertion events. Here the user can specify their own logic like regex, search-replace and other code that you deem safe.
Most of this is probably overkill but I am just thinking out loud so thanks for you patience in reading this.
You tool has helped me a lot over the years and I have seen it grow. Thanks</p>Vaibhav Gargtag:feedback.developerfusion.com,2008-02-07:Event/87177792011-07-01T02:33:42-07:002011-07-01T02:33:42-07:00ViewState, Session or Request.Params not arrays [updated]<p>In my example below, none of the ViewState, Session or Request Params (arrays) have their round brackets converted to square brackets.
Example:
Protected Property CurrentSortColumn() As String
Get
If (ViewState("SortColumn") <> Nothing) Then
Return ViewState("SortColumn").ToString()
Else
ViewState("SortColumn") = "ADD_BOOK_ID"
Return "ADD_BOOK_ID"
End If
End Get
Set(ByVal value As String)
ViewState("SortColumn") = value
End Set
End Property
Private Sub Test
ParentControlID = Request.Params("ParentCtlID")
If DirectCast(Session("USER_TOKEN"), Int32) > 0 Then
UserCanEditAddBook = True
End If
End Sub
</p><p>Vaibhav Garg said:<br /><div class="ugc"><p>Why not add a check box to enable disable this detection for certain standard variables.. that way the user can decide best..</p></div></p>Vaibhav Gargtag:feedback.developerfusion.com,2008-02-07:Event/87039772011-06-30T07:08:40-07:002011-06-30T07:08:40-07:00Linq Query from C# to VB [updated]<p>Here's an example from Microsoft's Tailspin Spyworks tutorials that translates very poorly.
============
var query = (from ProductOrders in db.OrderDetails
join SelectedProducts in db.Products on ProductOrders.ProductID equals SelectedProducts.ProductID
group ProductOrders by new
{
ProductId = SelectedProducts.ProductID,
ModelName = SelectedProducts.ModelName
} into grp
select new
{
ModelName = grp.Key.ModelName,
ProductId = grp.Key.ProductId,
Quantity = grp.Sum(o => o.Quantity)
} into orderdgrp
where orderdgrp.Quantity > 0
orderby orderdgrp.Quantity descending
select orderdgrp).Take(5);
========
If you run the convertor on this, you'll find several statements that merge together, "select" disappears entirely and whatever was on either side of it merges into a single word, "equals" turns into "=", and many other bizarre things happen.</p><p>Tommy Long said:<br /><div class="ugc"><p>Similarly, the following C# code (taken from <a href="http://www.brianlow.com/index.php/2010/01/25/find-conflicting-assembly-references/" rel="nofollow" target="_blank">http://www.brianlow.com/index.php/2010/01/25/find-conflicting-assembly-references/</a> - thanks!) doesn't convert to anything too useful. Keywords are merged with surrounding words, and the general differences between C# linq group by and VB.Net don't appear to be observed too well - great job otherwise!!</p>
<p>private IEnumerable<IGrouping<string, Reference>> FindReferencesWithTheSameShortNameButDiffererntFullNames(List<Reference> references)
<br /> {
<br /> return from reference in references
<br /> group reference by reference.ReferencedAssembly.Name
<br /> into referenceGroup
<br /> where referenceGroup.ToList().Select(reference => reference.ReferencedAssembly.FullName).Distinct().Count() > 1
<br /> select referenceGroup;
<br /> }
</p></div></p>Tommy Longtag:feedback.developerfusion.com,2008-02-07:Event/85806652011-06-23T12:03:10-07:002011-06-23T12:03:10-07:00Dim lResult As clsLot = DirectCast((From r In Lots _ [updated]<p> Dim lResult As clsLot = DirectCast((From r In Lots _
Order By r.ExpirationDate _
Select r).First(), clsLot)</p><p>Wyatt said:<br /><div class="ugc"><p>Just tried this Linq code and the result spacing was off. Possibly related to the underscore characters...</p></div></p>Wyatttag:feedback.developerfusion.com,2008-02-07:Event/85806452011-06-23T12:02:01-07:002011-06-23T12:02:01-07:00Dim lResult As clsLot = DirectCast((From r In Lots _<p>Wyatt suggested:<br /> Dim lResult As clsLot = DirectCast((From r In Lots _
Order By r.ExpirationDate _
Select r).First(), clsLot)</p>Wyatttag:feedback.developerfusion.com,2008-02-07:Event/85404912011-06-21T13:38:27-07:002011-06-21T13:38:27-07:00If Authenticate() Then [updated]<p>error with bracket expected</p><p>rwallacej said:<br /><div class="ugc"><p> If Authenticate() Then
<br /> Dim query As New EventQuery(m_CalendarUrl)
<br /> Dim feed As EventFeed = m_Service.Query(query)
<br /> Return (From entry In feed.EntriesNew CalendarEventObject() With { _
<br /> Key .[Date] = entry.Times(0).StartTime, _
<br /> Key .Title = entry.Title.Text _
<br /> }).ToArray()
<br /> Else
<br /> Return New CalendarEventObject(-1) {}
<br /> End If</p></div></p>rwallacejtag:feedback.developerfusion.com,2008-02-07:Event/85404832011-06-21T13:38:19-07:002011-06-21T13:38:19-07:00If Authenticate() Then<p>rwallacej suggested:<br />error with bracket expected</p>rwallacejtag:feedback.developerfusion.com,2008-02-07:Event/80762272011-06-03T04:40:44-07:002011-06-03T04:40:44-07:00python [updated]<p>the Vb.net for ... next loop is never converted to Python
Itried that for a Vb.net class</p><p>Msahli said:<br /><div class="ugc"><p>the Vb.net for ... next loop is never converted to Python
<br />Itried that for a Vb.net class</p></div></p>Msahlitag:feedback.developerfusion.com,2008-02-07:Event/80762232011-06-03T04:40:12-07:002011-06-03T04:40:12-07:00python<p>Msahli suggested:<br />the Vb.net for ... next loop is never converted to Python
Itried that for a Vb.net class</p>Msahlitag:feedback.developerfusion.com,2008-02-07:Event/79381792011-05-28T04:31:00-07:002011-05-28T04:31:00-07:00Return CType(DateTime.UtcNow.Subtract(#1/1/1970#).TotalSeconds, Long) [updated]<p> Private Function getTimeStamp() As Long
Return CType(DateTime.UtcNow.Subtract(#1/1/1970#).TotalSeconds, Long)
End Function
</p><p>sigalou said:<br /><div class="ugc"><p>Convert VB.NET to C#</p></div></p>sigaloutag:feedback.developerfusion.com,2008-02-07:Event/79381712011-05-28T04:30:23-07:002011-05-28T04:30:23-07:00Return CType(DateTime.UtcNow.Subtract(#1/1/1970#).TotalSeconds, Long)<p>sigalou suggested:<br /> Private Function getTimeStamp() As Long
Return CType(DateTime.UtcNow.Subtract(#1/1/1970#).TotalSeconds, Long)
End Function
</p>sigalou