Modify a XML file in Silverlight 2 ?
-
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.
-
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.
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 /// -------------------------
-
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 /// -------------------------
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.
-
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.
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 /// -------------------------
-
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 /// -------------------------
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.
-
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.
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 /// -------------------------
-
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 /// -------------------------
Braulio Dez wrote:
What's the size of your XAP? Have you checked on Release mode?
About 1.2 MB :(
-
Braulio Dez wrote:
What's the size of your XAP? Have you checked on Release mode?
About 1.2 MB :(
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 /// -------------------------
-
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 /// -------------------------
yeah you're right. I've created a Code Colorizer : Code Colorizer with Silverlight 2 & C#[^] you can see the source