public XLSXImporterProxy( ICoreObject cpu, ISynchronizeInvoke synchronizer = null) { if (synchronizer == null) { Synchronizer = cpu.GetSynchronizer(); } else { Synchronizer = synchronizer; } TiaStarter.RunInSynchronizer(Synchronizer, () => { XLSXImporter = new XLSXImporter(cpu.GetTagService(), MassDataHandler.CreateWorkbook(null), cpu.GetDefaultTagTable(Synchronizer), XLSXImportExportOptions.IncludeTags | XLSXImportExportOptions.IncludeConstants, cpu.GetFolderService(), cpu.GetCommandProcessor(), null, null, cpu.GetNameService(), cpu.GetRangeCheck()); }); }
/// <summary> /// 取得变量表文件夹 /// </summary> /// <param name="cpu">控制器</param> public static ICoreObject GetTagsFolder(this ICoreObject cpu, ISynchronizeInvoke synchronizer = null) { ISynchronizeInvoke UsingSynchronizer; if (synchronizer == null) { UsingSynchronizer = cpu.GetSynchronizer(); } else { UsingSynchronizer = synchronizer; } return(TiaStarter.RunInSynchronizer(UsingSynchronizer, (c) => { IFolderService folderService = cpu.GetFolderService(); IObjectTypeInfo tagTableType = GetTagTableType(cpu); return folderService.GetAppropriateFolder(cpu, tagTableType, false); }, cpu) as ICoreObject); }