internal SwComponent(IComponent2 comp, SwAssembly rootAssembly) : base(comp) { m_RootAssembly = rootAssembly; Component = comp; Children = new SwChildComponentsCollection(rootAssembly, comp); m_Features = new Lazy <ISwFeatureManager>(() => new ComponentFeatureRepository(rootAssembly, comp)); Bodies = new SwComponentBodyCollection(comp, rootAssembly); m_FilePathResolver = m_RootAssembly.App.Services.GetService <IFilePathResolver>(); }
internal SwComponent(IComponent2 comp, SwAssembly parentAssembly) : base(comp) { m_ParentAssembly = parentAssembly; Component = comp; Children = new SwChildComponentsCollection(parentAssembly, comp); Features = new ComponentFeatureRepository(parentAssembly, comp); Bodies = new SwComponentBodyCollection(comp, parentAssembly); m_FilePathResolver = m_ParentAssembly.App.Services.GetService <IFilePathResolver>(); }
internal SwComponent(IComponent2 comp, SwAssembly rootAssembly, ISwApplication app) : base(comp, rootAssembly, app) { m_RootAssembly = rootAssembly; Component = comp; Children = new SwChildComponentsCollection(rootAssembly, this); m_FeaturesLazy = new Lazy <ISwFeatureManager>(() => new SwComponentFeatureManager(this, rootAssembly, app)); m_DimensionsLazy = new Lazy <ISwDimensionsCollection>(() => new SwFeatureManagerDimensionsCollection(Features)); m_MathUtils = app.Sw.IGetMathUtility(); Bodies = new SwComponentBodyCollection(comp, rootAssembly); m_FilePathResolver = ((SwApplication)OwnerApplication).Services.GetService <IFilePathResolver>(); }
private void AttachDocument(IModelDoc2 model) { if (!m_Documents.ContainsKey(model)) { SwDocument doc = null; switch (model) { case IPartDoc part: doc = new SwPart(part, m_App, m_Logger); break; case IAssemblyDoc assm: doc = new SwAssembly(assm, m_App, m_Logger); break; case IDrawingDoc drw: doc = new SwDrawing(drw, m_App, m_Logger); break; default: throw new NotSupportedException(); } doc.Destroyed += OnDocumentDestroyed; m_Documents.Add(model, doc); DocumentCreated?.Invoke(doc); } else { m_Logger.Log($"Conflict. {model.GetTitle()} already registered"); Debug.Assert(false, "Document was not unregistered"); } }
internal SwAssemblyConfiguration(IConfiguration conf, SwAssembly assm, ISwApplication app, bool created) : base(conf, assm, app, created) { Components = new SwAssemblyComponentCollection(assm, conf); }
internal SwAssemblyConfiguration(SwAssembly assm, IConfiguration conf, bool created) : base(assm, conf, created) { Components = new SwAssemblyComponentCollection(assm, conf); }