public bool Add <T>(T element, string format) { ManagerCreator mc = new ManagerCreator(); IManager manager = null; string name; if (element is Table) { entity = new TableEntity(element as Table); name = (element as Table).Name; } else if (element is Connection) { entity = new ConnectionEntity(element as Connection); name = (element as Connection).Name; } else { AddAnotherEntity(element, out name); } IConcreteEntity <T> concreteentity = entity as IConcreteEntity <T>; manager = mc.CreateManager(name, format); concreteentity.Add(element, manager); return(true); }
/// <summary> /// Validation management /// </summary> /// <param name="filename">FileName to check</param> /// <param name="format">Current system format(xml, json)</param> /// <returns>KeyValuePair-result in success/failure and messages</returns> public KeyValuePair <bool, Result> Validate(string filename, string format) { ManagerCreator mc = new ManagerCreator(); manager = mc.CreateManager(filename, format); entity = new Entity(manager); return(entity.Validate()); }