コード例 #1
0
ファイル: main.cs プロジェクト: lpwwpl/testCSharp
        static void TestComplexDllMemUsage()
        {
            Console.WriteLine("DllMemUsage:Use Arg and ReturnType,");
            UseComplexDllByStatic instance = new UseComplexDllByStatic();

            instance.TestReturnStructByNew();
            instance.TestReturnStructByArg();
            Console.WriteLine("DllMemUsage:Test END\n");
        }
コード例 #2
0
        public void TestComplexDllImport()
        {
            NameEntityType        allType    = NameEntityType.OrganizationName | NameEntityType.PersonName | NameEntityType.PlaceName;
            UseComplexDllByStatic nameFinder = new UseComplexDllByStatic(allType);

            //param is not didn't use
            bool isInit = nameFinder.Initialize(@".\data");

            if (isInit)
            {
                List <NameEntity> nameResults = new List <NameEntity>();
                //param text is not didn't use
                string text      = "";
                bool   isSuccess = nameFinder.CreateNameEntitys(text, ref nameResults);
                Assert.AreEqual(isSuccess, true);
            }
        }
コード例 #3
0
ファイル: main.cs プロジェクト: lpwwpl/testCSharp
        static void TestComplexDllStatic()
        {
            Console.WriteLine("Complex: Use StaticDllImport,");
            PrintCurrentProcessMemUsage();
            UseComplexDllByStatic instanceUseComplexDllByStatic = new UseComplexDllByStatic();

            bool isInit = instanceUseComplexDllByStatic.Initialize(@".\data");

            if (isInit)
            {
                List <NameEntity> nameResults = new List <NameEntity>();
                string            text        = "";
                bool isSuccessFindNames       = instanceUseComplexDllByStatic.CreateNameEntitys(text, ref nameResults);

                NameEntity nameEntity          = new NameEntity();
                bool       isSuccessCreateName = instanceUseComplexDllByStatic.CreateNameEntity(ref nameEntity);
            }
            ClearMemory();
            PrintCurrentProcessMemUsage();
            Console.WriteLine("Complex: Test END\n");
        }