本文整理汇总了C++中Type::GetParentType方法的典型用法代码示例。如果您正苦于以下问题:C++ Type::GetParentType方法的具体用法?C++ Type::GetParentType怎么用?C++ Type::GetParentType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::GetParentType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
GHashTable *
Type::CopyProperties (bool inherited)
{
GHashTable *props = g_hash_table_new (g_str_hash, g_str_equal);
Type *type = this;
do {
if (type->properties)
g_hash_table_foreach (type->properties, property_add, props);
if (!inherited || !type->HasParent ())
break;
type = type->GetParentType ();
} while (type);
return props;
}
示例2: GetDependencyPropertyFull
DependencyProperty *
DependencyProperty::GetDependencyPropertyFull (Type::Kind type, const char *name, bool inherits)
{
DependencyProperty *property;
Type *t = Type::Find (Deployment::GetCurrent (), type);
if (t == NULL)
return NULL;
property = GetDependencyProperty (t, name, inherits);
if (property == NULL) {
if (inherits)
property = GetDependencyProperty (t, name, false);
if (property == NULL && t->HasParent ())
return GetDependencyPropertyFull (t->GetParentType (), name, inherits);
}
return property;
}
示例3: Value
Value *
DependencyProperty::GetDefaultValue (Type::Kind kind)
{
if (default_value_overrides) {
Value *value = (Value *) g_hash_table_lookup (default_value_overrides, GINT_TO_POINTER (kind));
if (value)
return new Value (*value);
Types *types = Deployment::GetCurrent ()->GetTypes ();
Type *t = types->Find (kind);
while ((t = t->GetParentType ()) != NULL) {
value = (Value *) g_hash_table_lookup (default_value_overrides, GINT_TO_POINTER (t->GetKind ()));
if (value)
return new Value (*value);
}
}
if (autocreator) {
return autocreator (kind, this);
} else {
return default_value ? new Value (*default_value) : NULL;
}
}