當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript FileNameResolver.resolveFileName方法代碼示例

本文整理匯總了TypeScript中tns-core-modules/file-system/file-name-resolver.FileNameResolver.resolveFileName方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript FileNameResolver.resolveFileName方法的具體用法?TypeScript FileNameResolver.resolveFileName怎麽用?TypeScript FileNameResolver.resolveFileName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tns-core-modules/file-system/file-name-resolver.FileNameResolver的用法示例。


在下文中一共展示了FileNameResolver.resolveFileName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: createPage

export function createPage() {
    var page = new pages.Page();
    var lbl = new label.Label();

    var moduleName = "tests/pages/files/test";

    var resolver = new fileResolverModule.FileNameResolver({
        width: 400,
        height: 600,
        os: "android",
        deviceType: "phone"
    });

    // Current app full path.
    var currentAppPath = fs.knownFolders.currentApp().path;
    var moduleNamePath = fs.path.join(currentAppPath, moduleName);

    var fileName = resolver.resolveFileName(moduleNamePath, "xml");
    lbl.text = fileName;
    lbl.textWrap = true;

    page.content = lbl;
    return page;
}
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:24,代碼來源:file-load-test.ts

示例2: test_file_resolver_with_ios_phone_portrait

export function test_file_resolver_with_ios_phone_portrait() {
    var fileResolver = new resolver.FileNameResolver(iPhonePortraitContext);
    var result = fileResolver.resolveFileName(testFilePath, "xml");
    TKUnit.assertEqual(result, testFilePath + ".xml", "File path");
}
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:5,代碼來源:file-name-resolver-tests.ts

示例3: test_file_resolver_with_andorid_tablet_portrait

export function test_file_resolver_with_andorid_tablet_portrait() {
    var fileResolver = new resolver.FileNameResolver(androidTabletPortraitContext);
    var result = fileResolver.resolveFileName(testFilePath, "xml");
    TKUnit.assertEqual(result, testFilePath + ".minWH600.xml", "File path");
}
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:5,代碼來源:file-name-resolver-tests.ts

示例4: test_file_resolver_with_andorid_phone_landscape

export function test_file_resolver_with_andorid_phone_landscape() {
    var fileResolver = new resolver.FileNameResolver(androidPhoneLandsacpeContext);
    var result = fileResolver.resolveFileName(testFilePath, "xml");
    TKUnit.assertEqual(result, testFilePath + ".land.xml", "File path");
}
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:5,代碼來源:file-name-resolver-tests.ts


注:本文中的tns-core-modules/file-system/file-name-resolver.FileNameResolver.resolveFileName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。