void PropertyManager::add(IProperty *prop){
	if(!prop) return;
	if(PropertyExists(prop->getName())) return;
	mProperties.push_back(prop);
	notifyObservers(ON_CHANGE, "add");
	return;
}
Exemple #2
0
Variant TPropertyHandler::GetValue(TComponent* comp, String prName)
{
	if (!PropertyExists(comp, prName)) return NULL;
	if (IsClass(comp, prName)) return NULL;
	return GetPropValue(comp, prName, true);
	// Parameter true: Strings are preferred returntype (see TypeInfo.pas).
}
Exemple #3
0
String TPropertyHandler::GetNamesValues(TComponent* comp, String prNames)
{
	String list, prop, name1, name2;
	int prop_start = 1, prop_end, sep;
	while (prop_start < prNames.Length())
	{
		// Extract (next) prop from props:
		prop_end = prNames.Pos(";"); // Find end of prop.
		if (!prop_end)
			prop_end = prNames.Length() + 1; // Last prop.
		else
			prNames[prop_end] = ' '; // Remove ';'.
		prop = prNames.SubString(prop_start, prop_end - prop_start);
		prop_start = prop_end + 1;

		// Get the value:
		if (!PropertyExists(comp, prop)) continue;
		if (IsClass(comp, prop))
			list = list + GetClassNamesValues(comp, prop) + "\n";
		else
			list = list + BuildNameValue(comp, prop) + "\n";
	}
	return list;
}
Exemple #4
0
String TPropertyHandler::GetNameValue(TComponent* comp, String prName)
{
	if (!PropertyExists(comp, prName)) return "";
	if (IsClass(comp, prName)) return GetClassNamesValues(comp, prName);
	return BuildNameValue(comp, prName);
}
Exemple #5
0
bool TPropertyHandler::PropertyExists(String prName)
{
	if (!DefaultComponentExists()) return false;
	return PropertyExists(FDefaultComponent, prName);
}