public void Init(ITNDApplicationBuis applicationBuis)
 {
     if (this._ApplicationBuis == null)
     {
         this._ApplicationBuis = applicationBuis;
     }
 }
Beispiel #2
0
 public void ApplyConfiguration(ITNDApplicationBuis applicationBuis)
 {
     this._ApplicationBuis = applicationBuis;
     this._DataAccess      = applicationBuis.GetDataAccess();
     //
     // Load fav data
     this.showFavorites();
 }
Beispiel #3
0
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     using (var ni = this._ApplicationBuis as IDisposable) {
         using (var kh = this._KeyboardHook as IDisposable) {
             this._KeyboardHook     = null;
             this._ApplicationBuis  = null;
             this._ApplicationModel = null;
         }
     }
 }
        public async Task SearchTermTest_Kunde()
        {
            var sut = new TNDSQLSourceBuis();
            ITNDApplicationBuis applicationBuis = A.Fake <ITNDApplicationBuis>();
            TNDConfiguration    configuration   = new TNDConfiguration();
            var metaSourceKunde = new TNDMetaSource()
            {
                MetaSourceName = "SourceKunde",
                Configuration  = (new System.Data.SqlClient.SqlConnectionStringBuilder()
                {
                    DataSource = ".",
                    InitialCatalog = "TagNDropDB",
                    IntegratedSecurity = true
                }).ConnectionString,
                AssemblyQualifiedName = "",
                SourceBuis            = sut
            };
            var metaStorageKunde = new TNDMetaStorage()
            {
                MetaStorageName       = "",
                RootPath              = "",
                AssemblyQualifiedName = "",
                StorageBuis           = null
            };
            var metaEntityKunde = new TNDMetaEntity()
            {
                MetaEntityLevel                  = 0,
                MetaEntityParent                 = null,
                MetaEntityName                   = "Kunde",
                MetaEntityParentName             = null,
                MetaEntityParentNamePropertyName = null,
                MetaSource      = metaSourceKunde,
                MetaSourceName  = "SourceKunde",
                MetaStorage     = metaStorageKunde,
                MetaStorageName = "StorageKunde"
            };

            configuration.MetaEntities = new TNDMetaEntity[] { metaEntityKunde };
            configuration.MetaSources  = new TNDMetaSource[] { metaSourceKunde };
            configuration.MetaStorages = new TNDMetaStorage[] { metaStorageKunde };
            sut.Init(applicationBuis, metaSourceKunde);
            var result = await sut.SearchTerm(metaEntityKunde, "k", null, null);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Length > 0);
            result = await sut.SearchTerm(metaEntityKunde, "aa", null, null);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Length > 0);
        }
Beispiel #5
0
 private void initApplication()
 {
     if (this._ApplicationModel == null)
     {
         var applicationModel = this.TryFindResource("ApplicationModel") as TNDApplicationModel;
         var notifyIconBuis   = PoorMansDI.Instance.Create <ITNDNotifyIconBuis>().Init(applicationModel);
         var applicationBuis  = PoorMansDI.Instance.Create <ITNDApplicationBuis>().Init(applicationModel, notifyIconBuis);
         var keyboardHook     = PoorMansDI.Instance.Create <ITNDKeyboardHook>().Init(applicationModel);
         applicationModel.Init(applicationBuis);
         this._ApplicationModel = applicationModel;
         this._ApplicationBuis  = applicationBuis;
         this._KeyboardHook     = keyboardHook;
         this.Resources.Add("ApplicationBuis", applicationBuis);
     }
 }
Beispiel #6
0
 public void Init(ITNDDataAccess dataAccess, ITNDApplicationBuis applicationBuis)
 {
     this._ApplicationBuis = applicationBuis;
     this._DataAccess      = dataAccess;
 }
Beispiel #7
0
 public ITNDDataAccess Init(ITNDApplicationBuis applicationBuis)
 {
     this._ApplicationBuis = applicationBuis;
     return(this);
 }
Beispiel #8
0
 public ITNDStorageBuis Init(ITNDApplicationBuis applicationBuis, TNDMetaStorage metaStorage)
 {
     this._ApplicationBuis = applicationBuis;
     this._MetaStorage     = metaStorage;
     return(this);
 }
        public async Task SearchTermTest_Produkt()
        {
            var sut = new TNDSQLSourceBuis();
            ITNDApplicationBuis applicationBuis = A.Fake <ITNDApplicationBuis>();
            TNDConfiguration    configuration   = new TNDConfiguration();
            var metaSourceKunde = new TNDMetaSource()
            {
                MetaSourceName        = "SourceKunde",
                Configuration         = TestConnectionString,
                AssemblyQualifiedName = "",
                SourceBuis            = sut
            };
            var metaSourceProdukt = new TNDMetaSource()
            {
                MetaSourceName        = "SourceProdukt",
                Configuration         = TestConnectionString,
                AssemblyQualifiedName = "",
                SourceBuis            = sut
            };
            var metaStorageKunde = new TNDMetaStorage()
            {
                MetaStorageName       = "Kunde",
                RootPath              = "",
                AssemblyQualifiedName = "",
                StorageBuis           = null
            };
            var metaStorageProdukt = new TNDMetaStorage()
            {
                MetaStorageName       = "Produkt",
                RootPath              = "",
                AssemblyQualifiedName = "",
                StorageBuis           = null
            };
            var metaEntityKunde = new TNDMetaEntity()
            {
                MetaEntityLevel                  = 0,
                MetaEntityParent                 = null,
                MetaEntityName                   = "Kunde",
                MetaEntityParentName             = null,
                MetaEntityParentNamePropertyName = null,
                MetaSource      = metaSourceKunde,
                MetaSourceName  = "SourceKunde",
                MetaStorage     = metaStorageKunde,
                MetaStorageName = "StorageKunde"
            };
            var metaEntityProdukt = new TNDMetaEntity()
            {
                MetaEntityLevel                  = 0,
                MetaEntityParent                 = null,
                MetaEntityName                   = "Produkt",
                MetaEntityParentName             = null,
                MetaEntityParentNamePropertyName = null,
                MetaSource      = metaSourceProdukt,
                MetaSourceName  = "SourceProdukt",
                MetaStorage     = metaStorageProdukt,
                MetaStorageName = "StorageProdukt"
            };

            //
            configuration.MetaEntities = new TNDMetaEntity[] { metaEntityKunde, metaEntityProdukt };
            configuration.MetaSources  = new TNDMetaSource[] { metaSourceKunde, metaSourceProdukt };
            configuration.MetaStorages = new TNDMetaStorage[] { metaStorageKunde, metaStorageProdukt };
            sut.Init(applicationBuis, metaSourceProdukt);
            var result = await sut.SearchTerm(metaEntityProdukt, "k%", null, null);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Length > 0);
            result = await sut.SearchTerm(metaEntityProdukt, "a", null, null);

            Assert.IsNotNull(result);
            Assert.IsTrue(result.Length > 0);
        }
 public ITNDSourceBuis Init(ITNDApplicationBuis applicationBuis, TNDMetaSource metaSource)
 {
     this._ApplicationBuis = applicationBuis;
     this._MetaSource      = metaSource;
     return(this);
 }
Beispiel #11
0
 public void Init(ITNDApplicationBuis applicationBuis)
 {
     this.ApplicationBuis = applicationBuis;
 }
Beispiel #12
0
 public ITNDTargetBuis Init(TNDTargetModel targetModel, ITNDDataAccess dataAccess, ITNDApplicationBuis applicationBuis)
 {
     this._ApplicationBuis = applicationBuis;
     this._DataAccess      = dataAccess;
     return(this);
 }