Esempio n. 1
0
        public override ModelDifferenceObject InitializeMembers(string name, string applicationTitle, string uniqueName)
        {
            ModelDifferenceObject modelDifferenceObject = base.InitializeMembers(name, applicationTitle, uniqueName);

            UserDifferenceObjectBuilder.SetUp(this);
            return(modelDifferenceObject);
        }
 protected internal override void OnDifferenceObjectSaving(ModelDifferenceObject userModelDifferenceObject, ModelApplicationBase model) {
     var userStoreObject = ((UserModelDifferenceObject)userModelDifferenceObject);
     if (!userStoreObject.NonPersistent) {
         userModelDifferenceObject.CreateAspectsCore(model);
         base.OnDifferenceObjectSaving(userModelDifferenceObject, model);
     }
     CombineModelFromPermission(model);
 }
Esempio n. 3
0
 public override void UpdateDatabaseAfterUpdateSchema() {
     base.UpdateDatabaseAfterUpdateSchema();
     string name = typeof(WCCalculatedFieldModelStore).Name;
     if (new QueryModelDifferenceObject(ObjectSpace.Session).GetActiveModelDifference(name) == null) {
         ModelDifferenceObject modelDifferenceObject =
             new ModelDifferenceObject(ObjectSpace.Session).InitializeMembers(name);
         modelDifferenceObject.Name = name;
         ObjectSpace.CommitChanges();
     }
 }
Esempio n. 4
0
 public override void UpdateDatabaseAfterUpdateSchema() {
     base.UpdateDatabaseAfterUpdateSchema();
     string name = typeof(ExistentAssemblyMasterDetailModelStore).Name;
     var session = ((XPObjectSpace)ObjectSpace).Session;
     if (new QueryModelDifferenceObject(session).GetActiveModelDifference(name, FeatureCenterModule.Application) == null) {
         ModelDifferenceObject modelDifferenceObject =
             new ModelDifferenceObject(session).InitializeMembers(name, FeatureCenterModule.Application);
         modelDifferenceObject.Name = name;
         ObjectSpace.CommitChanges();
     }
 }
Esempio n. 5
0
        public override void UpdateDatabaseAfterUpdateSchema() {
            base.UpdateDatabaseAfterUpdateSchema();

            var uniqueName = new ExternalApplicationModelStore().Name;
            if (new QueryModelDifferenceObject(ObjectSpace.Session).GetActiveModelDifference(uniqueName, "ExternalApplication") == null) {
                var modelDifferenceObject = new ModelDifferenceObject(ObjectSpace.Session).InitializeMembers("ExternalApplication", "ExternalApplication", uniqueName);
                modelDifferenceObject.PersistentApplication.ExecutableName = "ExternalApplication.Win.exe";
                var modelApplicationBuilder = new ModelLoader(modelDifferenceObject.PersistentApplication.ExecutableName);
                var model = modelApplicationBuilder.GetLayer(typeof(ExternalApplicationModelStore));
                modelDifferenceObject.CreateAspects(model);
                ObjectSpace.CommitChanges();
            }
        }
        public override ModelDifferenceObject InitializeMembers(string name, string applicationTitle, string uniqueName)
        {
            ModelDifferenceObject modelDifferenceObject = base.InitializeMembers(name, applicationTitle, uniqueName);

            if (SecuritySystem.CurrentUser != null)
            {
                modelDifferenceObject.Name = string.Format("AutoCreated for {0} {1}", ((IAuthenticationStandardUser)SecuritySystem.CurrentUser).UserName, DateTime.Now);
            }
            else
            {
                modelDifferenceObject.Name = "AutoCreated at " + DateTime.Now;
            }
            return(modelDifferenceObject);
        }
Esempio n. 7
0
        public override void UpdateDatabaseAfterUpdateSchema() {
            base.UpdateDatabaseAfterUpdateSchema();

            var uniqueName = new ExternalApplicationModelStore().Name;
            var session = ((XPObjectSpace)ObjectSpace).Session;
            if (new QueryModelDifferenceObject(session).GetActiveModelDifference(uniqueName, "ExternalApplication") == null) {
                var modelDifferenceObject = new ModelDifferenceObject(session).InitializeMembers("ExternalApplication", "ExternalApplication.Win", uniqueName);
                modelDifferenceObject.PersistentApplication.ExecutableName = "ExternalApplication.Win.exe";
                var modelApplicationBuilder = new ModelLoader(modelDifferenceObject.PersistentApplication.ExecutableName,XafTypesInfo.Instance);
                InterfaceBuilder.SkipAssemblyCleanup = true;
                var model = modelApplicationBuilder.GetLayer(typeof(ExternalApplicationModelStore), false,info => info.AssignAsInstance());
                InterfaceBuilder.SkipAssemblyCleanup = false;
                modelDifferenceObject.CreateAspects(model);
                ObjectSpace.CommitChanges();
            }
        }
Esempio n. 8
0
 ModelDifferenceObject CreateDifferenceObject(string resourceName, string prefix) {
     ModelDifferenceObject modelDifferenceObject;
     if (prefix == XpoModelDictionaryDifferenceStore.ModelApplicationPrefix)
         modelDifferenceObject = new ModelDifferenceObject(_objectSpace.Session);
     else {
         modelDifferenceObject = new RoleModelDifferenceObject(_objectSpace.Session);
         Type roleType = ((IRoleTypeProvider)SecuritySystem.Instance).RoleType;
         var criteriaParametersList = resourceName.Substring(0, resourceName.IndexOf("_", StringComparison.Ordinal));
         object findObject = _objectSpace.FindObject(roleType, CriteriaOperator.Parse("Name=?", criteriaParametersList));
         Guard.ArgumentNotNull(findObject, criteriaParametersList);
         var xpBaseCollection = ((XPBaseCollection)modelDifferenceObject.GetMemberValue("Roles"));
         xpBaseCollection.BaseAdd(findObject);
     }
     modelDifferenceObject.InitializeMembers(resourceName, _xafApplication.Title, _xafApplication.GetType().FullName);
     return modelDifferenceObject;
 }
 public ModelDifferenceObjectInfo(ModelDifferenceObject modelDifferenceObject, ModelApplicationBase model) {
     ModelDifferenceObject = modelDifferenceObject;
     Model = model;
 }
Esempio n. 10
0
 void GetModelUnSafe(ModelApplicationBase modelApplicationBase, ModelDifferenceObject modelDifferenceObject) {
     var afterSetupLayer = GetAfterSetupLayer(modelApplicationBase);
     ModelApplicationHelper.AddLayer(modelApplicationBase, afterSetupLayer);
     modelDifferenceObject.GetModel(modelApplicationBase);
     ModelApplicationHelper.RemoveLayer(afterSetupLayer);
 }
 protected internal virtual void OnDifferenceObjectSaving(ModelDifferenceObject modelDifferenceObject, ModelApplicationBase model) {
     if (model.HasModification)
         ObjectSpace.SetModified(modelDifferenceObject);
     ObjectSpace.CommitChanges();
 }
 protected internal virtual void OnDifferenceObjectSaving(ModelDifferenceObject modelDifferenceObject, ModelApplicationBase model) {
     ObjectSpace.CommitChanges();
 }