protected virtual SwDmComponent CreateComponentInstance(ISwDMComponent dmComp) { var comp = SwDmObjectFactory.FromDispatch <SwDmComponent>(dmComp, m_OwnerAssm); comp.OwnerAssembly = m_OwnerAssm; return(comp); }
protected override SwDmComponent CreateComponentInstance(ISwDMComponent dmComp) { var comp = base.CreateComponentInstance(dmComp); comp.Parent = m_ParentComp; return(comp); }
protected virtual SwDmComponent CreateComponentInstance(ISwDMComponent dmComp) { var compName = ((ISwDMComponent7)dmComp).Name2; if (!m_ComponentsCache.TryGetValue(compName, out SwDmComponent comp)) { comp = SwDmObjectFactory.FromDispatch <SwDmComponent>(dmComp, m_ParentAssm); m_ComponentsCache.Add(compName, comp); } return(comp); }
internal SwDmComponent(SwDmAssembly parentAssm, ISwDMComponent comp) : base(comp) { Component = comp; m_ParentAssm = parentAssm; m_FilePathResolver = new SwDmFilePathResolver(); m_PathLazy = new Lazy <string>(() => { var rootDir = System.IO.Path.GetDirectoryName(OwnerAssembly.Path); return(m_FilePathResolver.ResolvePath(rootDir, CachedPath)); }); }