public bool AddNormalComponent(string componentName, object componentDataObject) { bool result; try { instance = GetContainer(); var normalComponent = new NormalComponent(componentName); if (instance.CurrentContainer.Components[componentName] != null) { instance.RemoveComponentByName(componentName); } else { instance.RemoveComponentByInnerName(normalComponent.InnerName); } normalComponent.ComponentDataObject = componentDataObject; instance.CurrentContainer.Add(normalComponent, normalComponent.InnerName); result = true; } catch { result = false; } return(result); }
public void RemoveComponentByInnerName(string componentName) { var normalComponent = new NormalComponent(componentName); foreach (IBBXComponent item in GetContainer().CurrentContainer.Components) { if (item != null && item.InnerName == normalComponent.ComponentName) { this.CurrentContainer.Remove(item); } } }
public object GetNormalComponentDataObject(string componentName) { instance = GetContainer(); var normalComponent = new NormalComponent(componentName); if (instance.CurrentContainer.Components[normalComponent.InnerName] == null) { return(null); } return(((NormalComponent)instance.CurrentContainer.Components[normalComponent.InnerName]).ComponentDataObject); }
public override bool Equals(object cmp) { NormalComponent normalComponent = (NormalComponent)cmp; return(this.ComponentName.Equals(normalComponent.ComponentName)); }