menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class UnaryOperationPtg - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class UnaryOperationPtg

    This class represents all unary operations.

    Inheritance
    System.Object
    Ptg
    OperationPtg
    UnaryOperationPtg
    ParenthesesPtg
    Implements
    System.ICloneable
    Inherited Members
    OperationPtg.GetOperandsSeparator(FormulaUtil)
    OperationPtg.InfillPTG(DataProvider, Int32, ExcelVersion)
    OperationPtg.IsOperation
    OperationPtg.IsPlaceAfter
    OperationPtg.NumberOfOperands
    OperationPtg.OperationSymbol
    OperationPtg.PushResultToStack(Stack<Object>)
    OperationPtg.UpdateParseOptions(ExcelParseFormulaOptions)
    Ptg.Clone()
    Ptg.CompareArrays(Ptg[], Ptg[])
    Ptg.CompareContent(Ptg)
    Ptg.CompareTo(Ptg)
    Ptg.ConvertPtgToNPtg(IWorkbook, Int32, Int32)
    Ptg.ConvertSharedToken(IWorkbook, Int32, Int32)
    Ptg.GetString16Bit(Byte[], Int32)
    Ptg.GetString16Bit(Byte[], Int32, Int32)
    Ptg.IndexToCode(FormulaToken, Int32)
    Ptg.Offset(Int32, Int32, Int32, Int32, Rectangle, Int32, Rectangle, Boolean, WorkbookImpl)
    Ptg.Offset(Int32, Int32, WorkbookImpl)
    Ptg.RectangleContains(Rectangle, Int32, Int32)
    Ptg.ToByteArray(ExcelVersion)
    Ptg.TokenCode
    Ptg.ToString()
    Ptg.ToString(FormulaUtil)
    Ptg.ToString(FormulaUtil, Int32, Int32, Boolean)
    Ptg.ToString(FormulaUtil, Int32, Int32, Boolean, NumberFormatInfo)
    Ptg.ToString(FormulaUtil, Int32, Int32, Boolean, NumberFormatInfo, Boolean, IWorksheet)
    Ptg.ToString(Int32, Int32, Boolean)
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: Syncfusion.XlsIO.Parser.Biff_Records.Formula
    Assembly: Syncfusion.XlsIO.Base.dll
    Syntax
    [Token(FormulaToken.tUnaryMinus, "-")]
    [Token(FormulaToken.tUnaryPlus, "+")]
    [Token(FormulaToken.tPercent, "%", true)]
    public class UnaryOperationPtg : OperationPtg, ICloneable

    Constructors

    UnaryOperationPtg()

    Default constructor. To prevent user from creating a token without parameters and to allow descendants do this.

    Declaration
    public UnaryOperationPtg()

    UnaryOperationPtg(DataProvider, Int32, ExcelVersion)

    Creates unary operation from the data array and offset of the first byte in it.

    Declaration
    public UnaryOperationPtg(DataProvider provider, int offset, ExcelVersion version)
    Parameters
    Type Name Description
    DataProvider provider

    Object that provides access to the data.

    System.Int32 offset

    Offset to the token data.

    ExcelVersion version

    Excel version that was used to infill data provider.

    UnaryOperationPtg(String)

    Constructs unary operation token by its string representation.

    Declaration
    public UnaryOperationPtg(string strOperationSymbol)
    Parameters
    Type Name Description
    System.String strOperationSymbol

    String representation of the operation that will be created.

    Properties

    Attributes

    Array of all token attributes applied to the object. This property is used to increase performance.

    Declaration
    protected override TokenAttribute[] Attributes { get; }
    Property Value
    Type
    TokenAttribute[]
    Overrides
    OperationPtg.Attributes

    OperationType

    Read-only. Type of operation.

    Declaration
    public override TOperation OperationType { get; }
    Property Value
    Type
    TOperation
    Overrides
    OperationPtg.OperationType

    Methods

    GetOperands(String, ref Int32, FormulaUtil)

    Returns array of operands.

    Declaration
    public override string[] GetOperands(string strFormula, ref int index, FormulaUtil formulaParser)
    Parameters
    Type Name Description
    System.String strFormula

    Formula string.

    System.Int32 index

    Index of unary operation in the formula string.

    FormulaUtil formulaParser

    Formula parser.

    Returns
    Type Description
    System.String[]

    Array of strings that contain unary operation operands.

    Overrides
    OperationPtg.GetOperands(String, ref Int32, FormulaUtil)

    GetSize(ExcelVersion)

    Read-only. Size of the token.

    Declaration
    public override int GetSize(ExcelVersion version)
    Parameters
    Type Name Description
    ExcelVersion version
    Returns
    Type
    System.Int32
    Overrides
    Ptg.GetSize(ExcelVersion)

    GetTokenId(String)

    Gets token code using unary operation string representation.

    Declaration
    public static FormulaToken GetTokenId(string operationSign)
    Parameters
    Type Name Description
    System.String operationSign

    String representation of the unary operation.

    Returns
    Type Description
    FormulaToken

    Token code.

    PushResultToStack(FormulaUtil, Stack<Object>, Boolean)

    Takes all needed operands from the stack and pushes the result of the operation.

    Declaration
    public override void PushResultToStack(FormulaUtil formulaUtil, Stack<object> operands, bool isForSerialization)
    Parameters
    Type Name Description
    FormulaUtil formulaUtil

    Object used for formula parsing.

    System.Collections.Generic.Stack<System.Object> operands

    Stack that contains all operands and will receive the result of the operation.

    System.Boolean isForSerialization
    Overrides
    OperationPtg.PushResultToStack(FormulaUtil, Stack<Object>, Boolean)

    ToString(FormulaUtil, Int32, Int32, Boolean, NumberFormatInfo, Boolean)

    Converts token to a string.

    Declaration
    public override string ToString(FormulaUtil formulaUtil, int iRow, int iColumn, bool bR1C1, NumberFormatInfo numberFormat, bool isForSerialization)
    Parameters
    Type Name Description
    FormulaUtil formulaUtil

    Formula util.

    System.Int32 iRow

    Zero-based row index of the cell that contains this token.

    System.Int32 iColumn

    Zero-based row index of the cell that contains this token.

    System.Boolean bR1C1

    Indicates whether R1C1 notation should be used.

    System.Globalization.NumberFormatInfo numberFormat
    System.Boolean isForSerialization
    Returns
    Type Description
    System.String

    String representation of this token.

    Overrides
    OperationPtg.ToString(FormulaUtil, Int32, Int32, Boolean, NumberFormatInfo, Boolean)

    Implements

    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved