Exemplo n.º 1
0
 public void SetModel(RichText richText, EditRefList sourcesEditor)
 {
     _richText = richText;
     _sourcesEditor = sourcesEditor;
     if (richText.Source != null)
         SetModel(richText.Source, sourcesEditor != null);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public ReferenceEditor(bool readOnly, RichText text)
        {
            InitializeComponent();

            // Add handlers for window availability events
            AddWindowAvailabilityHandlers();

            DataContext = this;

            richText = text;

            if (readOnly)
            {
                btnAdd.Visibility = Visibility.Hidden;
                btnRemove.Visibility = Visibility.Hidden;
            }
        }
Exemplo n.º 3
0
 public static void Edit(RichText text, bool readOnly)
 {
     var refEdit = new ReferenceEditor(readOnly, text);
     refEdit.ShowDialog();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the RichText EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRichText(RichText richText)
 {
     base.AddObject("RichText", richText);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Create a new RichText object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="text">Initial value of the Text property.</param>
 public static RichText CreateRichText(global::System.Int32 id, global::System.String text)
 {
     RichText richText = new RichText();
     richText.Id = id;
     richText.Text = text;
     return richText;
 }
Exemplo n.º 6
0
        public static void AddSource(RichText r)
        {
            if (r == null)
                return;

            var dlg = new SourceDialog();
            dlg.ShowDialog();

            if (dlg.Source == null)
                return;

            DaoUtils.AddSource(dlg.Source, r);
        }
Exemplo n.º 7
0
        public static void AddSource(string newSrc, RichText richText)
        {
            if (richText == null)
                return;

            Source src = new Source();
            src.Text = newSrc;
            richText.Source.Add(src);
        }