예제 #1
0
        protected virtual SwDmComponent CreateComponentInstance(ISwDMComponent dmComp)
        {
            var comp = SwDmObjectFactory.FromDispatch <SwDmComponent>(dmComp, m_OwnerAssm);

            comp.OwnerAssembly = m_OwnerAssm;
            return(comp);
        }
예제 #2
0
        protected override SwDmComponent CreateComponentInstance(ISwDMComponent dmComp)
        {
            var comp = base.CreateComponentInstance(dmComp);

            comp.Parent = m_ParentComp;
            return(comp);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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));
            });
        }