Example #1
0
        public bool RegisterObject(object modelObject, object parentObject = null)
        {
            try
            {
                var t = modelObject.GetType();
                var a = t.GetCustomAttribute <UaObject>();
                if (a == null)
                {
                    throw new Exception(
                              $"Cannot register UA object for type {t.Name}, it's not annotated with 'UaObject'!");
                }
            }
            catch (Exception e)
            {
                ExceptionHandler.Log(e);
                return(false);
            }

            BusinessModel?.Add(new BoCapsule(modelObject));
            return(true);
        }