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


TypeScript object.getProperty函數代碼示例

本文整理匯總了TypeScript中eez-studio-shared/model/object.getProperty函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getProperty函數的具體用法?TypeScript getProperty怎麽用?TypeScript getProperty使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: getInstrumentExtensionProperties

function getInstrumentExtensionProperties(extensionDefinition: ExtensionDefinition) {
    const project = ProjectStore.project;

    let instrumentExtensionProperties: any = {};

    let projectFeatures = getExtensionsByCategory("project-feature");
    for (let projectFeature of projectFeatures) {
        if (
            projectFeature.eezStudioExtension.implementation.projectFeature
                .collectExtensionDefinitions &&
            getProperty(
                project,
                projectFeature.eezStudioExtension.implementation.projectFeature.key
            )
        ) {
            projectFeature.eezStudioExtension.implementation.projectFeature.collectExtensionDefinitions(
                project,
                extensionDefinition,
                instrumentExtensionProperties
            );
        }
    }

    return instrumentExtensionProperties;
}
開發者ID:eez-open,項目名稱:studio,代碼行數:25,代碼來源:build.ts

示例2: visitWithPause

function* visitWithPause(parentObject: EezObject): IterableIterator<VisitResult> {
    if (isArray(parentObject)) {
        let arrayOfObjects = asArray(parentObject);
        for (let i = 0; i < arrayOfObjects.length; i++) {
            yield* visitWithPause(arrayOfObjects[i]);
        }
    } else {
        for (const propertyInfo of parentObject._classInfo.properties) {
            if (!propertyInfo.skipSearch) {
                let value = getProperty(parentObject, propertyInfo.name);
                if (value) {
                    if (
                        propertyInfo.type === PropertyType.Object ||
                        propertyInfo.type === PropertyType.Array
                    ) {
                        yield* visitWithPause(value);
                    } else {
                        yield getObjectPropertyAsObject(parentObject, propertyInfo);
                    }
                }
            }
        }
    }

    // pause
    yield null;
}
開發者ID:eez-open,項目名稱:studio,代碼行數:27,代碼來源:search.ts

示例3: metrics

export function metrics(project: Project): { [key: string]: string | number } {
    let shortcuts = getProperty(project, "shortcuts") as Shortcuts;

    return {
        Shortcuts: shortcuts.shortcuts._array.length
    };
}
開發者ID:eez-open,項目名稱:studio,代碼行數:7,代碼來源:metrics.ts

示例4: getBuildResults

async function getBuildResults(sectionNames: string[] | undefined) {
    const project = ProjectStore.project;

    let buildResults: BuildResult[] = [];

    let projectFeatures = getExtensionsByCategory("project-feature");
    for (let projectFeature of projectFeatures) {
        if (
            projectFeature.eezStudioExtension.implementation.projectFeature.build &&
            getProperty(
                project,
                projectFeature.eezStudioExtension.implementation.projectFeature.key
            )
        ) {
            buildResults.push(
                await projectFeature.eezStudioExtension.implementation.projectFeature.build(
                    project,
                    sectionNames
                )
            );
        }
    }

    return buildResults;
}
開發者ID:eez-open,項目名稱:studio,代碼行數:25,代碼來源:build.ts

示例5: getExtensionsToBuild

function getExtensionsToBuild() {
    let extensionDefinitions = getProperty(
        ProjectStore.project,
        "extensionDefinitions"
    ) as EezArrayObject<ExtensionDefinition>;

    return (
        extensionDefinitions &&
        extensionDefinitions._array
            .filter(extensionDefinition => !extensionDefinition.doNotBuild)
            .filter(extensionDefinition => {
                const idfFromProject = toJS(extensionDefinition);
                const instrumentIdf: InstrumentIdfProperties = idfFromProject as any;
                return instrumentIdf.extensionName && instrumentIdf.idfGuid;
            })
    );
}
開發者ID:eez-open,項目名稱:studio,代碼行數:17,代碼來源:build.ts

示例6: getProperty

            (result: IMessage[], propertyInfo: PropertyInfo) => {
                const childObject = getProperty(object, propertyInfo.name);

                let childrenMessages: IMessage[];
                if (isArray(childObject)) {
                    childrenMessages = asArray(childObject).reduce<IMessage[]>(
                        (result: IMessage[], object: EezObject) => {
                            return result.concat(checkTransformer(object));
                        },
                        [] as IMessage[]
                    );
                } else {
                    childrenMessages = checkTransformer(childObject);
                }

                return result.concat(childrenMessages);
            },
開發者ID:eez-open,項目名稱:studio,代碼行數:17,代碼來源:build.ts

示例7: getAllMetrics

export function getAllMetrics() {
    let allMetrics: any = {};

    const project = ProjectStore.project;
    let projectFeatures = getExtensionsByCategory("project-feature");
    for (let projectFeature of projectFeatures) {
        if (
            projectFeature.eezStudioExtension.implementation.projectFeature.metrics &&
            getProperty(
                project,
                projectFeature.eezStudioExtension.implementation.projectFeature.key
            )
        ) {
            let featureMetrics = projectFeature.eezStudioExtension.implementation.projectFeature.metrics(
                project
            );
            allMetrics = Object.assign(allMetrics, featureMetrics);
        }
    }

    return allMetrics;
}
開發者ID:eez-open,項目名稱:studio,代碼行數:22,代碼來源:metrics.ts


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