Steps in Editing an XML using LINQ and C#
1. Get the path of your XML file.
string fullXmlPath =
System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath) + "file name.xml";
2. Load the path.
XElement LogXmlDocument = XElement.Load(fullXmlPath);
3. Prepare the data.
var navResultsPlant = LogXmlDocument.Descendants().Where(
e => e.Attribute("id").Value == id).FirstOrDefault();
if (navResultsPlant != null)
navResultsPlant.Remove();
4. Save.
LogXmlDocument.Save(fullXmlPath);
This blog is dedicated to my experiences in programming. Contributors are welcome, please email me at jhelyn.suan@gmail.com
Showing posts with label syntax. Show all posts
Showing posts with label syntax. Show all posts
Thursday, October 22, 2009
Wednesday, August 26, 2009
Add ShadowEffect in C# UIElement
Syntax:
DropShadowEffect dropShadowEffect = new DropShadowEffect();
dropShadowEffect.ShadowDepth = 0;
dropShadowEffect.Direction = 10;
dropShadowEffect.BlurRadius = 15;
dropShadowEffect.Color = Colors.Gold;
fe.Effect = dropShadowEffect;
DropShadowEffect dropShadowEffect = new DropShadowEffect();
dropShadowEffect.ShadowDepth = 0;
dropShadowEffect.Direction = 10;
dropShadowEffect.BlurRadius = 15;
dropShadowEffect.Color = Colors.Gold;
fe.Effect = dropShadowEffect;
Labels:
.Net,
animation,
C#,
color,
direction,
DropShadowEffect,
language,
programming,
syntax,
UIElement
Subscribe to:
Comments (Atom)