/// <summary> /// Opens the second storage. /// </summary> private void openSecondStorage() { if (!string.IsNullOrEmpty(secondStorageConnStr) && (secondStorageDataStore == null || secondStorageDataStore == appDataStore)) { try { secondStorageDataStore = XpoDefault.GetConnectionProvider(secondStorageConnStr, AutoCreateOption.DatabaseAndSchema); secondStorageDataLayer = new SimpleDataLayer(secondStorageDictionary, secondStorageDataStore); } catch (Exception exception) { var args = new GetPlatformArgs(); XafDeltaModule.Instance.OnGetPlatform(args); if (args.XafDeltaPlatform != null) { args.XafDeltaPlatform.OnShowError(new ErrorEventArgs(exception)); } secondStorageDataStore = appDataStore; secondStorageDataLayer = appDataLayer; } foreach (var packageUpdate in delayedPackageUpdates) { secondStorageDataStore.UpdateSchema(false, packageUpdate.ToArray()); } delayedPackageUpdates.Clear(); } return; }
public IXafDeltaPlatform GetPlatform(string actionName) { var args = new GetPlatformArgs(); XafDeltaModule.Instance.OnGetPlatform(args); if (args.XafDeltaPlatform == null) throw new ApplicationException("XafDeltaPlatform is null"); if (args.XafDeltaPlatform.ActionIsBusy(actionName)) args.XafDeltaPlatform = null; return args.XafDeltaPlatform; }
public IXafDeltaPlatform GetPlatform(string actionName) { var args = new GetPlatformArgs(); XafDeltaModule.Instance.OnGetPlatform(args); if (args.XafDeltaPlatform == null) { throw new ApplicationException("XafDeltaPlatform is null"); } if (args.XafDeltaPlatform.ActionIsBusy(actionName)) { args.XafDeltaPlatform = null; } return(args.XafDeltaPlatform); }
void Instance_GetPlatform(object sender, GetPlatformArgs e) { e.XafDeltaPlatform = this; }
void Instance_GetPlatform(object sender, GetPlatformArgs e) { e.XafDeltaPlatform = this; }
/// <summary> /// Opens the second storage. /// </summary> private void openSecondStorage() { if (!string.IsNullOrEmpty(secondStorageConnStr) && (secondStorageDataStore == null || secondStorageDataStore == appDataStore)) { try { secondStorageDataStore = XpoDefault.GetConnectionProvider(secondStorageConnStr, AutoCreateOption.DatabaseAndSchema); secondStorageDataLayer = new SimpleDataLayer(secondStorageDictionary, secondStorageDataStore); } catch (Exception exception) { var args = new GetPlatformArgs(); XafDeltaModule.Instance.OnGetPlatform(args); if(args.XafDeltaPlatform != null) args.XafDeltaPlatform.OnShowError(new ErrorEventArgs(exception)); secondStorageDataStore = appDataStore; secondStorageDataLayer = appDataLayer; } foreach (var packageUpdate in delayedPackageUpdates) secondStorageDataStore.UpdateSchema(false, packageUpdate.ToArray()); delayedPackageUpdates.Clear(); } return; }