コード例 #1
0
        private void LuaFunctionCursorWatcherServiceCursorFunctionChanged(object sender, SledLuaFunctionCursorWatcherServiceEventArgs e)
        {
            // Don't care if not connected to a target
            if (m_debugService.IsDisconnected)
            {
                return;
            }

            if (m_callStackCollection == null)
            {
                return;
            }

            try
            {
                m_callStackCollection.ValidationBeginning();

                // Indicate to matching callstack function that the cursor is there
                foreach (var cs in m_callStackCollection.CallStack)
                {
                    cs.IsCursorInFunction = IsMatchingCallStackFunction(cs, e.File, e.Function);
                }

                m_callStackEditor.View = null;
                m_callStackEditor.View = m_callStackCollection;
            }
            finally
            {
                m_callStackCollection.ValidationEnded();
            }
        }
コード例 #2
0
        private void LuaFunctionCursorWatcherServiceCursorFunctionChanged(object sender, SledLuaFunctionCursorWatcherServiceEventArgs e)
        {
            try
            {
                m_bChangingSelection = true;

                // Not a project file
                if (e.File == null)
                {
                    return;
                }

                if (e.File.SledDocument == null)
                {
                    return;
                }

                // Not a document we care about
                if (e.File.SledDocument != m_sd)
                {
                    return;
                }

                // Grab any functions in the list
                var items = Items.OfType <FunctionAssoc>().ToList();

                // No functions in the list
                if (!items.Any())
                {
                    SelectedItem = null;
                    return;
                }

                // Want to make e.Function the selection so
                // find e.Function in the list of functions
                var cursor = items.FirstOrDefault(func => ReferenceEquals(func.Function, e.Function));

                // Item already selected
                if (SelectedItem == cursor)
                {
                    return;
                }

                // Update selected item to the proper function (or null)
                SelectedItem = cursor;
            }
            finally
            {
                m_bChangingSelection = false;
            }
        }