Search results for query: *

  1. N

    Question Code Generation with CodeDOM

    I am working on a method that generates another class using the CodeDom, VBCodeProvider, and whatever other classes are necessary. I will be using the method in a Windows Phone 7 (and possibly at some point Windows Phone 8) app, so my first question is, "Are all the necessary classes available...
  2. N

    Question Defining a Generic Extension Method

    I am trying to write an Extension Method for IEnumerable(Of T). I will be using reflection on the Type T in the Extension Method to get a list of it's properties so that I can create an Anonymous Type that will include all those properties. I have written Extension Methods before, but never a...
  3. N

    Question Class Build Order

    My basic situation is that, in an ASP.NET/VB.NET project of mine, I have several controls defined in *.vb files by inheriting from System.Web.UI.Control. These classes must obviously be built before any pages that use the controls, otherwise I would be trying to use controls that don't exist...
  4. N

    Question Class Build Order

    I have several classes in my solution that depend on each other, so the classes need to be built in a certain order for the solution to work. How can I force one class to be built before it tries to build another? Thanks.
  5. N

    Question Cannot fix deserialization error

    The thing that had changed since my previous thread was that I modified the serialization code to not include any namespaces, so it now looks like the following: Dim stream As New MemoryStream() Dim ns As New XmlSerializerNamespaces() : ns.Add("", "") Dim xml As New...
  6. N

    Question Cannot fix deserialization error

    I have a class instance that I want to serialize, upload to SkyDrive, download from SkyDrive, and then deserialize. I have the serialization, uploading, and downloading working fine, but the deserialization gives me the following error: There is an error in XML document (2, 2). The generated...
  7. N

    Question Cannot Deserialize using XmlSerializer

    On what line should I close the file? I have used Notepad to view the contents, they are exactly what I wanted and expected (well, that's what they look like in Notepad). It is all valid XML, no spaces at the beginning or end (at least none that I can see in Notepad), so the file contents seem...
  8. N

    Question Cannot Deserialize using XmlSerializer

    I changed the code to: Private Sub Client_DownloadCompleted(sender As Object, e As LiveDownloadCompletedEventArgs) If e.Error Is Nothing Then System.Diagnostics.Debug.WriteLine("Checkpoint 1") Dim fs As New FileStream("GiftTrackerData.xml", FileMode.Create) e.Result.CopyTo(fs) Dim...
  9. N

    Question Cannot Deserialize using XmlSerializer

    What should I do to save it to a FileStream? I couldn't seem to find a constructor or good method for creating a FileStream with the stream that I have. Thanks.
  10. N

    Question Cannot Deserialize using XmlSerializer

    I tried reducing the download code to just: Dim tempdata As SyncData = CType(New XmlSerializer(GetType(SyncData)).Deserialize(e.Result), SyncData) But it still gives the same error: There is an error in XML document (1, 1). So you may be correct about what you said (although CanSeek was...
  11. N

    Question Cannot Deserialize using XmlSerializer

    I don't know if this is the problem or not, but many of the things I managed to find online that mentioned this error said it had something to do with encoding. I do not specify a specific encoding anywhere in my code, so I am wondering if the fact that I use a MemoryStream while uploading is...
  12. N

    Question Cannot Deserialize using XmlSerializer

    Actually, I do include that. Here is the rest of the code for creating the XML, it serializes the object and then uploads it: Private Sub btnUpload_Tap(sender As Object, e As System.Windows.Input.GestureEventArgs) Handles btnUpload.Tap If Me.client IsNot Nothing Then AddHandler...
  13. N

    Question Cannot Deserialize using XmlSerializer

    I have the following code that serializes an object: Dim stream As New MemoryStream() Dim xml As New XmlSerializer(GetType(SyncData)) xml.Serialize(stream, New SyncData(CType(Application.Current, App).Recipients, CType(Application.Current, App).Gifts)) However, when I later attempt to check...
  14. N

    Question Using IgnoreDataMemberAttribute for array types in a DataContract

    I have a class that I need to serialize using XmlSerializer. The class is declared as follows: <DataContract()> Public Class Recipient <DataMember()> Public Property ID() As Byte <DataMember()> Public Property Name() As String <IgnoreDataMember()> Public ReadOnly Property Gifts() As Gift()...
  15. N

    Question Parsing a complete date

    Thanks, I think that worked when I used just the Parse method, I guess I was just having trouble finding anywhere that gave an example that used +0000, they all seemed to use +00:00 or some other format. Thanks again!
  16. N

    Question Parsing a complete date

    I have dates from a data file that I need to parse. Here is an example of one of the dates and what I have so far: DateTime.ParseExact("2013-01-26T02:43:55+0000","yyyy-MM-dd\THH:mm:ss", As you can see, the date includes the timezone offset (the "+0000" part at the end). I am not sure how to...
  17. N

    Question Maintaining Data Between Button Clicks

    I found the problem (and as always, it was a shoot yourself in the head problem). The variable wasn't really being reset, but I was calling a method in MyClass that calculates what values it started with, so it looked to me like it was being reset because it ended up with the values it would...
  18. N

    Question Maintaining Data Between Button Clicks

    I should probably be kicked out of the development field for not knowing this, but I'll ask it anyway. I have a Form with multiple Buttons, all of which modify the same variable. However, each time the variable gets reset. Here is what my code looks like: Public Class frmTest Private myvar...
  19. N

    Question Creating a complete application for EZ-Robot

    I am trying to learn to program EZ-Robot (http://www.ez-robot.com/shop/) using VB.NET. I have downloaded the SDK, but the examples it included didn't really look like they did much, and the SDK documentation (http://www.ez-robot.com/SDK/) didn't seem very helpful. I would like to see a complete...
  20. N

    Question VB with Lego Mindstorms NXT

    Using VB.NET and Visual Studio 2010 with Lego Mindstorms NXT Maybe I'm asking this in the wrong place, but I was wondering if there is a way to use Visual Studio 2010 and VB.NET for Lego Mindstorms NXT. All the articles I have found use C# and usually Visual Studio 2008. I would basically like...
Back
Top