ParagraphBase

Namespace: Spire.Doc
We found 10 examples in language CSharp for this search. You will see 20 fragments of code.

        internal void method_22(ParagraphItemCollection A_0)
        {
            int num = 0;
            int count = base.Count;
            while (num < count)
            {
                ParagraphBase base2 = (ParagraphBase) this[num].Clone();
                if (base2 != null)
                {
                    base2.method_0(A_0.Owner);
                    A_0.method_25(base2);
                }
                num++;
            }
        }


        private void method_32(Paragraph A_0, int A_1, IParagraphBase A_2)
        {
            A_0.Items.Insert(A_1, A_2);
            (A_2 as ParagraphBase).method_0(A_0);
            this.Items.Add(A_2);
        }

        private void method_40(Paragraph A_0)
        {
            foreach (ParagraphBase base2 in A_0.Items)
            {
                this.Items.Add(base2);
            }
        }


    private void method_5(Paragraph A_0, int A_1, int A_2, out ParagraphBase A_3)
    {
        smethod_5(A_0.Items, A_1, A_2, out A_3);
    }

    private static void smethod_4(SDTInlineContent A_0, int A_1, int A_2, out ParagraphBase A_3)
    {
        smethod_5(A_0.Items, A_1, A_2, out A_3);
    }

    private static void smethod_7(ParagraphItemCollection A_0, int A_1, int A_2)
    {
        int num = A_1;
        int count = A_0.Count;
        while (num < count)
        {
            ParagraphBase base2 = A_0[num];
            base2.StartPos += A_2;
            num++;
        }
    }


    private bool method_6(ParagraphBase A_0, int A_1)
    {
        if (!(A_0 is TextRange))
        {
            return false;
        }
        string text = ((TextRange) A_0).Text;
        if (((A_1 != 0) || (A_0.PreviousSibling != null)) && !(A_0.NextSibling is FieldMark))
        {
            return ((A_1 == (text.Length - 1)) && (A_0.NextSibling == null));
        }
        return true;
    }


    bool ParagraphBase.Accept(Class420 A_0)
    {
        return base.method_9(A_0);
    }

    object ParagraphBase.CloneImpl()
    {
        Class5 class2 = (Class5) base.Clone();
        class2.m_charFormat = (CharacterFormat) base.m_charFormat.Clone();
        class2.class18_0 = (Class18) this.class18_0.Clone();
        return class2;
    }


    bool ParagraphBase.Accept(Class420 A_0)
    {
        return base.method_12(A_0.vmethod_50(this));
    }


        internal override bool HasTrackedChanges()
        {
            if ((base.IsInsertRevision || base.IsDeleteRevision) || (base.IsChangedCFormat || base.IsChangedPFormat))
            {
                return true;
            }
            foreach (ParagraphBase base2 in this.m_pItemColl)
            {
                if (base2.method_26())
                {
                    return true;
                }
            }
            return false;
        }

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using ASMC.Core.Model;
using ASMC.Data.Model;
using FastMember;
using NLog;

namespace ASMC.Common.Helps
{
    public sealed class DialogOperationHelp : BasicOperation<bool>
    {
        private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation">Операция</param>
        /// <param name="nameFile">Имя файла </param>
        /// <param name="findProjectFile">Проект в котором следует искать файл</param>
        public DialogOperationHelp(IUserItemOperationBase operation, string nameFile, Assembly findProjectFile=null)
        {
            Logger.Debug([email protected]"Указан файл для загрузки {nameFile} и будет поиск в папке сборке {findProjectFile?? Assembly.GetExecutingAssembly()}");
            Expected = true;
            IsGood = () => Equals(Expected, Getting);
            InitWorkAsync = () =>
            {
                var accessor = TypeAccessor.Create(operation.GetType());
                var service = ((IUserItemOperation)accessor[operation, nameof(ParagraphBase<object>.UserItemOperation)]).ServicePack.QuestionText(); 
                service.Title = operation.Name;
                service.Entity = new Tuple<string, Assembly>(nameFile, findProjectFile);
                //Bug необходима отмена операции
                if (service.Show() != true)
                {
                    Logger.Info([email protected]"Операция {operation.Name} была отменена");
                    return default;
                }
                var res = service.Entity as Tuple<string, bool>;
                Logger.Debug([email protected]"{this} {res.Item2} {res.Item1}");
                Getting = res.Item2;
                Comment = res.Item1;
                operation.IsGood = Getting;
                return Task.CompletedTask;
            };
            this.CompliteWorkAsync = () => Task.FromResult(true);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="operation"></param>
        /// <param name="initWork">Функция результат которой будет учитыватся в значении Getting</param>
        /// <param name="nameFile">Имя файла </param>
        /// <param name="findProjectFile">Проект в котором следует искать файл</param>
        public DialogOperationHelp(IUserItemOperationBase operation, Func<Task<bool>> initWork, string nameFile,
            Assembly findProjectFile = null)
        {
            Logger.Debug([email protected]"Указан файл для загрузки {nameFile} и будет поиск в папке сборке {findProjectFile ?? Assembly.GetExecutingAssembly()}");
            Expected = true;
            IsGood = () => Equals(Expected, Getting);
            InitWorkAsync = async () =>
            {
                var accessor = TypeAccessor.Create(operation.GetType());
                var service = ((IUserItemOperation)accessor[operation, nameof(ParagraphBase<object>.UserItemOperation)]).ServicePack.QuestionText();
                service.Title = operation.Name;
                service.Entity = new Tuple<string, Assembly>(nameFile, findProjectFile);
                //Bug необходима отмена операции
                if (service.Show() != true)
                {
                    Logger.Info([email protected]"Операция {operation.Name} была отменена");
                    return;
                }
                var res = service.Entity as Tuple<string, bool>;

             
                var resinit = await initWork();
                Logger.Debug([email protected]"{this} {res?.Item2} {res?.Item1} Функция вернула результат {resinit}");
                Getting = res.Item2 && resinit;
                Comment = res.Item1;
                operation.IsGood = Getting;
            };
            this.CompliteWorkAsync = () => Task.FromResult(true);
        }
    }
}


        internal ParagraphBase method_23()
        {
            if (this.ChildObjects.Count == 0)
            {
                return null;
            }
            return (this.ChildObjects.FirstItem.ChildObjects.FirstItem as ParagraphBase);
        }

        internal ParagraphBase method_24()
        {
            if (this.ChildObjects.Count == 0)
            {
                return null;
            }
            return (this.ChildObjects.LastItem.ChildObjects.LastItem as ParagraphBase);
        }


        internal override bool Accept(Class420 visitor)
        {
            return base.method_9(visitor);
        }

        public void ApplyCharacterFormat(Spire.Doc.Formatting.CharacterFormat charFormat)
        {
            if (charFormat != null)
            {
                this.m_charFormat = charFormat.method_23() as Spire.Doc.Formatting.CharacterFormat;
                this.m_charFormat.method_0(this);
            }
        }

        public void ApplyStyle(string styleName)
        {
            int num = 10;
            Class11 style = base.Document.Styles.FindByName(styleName, StyleType.CharacterStyle) as Class11;
            if ((style == null) && (styleName.ToLower() == BookmarkStart.b("启圱刳圵䴷嘹䠻ḽ〿⍁㙃❅⽇㡉ⵋ㹍㡏牑㉓㥕㙗⹙", num)))
            {
                style = (Class11) Style.CreateBuiltinStyle(BuiltinStyle.DefaultParagraphFont, base.Document);
                base.Document.Styles.Add(style);
            }
            if (style == null)
            {
                throw new ArgumentException(BookmarkStart.b("匯娱唳䐵夷夹䠻嬽㈿扁㝃㉅ㅇ♉⥋湍㍏㍑㩓癕㙗㕙⡛繝ɟݡ䑣eݧὩɫ੭幯", num));
            }
            this.method_23(style);
        }

        internal virtual void Attach(Paragraph owner, int itemPos)
        {
            int num = 14;
            if (owner == null)
            {
                throw new ArgumentNullException(BookmarkStart.b("嬳䄵嘷弹主", num));
            }
            if (owner != this.OwnerParagraph)
            {
                throw new InvalidOperationException();
            }
            if (this.ItemDetached)
            {
                throw new InvalidOperationException();
            }
            if (this.OwnerParagraph.BreakCharacterFormat.BaseFormat != null)
            {
                this.CharacterFormat.ApplyBase(this.OwnerParagraph.BreakCharacterFormat.BaseFormat);
            }
            this.StartPos = itemPos;
        }

        internal virtual void Attach(SDTInlineContent owner, int itemPos)
        {
            int num = 1;
            if (owner == null)
            {
                throw new ArgumentNullException(BookmarkStart.b("䠦帨䔪䠬崮", num));
            }
            if (this.ItemDetached)
            {
                throw new InvalidOperationException();
            }
            if (owner.OwnerParagraph.BreakCharacterFormat.BaseFormat != null)
            {
                this.CharacterFormat.ApplyBase(owner.OwnerParagraph.BreakCharacterFormat.BaseFormat);
            }
            this.StartPos = itemPos;
        }

        protected override object CloneImpl()
        {
            ParagraphBase base2 = (ParagraphBase) base.CloneImpl();
            if (this.m_charFormat != null)
            {
                base2.m_charFormat = new Spire.Doc.Formatting.CharacterFormat(base.Document);
                base2.m_charFormat.ImportContainer(this.m_charFormat);
                base2.m_charFormat.method_21(this.m_charFormat);
                base2.m_charFormat.method_0(base2);
            }
            base2.interface23_0 = null;
            return base2;
        }

Spire.Doc.Fields.ParagraphBase : IDocumentSerializable, IDocumentObject, sprᩘ, IParagraphBase, spr℗, spr↮

Methods :

public DocumentObjectCollection get_ChildObjects()
public Paragraph get_OwnerParagraph()
public Boolean get_IsInsertRevision()
public Boolean get_IsDeleteRevision()
public EditRevision get_DeleteRevision()
public EditRevision get_InsertRevision()
public String get_StyleName()
public CharacterFormat get_CharacterFormat()
public Void ApplyCharacterFormat(CharacterFormat charFormat = )
public Void ApplyStyle(String styleName = )
public IDocumentObject GetPreviousWidgetSibling()
public IDocumentObject GetNextWidgetSibling()
public abstract DocumentObjectType get_DocumentObjectType()
public DocumentObject get_Owner()
public IDocumentObject get_PreviousSibling()
public IDocumentObject get_NextSibling()
public Boolean get_IsComposite()
public DocumentObject get_FirstChild()
public DocumentObject get_LastChild()
public DocumentObject Clone()
public String ToString(String seperator = )
public Document get_Document()
public Type GetType()
public String ToString()
public Boolean Equals(Object obj = )
public Int32 GetHashCode()

Other methods