public XOApplication(XElement ModelElement, XElement ViewElement, XElement SecurityElement, XOApplicationConfigParams ConfigParams)
        {
            if (ModelElement == null)
            {
                throw new ArgumentException("ModelElement can't be null"); 
            }

            _xopDataSet = new XOPDataSet(ModelElement);

            if (ViewElement != null)
                _xwpApplication = new XWPApplication(ViewElement);

            if (SecurityElement != null)
                _xspApplication = new XSPApplication(SecurityElement);

            _tables = _xopDataSet.Tables.Select(p => new XOTable(this, p, GetXWPTable(XwpApplication, p.Name), GetXSPTable(XspApplication, p.Name))).ToArray();

            _configParams = ConfigParams;

            this.EndInit();
        }
 private static XWPTable GetXWPTable(XWPApplication XWPApplication, string TableName)
 {
     return XWPApplication != null && XWPApplication.DataView != null && XWPApplication.DataView.Tables != null ? XWPApplication.DataView.Tables.FirstOrDefault(s => s.TableName == TableName) : null;
 }