public virtual Property CreateProperty(IComponentAddin addin, string propName, string selector) { string modifier = GetModifier(addin); return(CreateProperty(modifier, addin.Type, addin.IsArrayedAddin, addin.CtorContainsDriver, propName, selector)); }
public IComponentAddin GetAddin(string key) { IComponentAddin addin = _addins.TryGetValue(key, out IComponentAddin tryAddin) ? tryAddin : null; return(addin); }
public KeyValuePair <Property, Property> CreatePropertyWithPrivateWebElement(IComponentAddin addin, string propName, string selector) { string modifier = GetModifier(addin); var privateProperty = CreateProperty("private", Consts.WEB_ELEMENT_CLASS_NAME, addin.IsArrayedAddin, false, "_" + propName, selector); //_ string is for private naming string declerationStatement = GetDeclarationStatement(modifier, addin.Type, propName); string equalsStatement = GetEqualStatement(addin.Type, addin.IsArrayedAddin, addin.CtorContainsDriver, selector, privateProperty.Name); var mainProperty = new Property { Statement = $"{declerationStatement} => {equalsStatement};", Name = propName }; return(new KeyValuePair <Property, Property>(privateProperty, mainProperty)); }
private static string GetModifier(IComponentAddin addin) { return(addin.IsPropertyModifierPublic ? "public" : "protected"); }
public void AddAddin(IComponentAddin newAddin) { _addins[newAddin.AddinKey] = newAddin; }