private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { #if !DEBUG e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Web"); e.Handled = true; #endif }
private void OnCreateCustomUserModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e) { if (IsHosted && _customUserModelDifferenceStore) { return; } _customUserModelDifferenceStore = true; var stringModelStores = ResourceModelCollector.GetEmbededModelStores(); foreach (var stringModelStore in stringModelStores) { e.AddExtraDiffStore(stringModelStore.Key, stringModelStore.Value); } IEnumerable <string> models = Directory.GetFiles(BinDirectory, "*.Xpand.xafml", SearchOption.TopDirectoryOnly); models = models.Concat(Directory.GetFiles(BinDirectory, "model.user*.xafml", SearchOption.TopDirectoryOnly)).Where(s => !s.ToLowerInvariant().EndsWith("model.user.xafml")); if (IsHosted) { models = models.Concat(Directory.GetFiles(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "model.user*.xafml", SearchOption.TopDirectoryOnly)); } foreach (var path in models) { string fileNameTemplate = Path.GetFileNameWithoutExtension(path); var storePath = Path.GetDirectoryName(path); var fileModelStore = new FileModelStore(storePath, fileNameTemplate); e.AddExtraDiffStore(fileNameTemplate, fileModelStore); } }
private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { #if !DEBUG e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Web"); e.Handled = true; #endif }
static void winApplication_CreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e) { string modelDiffsPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; e.Store = new FileModelStore(modelDiffsPath, "Ribbon.Model"); e.Handled = true; }
void application_CreateCustomUserModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e) { if (DesignMode) { e.Store = new FileModelStore(@"C:\TFS\IMatrix\ERP\Admiral.ERP.Web", "ModelDiffUsers"); } else { e.Store = new FileModelStore(HttpContext.Current.Server.MapPath("~/"), "ModelDiffUsers"); } e.Handled = true; }
public void On_CreateCustomModelDiffernceStore_ApplicationConnectionString_Should_Be_Stored(){ var module = new ModelDifferenceWindowsFormsModule(); var application = Isolate.Fake.Instance<XafApplication>(Members.CallOriginal); application.ConnectionString = "test"; using (RecorderManager.StartRecording()){ application.CreateCustomModelDifferenceStore += null; } module.Setup(application); var eventHandle = (EventHandler<CreateCustomModelDifferenceStoreEventArgs>) RecorderManager.LastMockedEvent.GetEventHandle(); var args = new CreateCustomModelDifferenceStoreEventArgs(); eventHandle.Invoke(this,args); Assert.IsTrue(args.Handled); // Assert.AreEqual("test", module.ConnectionString); }
public void UserModel_Should_Be_Assign() { var module = new ModelDifferenceModule(); var application = Isolate.Fake.Instance<XafApplication>(); using (RecorderManager.StartRecording()) { application.CreateCustomUserModelDifferenceStore += null; } module.Setup(application); var handler = ((EventHandler<CreateCustomModelDifferenceStoreEventArgs>)RecorderManager.LastMockedEvent.GetEventHandle()); var args = new CreateCustomModelDifferenceStoreEventArgs(); handler.Invoke(this, args); Assert.IsTrue(args.Handled); Assert.IsInstanceOfType(typeof(XpoUserModelDictionaryDifferenceStore), args.Store); }
//private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { // e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Mobile"); // e.Handled = true; //} private void Application_CreateCustomUserModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), false, "Mobile"); e.Handled = true; }
private void ApplicationOnCreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e) { e.Handled = true; e.Store = new ModelDifferenceDbStore(Application, typeof(ModelDifference), true); }
private void ApplicationOnCreateCustomUserModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs args) { args.Handled = true; args.Store =new XpoUserModelDictionaryDifferenceStore( Application); }
private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { e.Store = new ModelDifferenceDbStore((XafApplication)sender, true); e.Handled = true; }
static void winApplication_CreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e) { string modelDiffsPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase; e.Store = new FileModelStore(modelDiffsPath, "Ribbon.Model"); e.Handled = true; }
private void Application_CreateCustomUserModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e) { e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), false, "Web"); e.Handled = true; }
void application_CreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e) { e.Store = new FileModelStore(HttpContext.Current.Server.MapPath("~/"), "ModelDiff"); e.Handled = true; }
private void ERPAspNetApplication_CreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e) { e.Handled = true; e.Store = new FileModelStore(BusinessBuilder.Instance.Directory, "Model"); }