Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Modify a XML file in Silverlight 2 ?

Modify a XML file in Silverlight 2 ?

Scheduled Pinned Locked Moved WPF
questioncsharplinqxmltutorial
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mohammad Dayyan
    wrote on last edited by
    #1

    Hi everybody. How can I modify a XML file into Isolated Storage with silverlight 2 ? (without using LINQ) For example : assume we have a XML file like this :

    <CodeColorizer>
      <Settings>
        <IsVB>False</IsVB>
    	<IsStriped>False</IsStriped>
      </Settings>
    </CodeColorizer>
    

    Now , I wanna change the content of IsVB to True . How can I do it ? By the way : I've already searched in Google, unfortunately I couldn't find anything special :( Thank in advance.

    B 1 Reply Last reply
    0
    • M Mohammad Dayyan

      Hi everybody. How can I modify a XML file into Isolated Storage with silverlight 2 ? (without using LINQ) For example : assume we have a XML file like this :

      <CodeColorizer>
        <Settings>
          <IsVB>False</IsVB>
      	<IsStriped>False</IsStriped>
        </Settings>
      </CodeColorizer>
      

      Now , I wanna change the content of IsVB to True . How can I do it ? By the way : I've already searched in Google, unfortunately I couldn't find anything special :( Thank in advance.

      B Offline
      B Offline
      Braulio Dez
      wrote on last edited by
      #2

      Can you use XMLWriter on Silverlight, I guess yes, check this link http://msdn.microsoft.com/en-us/library/cc189001(VS.95).aspx[^] Just a curiosity, why you don't want to use LINQ To XML? works pretty well and it's pretty easy to use. Cheers Braulio

      /// -------------------------      Braulio Díez      DBSchemaEditor.com      Free Silverlight based DB Schema Modeling Tool /// -------------------------

      M 1 Reply Last reply
      0
      • B Braulio Dez

        Can you use XMLWriter on Silverlight, I guess yes, check this link http://msdn.microsoft.com/en-us/library/cc189001(VS.95).aspx[^] Just a curiosity, why you don't want to use LINQ To XML? works pretty well and it's pretty easy to use. Cheers Braulio

        /// -------------------------      Braulio Díez      DBSchemaEditor.com      Free Silverlight based DB Schema Modeling Tool /// -------------------------

        M Offline
        M Offline
        Mohammad Dayyan
        wrote on last edited by
        #3

        I've checked it out. We couldn't modify a XML file with the link.

        Braulio Dez wrote:

        Just a curiosity, why you don't want to use LINQ To XML? works pretty well and it's pretty easy to use.

        Because using LINQ in SL2 causes we force to add some DLLs to our projects. It means we will have a SL2 Application with a larger volume.

        B 1 Reply Last reply
        0
        • M Mohammad Dayyan

          I've checked it out. We couldn't modify a XML file with the link.

          Braulio Dez wrote:

          Just a curiosity, why you don't want to use LINQ To XML? works pretty well and it's pretty easy to use.

          Because using LINQ in SL2 causes we force to add some DLLs to our projects. It means we will have a SL2 Application with a larger volume.

          B Offline
          B Offline
          Braulio Dez
          wrote on last edited by
          #4

          Mmm... Haven't used XMLWriter on SL, but in theory you can generate a file using XML Writer on SL, mmm... I guess what you want is just modify the file without rewriting it isn't it? More about XMLWriter and SL https://silverlight.net/forums/t/6655.aspx[^] If you just want to modify a single setting, you try to open it as a text file and then just check with a regex where the nodes are (a bit crappy stuff but should work). Another curiosity, how much extra weight did ad the LINQ to your XAP?

          /// -------------------------      Braulio Díez      DBSchemaEditor.com      Free Silverlight based DB Schema Modeling Tool /// -------------------------

          M 1 Reply Last reply
          0
          • B Braulio Dez

            Mmm... Haven't used XMLWriter on SL, but in theory you can generate a file using XML Writer on SL, mmm... I guess what you want is just modify the file without rewriting it isn't it? More about XMLWriter and SL https://silverlight.net/forums/t/6655.aspx[^] If you just want to modify a single setting, you try to open it as a text file and then just check with a regex where the nodes are (a bit crappy stuff but should work). Another curiosity, how much extra weight did ad the LINQ to your XAP?

            /// -------------------------      Braulio Díez      DBSchemaEditor.com      Free Silverlight based DB Schema Modeling Tool /// -------------------------

            M Offline
            M Offline
            Mohammad Dayyan
            wrote on last edited by
            #5

            Braulio Dez wrote:

            If you just want to modify a single setting, you try to open it as a text file and then just check with a regex where the nodes are (a bit crappy stuff but should work).

            Yeah, I think ,I have to do it.

            Braulio Dez wrote:

            Another curiosity, how much extra weight did ad the LINQ to your XAP?

            If we using LINQ , we have to add some DLLs beside the SL2 project.

            B 1 Reply Last reply
            0
            • M Mohammad Dayyan

              Braulio Dez wrote:

              If you just want to modify a single setting, you try to open it as a text file and then just check with a regex where the nodes are (a bit crappy stuff but should work).

              Yeah, I think ,I have to do it.

              Braulio Dez wrote:

              Another curiosity, how much extra weight did ad the LINQ to your XAP?

              If we using LINQ , we have to add some DLLs beside the SL2 project.

              B Offline
              B Offline
              Braulio Dez
              wrote on last edited by
              #6

              In my case (dbschemaeditor.com) I'm using LINQ To XML, and I have developed a desktop like app and the release mode of the XAP is just about 3OO kbytes (in your case the DLL's that you will be added will be compressed by the SL and added to the XAP), I could shorten it by chopping it into several XAP, and load features on demand, and use caching on the isolated storage. What's the size of your XAP? Have you checked on Release mode? Cheers Braulio

              /// -------------------------      Braulio Díez      DBSchemaEditor.com      Free Silverlight based DB Schema Modeling Tool /// -------------------------

              M 1 Reply Last reply
              0
              • B Braulio Dez

                In my case (dbschemaeditor.com) I'm using LINQ To XML, and I have developed a desktop like app and the release mode of the XAP is just about 3OO kbytes (in your case the DLL's that you will be added will be compressed by the SL and added to the XAP), I could shorten it by chopping it into several XAP, and load features on demand, and use caching on the isolated storage. What's the size of your XAP? Have you checked on Release mode? Cheers Braulio

                /// -------------------------      Braulio Díez      DBSchemaEditor.com      Free Silverlight based DB Schema Modeling Tool /// -------------------------

                M Offline
                M Offline
                Mohammad Dayyan
                wrote on last edited by
                #7

                Braulio Dez wrote:

                What's the size of your XAP? Have you checked on Release mode?

                About 1.2 MB :(

                B 1 Reply Last reply
                0
                • M Mohammad Dayyan

                  Braulio Dez wrote:

                  What's the size of your XAP? Have you checked on Release mode?

                  About 1.2 MB :(

                  B Offline
                  B Offline
                  Braulio Dez
                  wrote on last edited by
                  #8

                  Ouch ! Mmmm... Or it's a hugue project, or there's something wrong going there. My solution is composed of 12 projects and more than 100 classes, maybe not a big project but at least medium sized. Have you checked what does take that hugue size? Are you embedding images or any expensive resource? Pure code shouldn't take that much. If you want to analyze how longs takes each part of the XAP, you can rename the file top ZIP and then unpack it and check sizes of DLL's, resource, and folders. Cheers Braulio

                  /// -------------------------      Braulio Díez      DBSchemaEditor.com      Free Silverlight based DB Schema Modeling Tool /// -------------------------

                  M 1 Reply Last reply
                  0
                  • B Braulio Dez

                    Ouch ! Mmmm... Or it's a hugue project, or there's something wrong going there. My solution is composed of 12 projects and more than 100 classes, maybe not a big project but at least medium sized. Have you checked what does take that hugue size? Are you embedding images or any expensive resource? Pure code shouldn't take that much. If you want to analyze how longs takes each part of the XAP, you can rename the file top ZIP and then unpack it and check sizes of DLL's, resource, and folders. Cheers Braulio

                    /// -------------------------      Braulio Díez      DBSchemaEditor.com      Free Silverlight based DB Schema Modeling Tool /// -------------------------

                    M Offline
                    M Offline
                    Mohammad Dayyan
                    wrote on last edited by
                    #9

                    yeah you're right. I've created a Code Colorizer : Code Colorizer with Silverlight 2 & C#[^] you can see the source

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups