本文整理汇总了C++中Type::GetKind方法的典型用法代码示例。如果您正苦于以下问题:C++ Type::GetKind方法的具体用法?C++ Type::GetKind怎么用?C++ Type::GetKind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Type
的用法示例。
在下文中一共展示了Type::GetKind方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Type
Type::Kind
Types::RegisterType (const char *name, const char *content_property, void *gc_handle, Type::Kind parent, bool is_interface, bool ctor_visible, Type::Kind* interfaces, int interface_count)
{
Type *type = new Type (Deployment::GetCurrent (), Type::INVALID, parent, false, false, is_interface, name, 0, Find (parent)->GetEventCount (), NULL, interface_count, interfaces, ctor_visible, NULL, content_property);
// printf ("Types::RegisterType (%s, %p, %i (%s)). this: %p, size: %i, count: %i\n", name, gc_handle, parent, Type::Find (this, parent) ? Type::Find (this, parent)->name : NULL, this, size, count);
type->SetKind ((Type::Kind) types.Add (type));
return type->GetKind ();
}
示例2: 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;
}
}
示例3: strlen
//.........这里部分代码省略.........
goto error;
break;
default:
bool explicit_type = false;
expression_found = true;
start = inptr - 1;
while (inptr < inend && (*inptr != '.' || tick_open) && (!paren_open || *inptr != ')') && *inptr != '[') {
if (*inptr == '\'') {
tick_open = !tick_open;
if (!tick_open) {
inptr++;
break;
}
}
inptr++;
}
if (inptr == start)
goto error;
if (*inptr == '.') {
// we found a type name, now we need to find the property name
if ((inptr - start) == 11 && !g_ascii_strncasecmp (start, "TextElement", 11)) {
// Some Beta versions of Blend had a bug where they would save the TextBlock
// properties as TextElement instead. Since Silverlight 1.0 works around this
// bug, we should too. Fixes http://silverlight.timovil.com and
// http://election.msn.com/podium08.aspx.
type = Type::Find (lu->GetDeployment (), "TextBlock");
explicit_type = true;
} else {
const char *s = inptr;
if (*(inptr -1) == '\'' && !tick_open) {
s = inptr - 1;
}
name = g_strndup (start, s - start);
type = lookup_type (lu, name);
explicit_type = true;
if (!type)
type = lu->GetType ();
g_free (name);
}
inptr++;
start = inptr;
while (inptr < inend && (!paren_open || *inptr != ')') && (*inptr != '.' || tick_open)) {
if (*inptr == '\'') {
tick_open = !tick_open;
if (!tick_open) {
inptr++;
break;
}
}
inptr++;
}
if (inptr == start)
goto error;
} else {
type = lu->GetType ();
explicit_type = false;
}
if ((*inptr != ')' && paren_open) || !type)
goto error;
name = g_strndup (start, inptr - start);
if (!(res = DependencyProperty::GetDependencyProperty (type, name)) && lu)
res = DependencyProperty::GetDependencyProperty (lu->GetType (), name);
if (!res) {
g_free (name);
goto error;
}
if (!res->IsAttached () && !lu->Is (type->GetKind ())) {
// We try to be gracefull here and do something smart...
if (!(res = DependencyProperty::GetDependencyProperty (lu->GetType (), name))) {
g_free (name);
goto error;
}
}
if (res->IsAttached () && explicit_type && !paren_open)
goto error;
g_free (name);
break;
}
}
*o = lu;
return res;
error:
*o = NULL;
return NULL;
}