internal MixedCodeDocumentFragment CreateFragment(MixedCodeDocumentFragmentType type) { switch (type) { case MixedCodeDocumentFragmentType.Code: return(new MixedCodeDocumentCodeFragment(this)); case MixedCodeDocumentFragmentType.Text: return(new MixedCodeDocumentTextFragment(this)); } throw new NotSupportedException(); }
internal MixedCodeDocumentFragment(MixedCodeDocument doc, MixedCodeDocumentFragmentType type) { Doc = doc; _type = type; switch (type) { case MixedCodeDocumentFragmentType.Text: Doc._textfragments.Append(this); break; case MixedCodeDocumentFragmentType.Code: Doc._codefragments.Append(this); break; } Doc._fragments.Append(this); }
/// <summary> /// Initializes a new instance of the <see cref="MixedCodeDocumentFragment"/> class. /// </summary> /// <param name="mixedcodedocument">The mixed code document.</param> /// <param name="type">The type.</param> internal MixedCodeDocumentFragment(MixedCodeDocument mixedcodedocument, MixedCodeDocumentFragmentType type) { this.MixedCodeDocument = mixedcodedocument; this.FragmentType = type; switch (type) { case MixedCodeDocumentFragmentType.Text: this.MixedCodeDocument.TextFragments.Append(this); break; case MixedCodeDocumentFragmentType.Code: this.MixedCodeDocument.CodeFragments.Append(this); break; } this.MixedCodeDocument.Fragments.Append(this); }
internal MixedCodeDocumentFragment CreateFragment(MixedCodeDocumentFragmentType type) { switch (type) { case MixedCodeDocumentFragmentType.Text: return new MixedCodeDocumentTextFragment(this); case MixedCodeDocumentFragmentType.Code: return new MixedCodeDocumentCodeFragment(this); default: throw new NotSupportedException(); } }