Beispiel #1
0
        internal void EndDispatch(SwDocument doc)
        {
            lock (m_Lock)
            {
                m_DocsDispatchQueue.Remove(doc);

                var index = m_ModelsDispatchQueue.FindIndex(d => m_Comparer.Equals(d, doc.Model));

                if (index != -1)
                {
                    m_ModelsDispatchQueue.RemoveAt(index);
                }

                if (doc is SwUnknownDocument)
                {
                    doc = (SwDocument)(doc as SwUnknownDocument).GetSpecific();
                }

                Dispatched?.Invoke(doc);

                if (!m_DocsDispatchQueue.Any())
                {
                    DispatchAllModels();
                }
            }
        }
Beispiel #2
0
        internal void EndDispatch(SwDocument doc)
        {
            lock (m_Lock)
            {
                m_DocsDispatchQueue.Remove(doc);

                var index = m_ModelsDispatchQueue.FindIndex(d => m_Comparer.Equals(d, doc.Model));

                if (index != -1)
                {
                    m_Logger.Log($"Removing '{doc.Title}' from the dispatch queue");

                    m_ModelsDispatchQueue.RemoveAt(index);
                }

                if (doc.IsCommitted)
                {
                    if (doc is SwUnknownDocument)
                    {
                        doc = (SwDocument)(doc as SwUnknownDocument).GetSpecific();
                    }
                    else
                    {
                        doc.AttachEvents();
                    }

                    NotifyDispatchedSafe(doc);
                }

                if (!m_DocsDispatchQueue.Any())
                {
                    DispatchAllModels();
                }
            }
        }
Beispiel #3
0
        internal SwModelViewTab(ModelViewTabCreator <TControl> ctrlCreator,
                                ModelViewManager modelViewManager, SwDocument doc, ISwApplication app, IXLogger logger) : base(doc, app, logger)
        {
            m_CtrlCreator = ctrlCreator;

            m_ModelViewMgr = modelViewManager;
        }
        internal SwCustomPropertiesCollection(SwDocument doc, string confName)
        {
            m_Doc = doc;

            m_EventsHelper = new CustomPropertiesEventsHelper(doc.App.Sw, doc);

            m_ConfName = confName;
        }
        internal SwConfigurationCustomPropertiesCollection(SwDocument doc, string confName) : base(doc)
        {
            m_EventsHelper = new CustomPropertiesEventsHelper(doc.App.Sw, doc);

            m_ConfName = confName;

            m_EventsHandlers = new List <EventsHandler <PropertyValueChangedDelegate> >();
        }
Beispiel #6
0
 private void NotifyDispatchedSafe(SwDocument doc)
 {
     try
     {
         m_Logger.Log($"Dispatched '{doc.Title}'", LoggerMessageSeverity_e.Debug);
         Dispatched?.Invoke(doc);
     }
     catch (Exception ex)
     {
         m_Logger.Log($"Unhandled exception while dispatching the document '{doc.Title}'", LoggerMessageSeverity_e.Error);
         m_Logger.Log(ex);
     }
 }
Beispiel #7
0
 private void NotifyDispatchedSafe(SwDocument doc)
 {
     try
     {
         m_Logger.Log($"Dispatched '{doc.Title}'");
         Dispatched?.Invoke(doc);
     }
     catch (Exception ex)
     {
         m_Logger.Log($"Unhandled exception while dispatching the document '{doc.Title}'");
         m_Logger.Log(ex);
     }
 }
Beispiel #8
0
        internal void EndDispatch(SwDocument doc)
        {
            lock (m_Lock)
            {
                m_DocsDispatchQueue.Remove(doc);

                var index = m_ModelsDispatchQueue.FindIndex(
                    d => string.Equals(d.Path, doc.Path, StringComparison.CurrentCultureIgnoreCase) ||
                    string.Equals(d.Title, doc.Title, StringComparison.CurrentCultureIgnoreCase));

                if (index != -1)
                {
                    m_Logger.Log($"Removing '{doc.Title}' from the dispatch queue", LoggerMessageSeverity_e.Debug);

                    m_ModelsDispatchQueue.RemoveAt(index);
                }
                else
                {
                    m_Logger.Log($"Document '{doc.Title}' is not in the dispatch queue", LoggerMessageSeverity_e.Warning);
                }

                if (doc.IsCommitted)
                {
                    if (doc is SwUnknownDocument)
                    {
                        doc = (SwDocument)(doc as SwUnknownDocument).GetSpecific();
                    }
                    else
                    {
                        doc.AttachEvents();
                    }

                    NotifyDispatchedSafe(doc);
                }

                if (!m_DocsDispatchQueue.Any())
                {
                    DispatchAllModels();
                }
            }
        }
Beispiel #9
0
        internal SwFeatureMgrTab(FeatureManagerTabCreator <TControl> ctrlCreator, SwDocument doc, IXLogger logger)
            : base(doc, logger)
        {
            m_ModelViewMgr = doc.Model.ModelViewManager;
            m_CtrlCreator  = ctrlCreator;

            switch (doc.Model)
            {
            case PartDoc part:
                part.FeatureManagerTabActivatedNotify += OnFeatureManagerTabActivated;
                break;

            case AssemblyDoc assm:
                assm.FeatureManagerTabActivatedNotify += OnFeatureManagerTabActivated;
                break;

            case DrawingDoc drw:
                drw.FeatureManagerTabActivatedNotify += OnFeatureManagerTabActivated;
                break;
            }
        }
Beispiel #10
0
 internal void BeginDispatch(SwDocument doc)
 {
     m_DocsDispatchQueue.Add(doc);
 }
 internal NewSelectionEventHandler(SwDocument doc) : base(doc)
 {
 }
 internal StreamWriteAvailableEventsHandler(SwDocument doc) : base(doc)
 {
     m_Doc = doc;
 }
Beispiel #13
0
 internal SwMacroFeature(SwDocument doc, IFeatureManager featMgr, IFeature feat, bool created)
     : base(doc, feat, created)
 {
     m_Doc     = doc;
     m_FeatMgr = featMgr;
 }
Beispiel #14
0
 internal SwFeatureManager(SwDocument doc)
 {
     Document       = doc;
     m_ParamsParser = new MacroFeatureParametersParser(doc.App.Sw);
 }
Beispiel #15
0
 internal SwFeatureMgrTab(FeatureManagerTabCreator <TControl> ctrlCreator, SwDocument doc, ISwApplication app, IXLogger logger)
     : base(doc, app, logger)
 {
     m_ModelViewMgr = doc.Model.ModelViewManager;
     m_CtrlCreator  = ctrlCreator;
 }
 protected SwCustomPropertiesCollection(SwDocument doc, ISwApplication app)
 {
     m_Doc = doc;
     m_App = app;
 }
Beispiel #17
0
 internal SwFeatureManager(SwDocument doc, ISwApplication app)
 {
     m_App          = app;
     Document       = doc;
     m_ParamsParser = new MacroFeatureParametersParser(app);
 }
Beispiel #18
0
 internal SwFeatureManager(SwDocument model, IFeatureManager featMgr, ISldWorks app)
 {
     m_Model        = model;
     m_ParamsParser = new MacroFeatureParametersParser(app);
     m_FeatMgr      = featMgr;
 }
 protected SwCustomPropertiesCollection(SwDocument doc)
 {
     m_Doc = doc;
 }
Beispiel #20
0
 internal StreamWriteAvailableEventsHandler(SwDocument doc, ISwApplication app) : base(doc, app)
 {
 }
Beispiel #21
0
 internal SwDocumentDimensionsCollection(SwDocument model)
 {
     m_Doc = model;
 }
Beispiel #22
0
 internal SwMacroFeature(IFeature feat, SwDocument doc, ISwApplication app, bool created)
     : base(feat, doc, app, created)
 {
     m_FeatMgr = doc.Model.FeatureManager;
 }
 internal SwFileCustomPropertiesCollection(SwDocument doc, ISwApplication app) : base("", doc, app)
 {
 }
Beispiel #24
0
 internal NewSelectionEventHandler(SwDocument doc, ISwApplication app) : base(doc, app)
 {
 }
 internal StreamReadAvailableEventsHandler(SwDocument doc) : base(doc)
 {
     m_Doc = doc;
     m_Is3rdPartyStreamLoaded = false;
 }
 internal DocumentSavingEventHandler(SwDocument doc, ISwApplication app) : base(doc, app)
 {
 }
 internal SwFileCustomPropertiesCollection(SwDocument doc) : base(doc, "")
 {
 }
Beispiel #28
0
 internal DocumentRebuildEventsHandler(SwDocument doc, ISwApplication app) : base(doc, app)
 {
 }
Beispiel #29
0
 internal StorageReadAvailableEventsHandler(SwDocument doc, ISwApplication app) : base(doc, app)
 {
     m_Is3rdPartyStorageLoaded = false;
 }
Beispiel #30
0
 internal SwMacroFeature(SwDocument model, IFeatureManager featMgr, IFeature feat, bool created)
     : base(model.Model, feat, created)
 {
     m_Model   = model;
     m_FeatMgr = featMgr;
 }