示例#1
0
        /// <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;
        }
示例#2
0
 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;
 }
示例#3
0
        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);
        }
示例#4
0
 void Instance_GetPlatform(object sender, GetPlatformArgs e)
 {
     e.XafDeltaPlatform = this;
 }
示例#5
0
 void Instance_GetPlatform(object sender, GetPlatformArgs e)
 {
     e.XafDeltaPlatform = this;
 }
示例#6
0
        /// <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;
        }