Beispiel #1
0
        private void EnsureNotAlreadySharedLocally <T>(ICheckNotifier notifier, T m) where T : IMapsDirectlyToDatabaseTable
        {
            if (_shareManager.IsExportedObject(m))
            {
                var existingExport          = _shareManager.GetNewOrExistingExportFor(m);
                var existingImportReference = _shareManager.GetExistingImport(existingExport.SharingUID);

                if (existingImportReference != null)
                {
                    T existingImportInstance = m.Repository.GetObjectByID <T>(existingImportReference.ReferencedObjectID);
                    notifier.OnCheckPerformed(new CheckEventArgs(typeof(T) + " '" + m + "' is already locally shared as '" + existingImportInstance + "'", CheckResult.Fail));
                }
            }
        }