For instance, if one knows the tag of the object, this code
string tag = "arrow20436"; System.Xml.Linq.XElement ret = new System.Xml.Linq.XElement(GetType().Name); using(System.IO.StringWriter sw = new System.IO.StringWriter(System.Globalization.Cultur eInfo.InvariantCulture)) { new XmlSerializer(DrawObjects[s1].GetType()).Serialize(sw, DrawObjects[tag]); ret.Add(new System.Xml.Linq.XElement("DrawObjects_"+tag,System .Xml.Linq.XElement.Parse(sw.ToString()))); Print(ret); } }
<DetectVOL_accArrows> <DrawObjects_s1> <ArrowDown xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <IsVisible>true</IsVisible> <IsAutoScale>true</IsAutoScale> <MaxValue>-1.7976931348623157E+308</MaxValue> <MinValue>1.7976931348623157E+308</MinValue> <ZOrder>10004</ZOrder> <AttachedTo> <ChartObjectSerialize>a VOL Accelerator</ChartObjectSerialize> <InstrumentSerialize>NQ 06-22</InstrumentSerialize> </AttachedTo> <ScaleJustification>Right</ScaleJustification> <DrawingState>Normal</DrawingState> <DisplayOnChartsMenus>true</DisplayOnChartsMenus> <GlobalLastSeenSerialize>0</GlobalLastSeenSerialize> <Id>d80c7e2c15c74a78b90d6fc0c4be9c4b</Id> <IsLocked>true</IsLocked> <PanelIndex>0</PanelIndex> <Tag>arrow20436</Tag> <ZOrderType>Normal</ZOrderType> <Anchor> <SlotIndex>20436</SlotIndex> <DisplayName>Anchor</DisplayName> <IsBrowsable>true</IsBrowsable> <Time>2022-05-04T18:35:59.552</Time> <Price>13520.5</Price> </Anchor> <AreaBrushSerialize><SolidColorBrush xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">#FFB22222</SolidColorBrush></AreaBrushSerialize> <OutlineBrushSerialize><SolidColorBrush xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">#FFA9A9A9</SolidColorBrush></OutlineBrushSerialize> </ArrowDown> </DrawObjects_s1> </DetectVOL_accArrows>
Comment