public static string GetEventFromAttr(CsAttributes pList, FactoryExpressionCreator pCreator) { addImports(pList, pCreator); List <AttributeItem> vals = GetAttributeValue(pList, EVENT_ATTRIBUTE, pCreator); if (vals.Count == 0) { return(null); } return(vals[0].Parameters.Count == 0 ? null : (string)vals[0].Parameters[0]); }
private static void addImports(CsAttributes pList, FactoryExpressionCreator pCreator) { if (pList == null) { return; } List <AttributeItem> vals = GetAttributeValue(pList, NAMESPACE_ATTRIBUTE, pCreator); if (vals.Count == 0 || vals[0].Parameters.Count == 0) { return; } ImportStatementList.AddImport((string)vals[0].Parameters[0]); }
public static bool HasAttribute(CsAttributes pList, string pAttrName) { if (pList == null) { return(false); } if (pList.sections == null || pList.sections.Count == 0) { return(false); } return((from section in pList.sections from attribute in section.attribute_list select HasAttribute(attribute.entities, pAttrName)).Any(pVal => pVal)); }
public static List <AttributeItem> GetAttributeValue(CsAttributes pList, string pAttrName, FactoryExpressionCreator pCreator) { if (pList == null || pList.sections == null || pList.sections.Count == 0) { return(new List <AttributeItem>()); } return (pList.sections.SelectMany( pSection => pSection.attribute_list.Select( pAttribute => pAttribute.entities == null ? getAttributeValue(pAttribute, pAttrName, pCreator) : GetAttributeValue(pAttribute.entities, pAttrName)).Where (pVal => pVal != null)).FirstOrDefault()); }
public static bool IsClassDefinedAsObject(CsAttributes pList) { return(HasAttribute(pList, AS_OBJECT)); }
public static string GetEventFromAttr(CsAttributes pList, FactoryExpressionCreator pCreator) { addImports(pList, pCreator); List<AttributeItem> vals = GetAttributeValue(pList, EVENT_ATTRIBUTE, pCreator); if (vals.Count == 0) { return null; } return vals[0].Parameters.Count == 0 ? null : (string)vals[0].Parameters[0]; }
public static bool HasAttribute(CsAttributes pList, string pAttrName) { if (pList == null) { return false; } if (pList.sections == null || pList.sections.Count == 0) { return false; } return (from section in pList.sections from attribute in section.attribute_list select HasAttribute(attribute.entities, pAttrName)).Any(pVal => pVal); }
public static List<AttributeItem> GetAttributeValue(CsAttributes pList, string pAttrName, FactoryExpressionCreator pCreator) { if (pList == null || pList.sections == null || pList.sections.Count == 0) { return new List<AttributeItem>(); } return pList.sections.SelectMany( pSection => pSection.attribute_list.Select( pAttribute => pAttribute.entities == null ? getAttributeValue(pAttribute, pAttrName, pCreator) : GetAttributeValue(pAttribute.entities, pAttrName)).Where (pVal => pVal != null)).FirstOrDefault(); }
private static void addImports(CsAttributes pList, FactoryExpressionCreator pCreator) { if (pList == null) { return; } List<AttributeItem> vals = GetAttributeValue(pList, NAMESPACE_ATTRIBUTE, pCreator); if (vals.Count == 0 || vals[0].Parameters.Count == 0) { return; } ImportStatementList.AddImport((string)vals[0].Parameters[0]); }
public static bool IsClassDefinedAsObject(CsAttributes pList) { return HasAttribute(pList, AS_OBJECT); }