本文整理汇总了C#中ObjectReader.ReadExistingObject方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectReader.ReadExistingObject方法的具体用法?C# ObjectReader.ReadExistingObject怎么用?C# ObjectReader.ReadExistingObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectReader
的用法示例。
在下文中一共展示了ObjectReader.ReadExistingObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadChild
protected override ObjectWrapper ReadChild (ObjectReader reader, XmlElement child_elem)
{
Widget wrapper = Stetic.Wrapper.Widget.Lookup (optionmenu.Menu);
reader.ReadExistingObject (wrapper, child_elem["widget"]);
return wrapper;
}
示例2: ReadInternalChild
protected virtual ObjectWrapper ReadInternalChild (ObjectReader reader, XmlElement child_elem)
{
ClassDescriptor klass = base.ClassDescriptor;
string childId = child_elem.GetAttribute ("internal-child");
foreach (PropertyDescriptor prop in klass.InternalChildren) {
if (reader.Format == FileFormat.Glade && ((TypedPropertyDescriptor)prop).GladeName != childId)
continue;
else if (reader.Format == FileFormat.Native && prop.Name != childId)
continue;
Gtk.Widget child = prop.GetValue (container) as Gtk.Widget;
Widget wrapper = Widget.Lookup (child);
if (wrapper != null) {
reader.ReadExistingObject (wrapper, child_elem["widget"]);
if (reader.Format == FileFormat.Glade)
GladeUtils.SetPacking (ChildWrapper (wrapper), child_elem);
else
WidgetUtils.SetPacking (ChildWrapper (wrapper), child_elem);
return wrapper;
}
}
// In Glade, internal children may not be direct children of the root container. This is handled in a special way.
if (reader.Format == FileFormat.Glade) {
if (!reader.GladeChildStack.Contains (child_elem))
reader.GladeChildStack.Add (child_elem);
return null;
}
else
throw new GladeException ("Unrecognized internal child name", Wrapped.GetType ().FullName, false, "internal-child", childId);
}