コード例 #1
0
        /// <summary>
        ///     Refreshes the data
        /// </summary>
        public virtual void RefreshData()
        {
            SuspendLayout();

            ITextualExplain explainable = Instance as ITextualExplain;

            if (explainable != null)
            {
                string text = TextualExplanationUtils.GetText(explainable, true);

                if (text != null)
                {
                    if (text != _lastExplanation)
                    {
                        _lastExplanation = text;
                        Text             = text;
                    }
                }
                else
                {
                    _lastExplanation = "";
                    Text             = "";
                }
            }
            else
            {
                _lastExplanation = "";
                Text             = "";
            }

            ResumeLayout();
        }
コード例 #2
0
 /// <summary>
 ///     Sets the more information according to the displayed model
 /// </summary>
 private void SetMoreInfo()
 {
     ModelElement.DontRaiseError(() =>
     {
         moreInfoRichTextBox.Text       = "";
         ITextualExplain textualExplain = DisplayedModel as ITextualExplain;
         if (textualExplain != null)
         {
             moreInfoRichTextBox.Instance = DisplayedModel;
             moreInfoRichTextBox.Text     = TextualExplanationUtils.GetText(textualExplain, true);
         }
         Refresh();
     });
 }