public SwPropertyManagerPage(ISldWorks app, IPageSpec pageSpec, ILogger logger, Type handlerType)
        {
            m_App = app;

            Logger = logger;

            m_IconsConv = new IconsConverter();

            //TODO: validate that handlerType inherits PropertyManagerPageHandlerEx and it is COM visible with parameterless constructor
            Handler = (SwPropertyManagerPageHandler)Activator.CreateInstance(handlerType);

            Handler.DataChanged += OnDataChanged;
            Handler.Closed      += OnClosed;
            Handler.Closing     += OnClosing;
            m_PmpBuilder         = new PropertyManagerPageBuilder(app, m_IconsConv, Handler, pageSpec, Logger);
        }
Esempio n. 2
0
        internal SwPropertyManagerPage(ISwApplication app, IPageSpec pageSpec, IServiceProvider svcProvider, SwPropertyManagerPageHandler handler,
                                       CreateDynamicControlsDelegate createDynCtrlHandler)
        {
            m_App = app;

            m_IsDisposed = false;

            m_SvcProvider = svcProvider;

            m_Logger = m_SvcProvider.GetService <IXLogger>();

            m_IconsConv = m_SvcProvider.GetService <IIconsCreator>();

            //TODO: validate that handler is COM visible
            Handler = handler;

            Handler.Closed  += OnClosed;
            Handler.Closing += OnClosing;
            m_PmpBuilder     = new PropertyManagerPageBuilder(app, m_IconsConv, Handler, pageSpec, m_Logger);

            m_ContextProvider = new BaseContextProvider();

            m_Page = m_PmpBuilder.CreatePage <TModel>(createDynCtrlHandler, m_ContextProvider);

            var ctrls = new List <IPropertyManagerPageElementEx>();

            foreach (var binding in m_Page.Binding.Bindings)
            {
                binding.Changed += OnBindingValueChanged;

                var ctrl = binding.Control;

                if (ctrl is IPropertyManagerPageElementEx)
                {
                    ctrls.Add((IPropertyManagerPageElementEx)ctrl);
                }
                else
                {
                    m_Logger.Log($"Unrecognized control type: {ctrl?.GetType().FullName}", XCad.Base.Enums.LoggerMessageSeverity_e.Error);
                }
            }

            Controls = ctrls.ToArray();
        }
Esempio n. 3
0
        internal SwPropertyManagerPage(ISwApplication app, IPageSpec pageSpec, IXLogger logger, Type handlerType)
        {
            m_App = app;

            Logger = logger;

            m_IconsConv = new IconsConverter();

            //TODO: validate that handlerType inherits PropertyManagerPageHandlerEx and it is COM visible with parameterless constructor
            Handler = (SwPropertyManagerPageHandler)Activator.CreateInstance(handlerType);

            Handler.DataChanged += OnDataChanged;
            Handler.Closed      += OnClosed;
            Handler.Closing     += OnClosing;
            m_PmpBuilder         = new PropertyManagerPageBuilder(app, m_IconsConv, Handler, pageSpec, Logger);

            m_Page   = m_PmpBuilder.CreatePage <TModel>();
            Controls = m_Page.Binding.Bindings.Select(b => b.Control)
                       .OfType <IPropertyManagerPageControlEx>().ToArray();
        }
Esempio n. 4
0
 public OffsetWithFillet(ISldWorks app)
 {
     m_App        = app;
     m_PmpBuilder = new PropertyManagerPageBuilder <OffsetWithFilletPageEventHandler>(m_App);
     m_Data       = new OffsetWithFilletData();
 }