예제 #1
0
 private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e)
 {
         #if !DEBUG
     e.Store   = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Web");
     e.Handled = true;
         #endif
 }
예제 #2
0
        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);
            }
        }
예제 #3
0
 private void Application_CreateCustomModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e)
 {
     #if !DEBUG
     e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), true, "Web");
     e.Handled = true;
     #endif
 }
예제 #4
0
        static void winApplication_CreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e)
        {
            string modelDiffsPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;

            e.Store   = new FileModelStore(modelDiffsPath, "Ribbon.Model");
            e.Handled = true;
        }
예제 #5
0
 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;
 }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
 //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;
 }
예제 #9
0
 private void ApplicationOnCreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e)
 {
     e.Handled = true;
     e.Store   = new ModelDifferenceDbStore(Application, typeof(ModelDifference), true);
 }
예제 #10
0
 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;
 }
예제 #13
0
 private void Application_CreateCustomUserModelDifferenceStore(Object sender, CreateCustomModelDifferenceStoreEventArgs e)
 {
     e.Store = new ModelDifferenceDbStore((XafApplication)sender, typeof(ModelDifference), false, "Web");
     e.Handled = true;
 }
예제 #14
0
        void application_CreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e)
        {
            e.Store = new FileModelStore(HttpContext.Current.Server.MapPath("~/"), "ModelDiff");

            e.Handled = true;
        }
예제 #15
0
 private void ERPAspNetApplication_CreateCustomModelDifferenceStore(object sender, CreateCustomModelDifferenceStoreEventArgs e)
 {
     e.Handled = true;
     e.Store   = new FileModelStore(BusinessBuilder.Instance.Directory, "Model");
 }