static ITargetClassObject TryCurrentCast(EvaluationContext context,
							  ITargetClassObject source,
							  ITargetClassType source_type,
							  ITargetClassType target_type)
        {
            ITargetClassObject current = source.CurrentObject;
            if (current.Type == source_type)
                return null;

            return TryParentCast (context, current, current.Type, target_type);
        }
        static ITargetClassObject TryParentCast(EvaluationContext context,
							 ITargetClassObject source,
							 ITargetClassType source_type,
							 ITargetClassType target_type)
        {
            if (source_type == target_type)
                return source;

            if (!source_type.HasParent)
                return null;

            source = TryParentCast (
                context, source, source_type.ParentType, target_type);
            if (source == null)
                return null;

            return source.Parent;
        }
        bool InsertClassChildren(TreeIter parent, ITargetClassObject sobj, bool raw_view)
        {
            bool inserted = false;

            if (sobj.Type.HasParent) {
                TreeIter iter = store.Append (parent);
                AddObject ("<parent>", Stock.Class, sobj.Parent, iter);
                inserted = true;
            }

            if (InsertStructChildren (parent, sobj, raw_view))
                inserted = true;

            return inserted;
        }