Ejemplo n.º 1
0
 /// <summary>
 /// An event handler called when the <see cref="CodeModelManager" /> raises a <see
 /// cref="CodeModelManager.CodeModelBuilt" /> event. If the code model was built for the
 /// document currently being shown by Spade, the raw code items will be processed and displayed.
 /// </summary>
 /// <param name="codeModel">The code model.</param>
 private void OnCodeModelBuilt(CodeModel codeModel)
 {
     //真正刷新当前码锹窗口列表的代码
     if (Document == codeModel.Document)
     {
         UpdateViewModelRawCodeItems(codeModel.CodeItems);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Raises the <see cref="CodeModelBuilt" /> event.
        /// </summary>
        /// <param name="codeModel">The code model.</param>
        private void RaiseCodeModelBuilt(CodeModel codeModel)
        {
            var codeModelBuilt = CodeModelBuilt;

            if (codeModelBuilt != null)
            {
                OutputWindowHelper.DiagnosticWriteLine(
                    $"CodeModelManager.CodeModelBuilt raised for '{codeModel.Document.FullName}'");

                codeModelBuilt(codeModel);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads all lazy initialized values for items within the code model.
        /// </summary>
        /// <param name="codeModel">The code model.</param>
        private void LoadLazyInitializedValues(CodeModel codeModel)
        {
            try
            {
                OutputWindowHelper.DiagnosticWriteLine(
                    $"CodeModelManager.LoadLazyInitializedValues for '{codeModel.Document.FullName}'");

                foreach (var codeItem in codeModel.CodeItems)
                {
                    codeItem.LoadLazyInitializedValues();
                }
            }
            catch (Exception ex)
            {
                OutputWindowHelper.ExceptionWriteLine(
                    $"Unable to load lazy initialized values for '{codeModel.Document.FullName}'", ex);
            }
        }