GetFullExceptionMessage() public static method

public static GetFullExceptionMessage ( Exception ex ) : string
ex System.Exception
return string
        private void UnWireSelectionEvent()
        {
            try
            {
                if (m_naWindowEventSource == null)
                {
                    return;
                }

                if (m_mapEventSource == null)
                {
                    return;
                }

                ((ESRI.ArcGIS.Carto.IActiveViewEvents_Event)(m_mapEventSource)).SelectionChanged -= m_ActiveViewEventsSelectionChanged;
                m_mapEventSource = null;

                SubsetHelperUI.ClearEIDArrayParameterValues(m_nax, SubsetHelperUI.SelectionEIDArrayBaseName);
            }
            catch (Exception ex)
            {
                string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
                MessageBox.Show(msg, "UnWire Selection Event");
            }
        }
        private void UnWireGraphicsEvents()
        {
            try
            {
                if (m_naWindowEventSource == null)
                {
                    return;
                }

                if (m_graphicsEventSource == null)
                {
                    return;
                }

                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).AllElementsDeleted -= m_AllGraphicsDeleted;
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).ElementAdded       -= m_GraphicAdded;
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).ElementDeleted     -= m_GraphicDeleted;
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).ElementsAdded      -= m_GraphicsAdded;
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).ElementUpdated     -= m_GraphicUpdated;

                m_graphicsEventSource = null;

                SubsetHelperUI.ClearEIDArrayParameterValues(m_nax, SubsetHelperUI.GraphicsEIDArrayBaseName);
            }
            catch (Exception ex)
            {
                string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
                MessageBox.Show(msg, "UnWire Graphics Events");
            }
        }
        private void WireSelectionEvent()
        {
            try
            {
                if (m_naWindowEventSource == null)
                {
                    return;
                }

                if (m_mapEventSource != null)
                {
                    UnWireSelectionEvent();
                }

                m_mapEventSource = ActiveMap;
                if (m_mapEventSource == null)
                {
                    return;
                }

                UpdateSelectionEIDArrayParameterValues();

                //Create an instance of the delegate, add it to SelectionChanged event
                m_ActiveViewEventsSelectionChanged = new ESRI.ArcGIS.Carto.IActiveViewEvents_SelectionChangedEventHandler(OnActiveViewEventsSelectionChanged);
                ((ESRI.ArcGIS.Carto.IActiveViewEvents_Event)(m_mapEventSource)).SelectionChanged += m_ActiveViewEventsSelectionChanged;
            }
            catch (Exception ex)
            {
                string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
                MessageBox.Show(msg, "Wire Selection Event");
            }
        }
        private void WireEvents()
        {
            try
            {
                if (m_naWindowEventSource != null)
                {
                    UnWireEvents();
                }

                m_naWindowEventSource = ((m_nax != null) ? m_nax.NAWindow : null) as INAWindow;
                if (m_naWindowEventSource == null)
                {
                    return;
                }

                //Create an instance of the delegate, add it to OnActiveAnalysisChanged event
                m_ActiveAnalysisChanged = new ESRI.ArcGIS.NetworkAnalystUI.INAWindowEvents_OnActiveAnalysisChangedEventHandler(OnActiveAnalysisChanged);
                ((ESRI.ArcGIS.NetworkAnalystUI.INAWindowEvents_Event)(m_naWindowEventSource)).OnActiveAnalysisChanged += m_ActiveAnalysisChanged;

                WireSelectionEvent();
                WireGraphicsEvents();
            }
            catch (Exception ex)
            {
                string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
                MessageBox.Show(msg, "Wire Events");
            }
        }
        private void WireGraphicsEvents()
        {
            try
            {
                if (m_naWindowEventSource == null)
                {
                    return;
                }

                if (m_graphicsEventSource != null)
                {
                    UnWireGraphicsEvents();
                }

                IMap           activeMap     = ActiveMap;
                IGraphicsLayer graphicsLayer = null;
                if (activeMap != null)
                {
                    graphicsLayer = activeMap.BasicGraphicsLayer;
                }

                if (graphicsLayer != null)
                {
                    m_graphicsEventSource = (IGraphicsContainer)graphicsLayer;
                }

                if (m_graphicsEventSource == null)
                {
                    return;
                }

                UpdateGraphicsEIDArrayParameterValues();

                //Create an instance of the delegate, add it to AllElementsDeleted event
                m_AllGraphicsDeleted = new ESRI.ArcGIS.Carto.IGraphicsContainerEvents_AllElementsDeletedEventHandler(OnAllGraphicsDeleted);
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).AllElementsDeleted += m_AllGraphicsDeleted;

                //Create an instance of the delegate, add it to ElementAdded event
                m_GraphicAdded = new ESRI.ArcGIS.Carto.IGraphicsContainerEvents_ElementAddedEventHandler(OnGraphicAdded);
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).ElementAdded += m_GraphicAdded;

                //Create an instance of the delegate, add it to ElementDeleted event
                m_GraphicDeleted = new ESRI.ArcGIS.Carto.IGraphicsContainerEvents_ElementDeletedEventHandler(OnGraphicDeleted);
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).ElementDeleted += m_GraphicDeleted;

                //Create an instance of the delegate, add it to ElementsAdded event
                m_GraphicsAdded = new ESRI.ArcGIS.Carto.IGraphicsContainerEvents_ElementsAddedEventHandler(OnGraphicsAdded);
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).ElementsAdded += m_GraphicsAdded;

                //Create an instance of the delegate, add it to ElementUpdated event
                m_GraphicUpdated = new ESRI.ArcGIS.Carto.IGraphicsContainerEvents_ElementUpdatedEventHandler(OnGraphicUpdated);
                ((ESRI.ArcGIS.Carto.IGraphicsContainerEvents_Event)(m_graphicsEventSource)).ElementUpdated += m_GraphicUpdated;
            }
            catch (Exception ex)
            {
                string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
                MessageBox.Show(msg, "Wire Graphics Events");
            }
        }
        private void UnWireEvents()
        {
            try
            {
                if (m_naWindowEventSource == null)
                {
                    return;
                }

                UnWireSelectionEvent();
                UnWireGraphicsEvents();

                ((ESRI.ArcGIS.NetworkAnalystUI.INAWindowEvents_Event)(m_naWindowEventSource)).OnActiveAnalysisChanged -= m_ActiveAnalysisChanged;
                m_naWindowEventSource = null;
            }
            catch (Exception ex)
            {
                string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
                MessageBox.Show(msg, "UnWire Events");
            }
        }
        public static void ClearEIDArrayParameterValues(INetworkAnalystExtension nax, string baseName)
        {
            try
            {
                INAWindow       naWindow  = nax.NAWindow;
                INALayer        naLayer   = null;
                INAContext      naContext = null;
                INetworkDataset nds       = null;

                naLayer = naWindow.ActiveAnalysis;
                if (naLayer != null)
                {
                    naContext = naLayer.Context;
                }

                if (naContext != null)
                {
                    nds = naContext.NetworkDataset;
                }

                if (nds == null)
                {
                    return;
                }

                VarType       vt          = SubsetHelperUI.GetEIDArrayParameterType();
                List <string> sourceNames = SubsetHelperUI.FindParameterizedSourceNames(nds, baseName, vt);

                SubsetHelperUI.ClearEIDArrayParameterValues(nax, sourceNames, baseName);
                SubsetHelperUI.PushParameterValuesToNetwork(nax);
            }
            catch (Exception ex)
            {
                string msg = SubsetHelperUI.GetFullExceptionMessage(ex);
                MessageBox.Show(msg, "Clear Network Element Array Parameters");
            }
        }