public IAlignmentSpecification WithReadingOrder(ReadingOrder readingOrder)
 {
     return(new AlignmentSpecification(this)
     {
         ReadingOrder = readingOrder
     });
 }
Esempio n. 2
0
        public Tick(IStreamReader reader, GraphRecordNumber id, ushort length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.tktMajor = (MarkLocation)reader.ReadByte();
            this.tktMinor = (MarkLocation)reader.ReadByte();
            this.tlt      = (MarkLabelLocation)reader.ReadByte();
            this.wBkgMode = (BackgroundMode)reader.ReadByte();
            this.rgb      = new RGBColor(reader.ReadInt32(), RGBColor.ByteOrder.RedFirst);
            reader.ReadBytes(16); // rerserved
            ushort flags = reader.ReadUInt16();

            this.fAutoCo       = Utils.BitmaskToBool(flags, 0x1);
            this.fAutoMode     = Utils.BitmaskToBool(flags, 0x2);
            this.rot           = (TextRotation)Utils.BitmaskToInt(flags, 0x1C);
            this.fAutoRot      = Utils.BitmaskToBool(flags, 0x10);
            this.iReadingOrder = (ReadingOrder)Utils.BitmaskToInt(flags, 0xC000);
            this.icv           = reader.ReadUInt16();
            this.trot          = reader.ReadUInt16();

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
Esempio n. 3
0
 private void Navigate(NavigationItemViewModel navigationItemViewModel)
 {
     navigationItemViewModel.IsTreeItemExpanded = true;
     if (navigationItemViewModel.IsLink)
     {
         Navigate(ReadingOrder.FirstOrDefault(htmlContentFile => htmlContentFile.HtmlFilePath == navigationItemViewModel.FilePath));
         CurrentAnchor = navigationItemViewModel.Anchor;
     }
 }
Esempio n. 4
0
        /// <summary>See <see cref="ElementTypeDescriptor.GetComponentName"/>.</summary>
        public override string GetComponentName()
        {
            Reading      reading      = ModelElement;
            ReadingOrder readingOrder = reading.ReadingOrder;

            if (readingOrder != null)
            {
                // UNDONE: Localize the format string
                return(string.Format(CultureInfo.InvariantCulture, "{0} {1}{2}", readingOrder.FactType.Name, ResourceStrings.ReadingType, readingOrder.ReadingCollection.IndexOf(reading) + 1));
            }
            return(base.GetComponentName());
        }
Esempio n. 5
0
 public XlsxAlignment(Horizontal horizontal = Horizontal.General, Vertical vertical = Vertical.Bottom,
                      int indent            = 0, bool justifyLastLine = false, ReadingOrder readingOrder = ReadingOrder.ContextDependent,
                      bool shrinkToFit      = false, int textRotation = 0, bool wrapText                 = false)
 {
     HorizontalType   = horizontal;
     VerticalType     = vertical;
     Indent           = indent;
     JustifyLastLine  = justifyLastLine;
     ReadingOrderType = readingOrder;
     ShrinkToFit      = shrinkToFit;
     TextRotation     = textRotation;
     WrapText         = wrapText;
 }
        public override int GetHashCode()
        {
            var hashCode = -596887160;

            hashCode = hashCode * -1521134295 + Horizontal.GetHashCode();
            hashCode = hashCode * -1521134295 + Vertical.GetHashCode();
            hashCode = hashCode * -1521134295 + Indent.GetHashCode();
            hashCode = hashCode * -1521134295 + JustifyLastLine.GetHashCode();
            hashCode = hashCode * -1521134295 + ReadingOrder.GetHashCode();
            hashCode = hashCode * -1521134295 + RelativeIndent.GetHashCode();
            hashCode = hashCode * -1521134295 + ShrinkToFit.GetHashCode();
            hashCode = hashCode * -1521134295 + TextRotation.GetHashCode();
            hashCode = hashCode * -1521134295 + WrapText.GetHashCode();
            hashCode = hashCode * -1521134295 + TopToBottom.GetHashCode();
            return(hashCode);
        }
Esempio n. 7
0
        public override int GetHashCode()
        {
            unchecked
            {
                int hash = 19;

                hash = hash * 29 + Horizontal.GetHashCode();
                hash = hash * 29 + Vertical.GetHashCode();
                hash = hash * 29 + Wrap.GetHashCode();
                hash = hash * 29 + ReadingOrder.GetHashCode();
                hash = hash * 29 + TextRotation?.GetHashCode() ?? 0;
                hash = hash * 29 + Indent?.GetHashCode() ?? 0;
                hash = hash * 29 + RelativeIndent?.GetHashCode() ?? 0;
                hash = hash * 29 + JustifyLastLine?.GetHashCode() ?? 0;
                hash = hash * 29 + Shrink?.GetHashCode() ?? 0;
                hash = hash * 29 + MergeCell?.GetHashCode() ?? 0;

                return(hash);
            }
        }
Esempio n. 8
0
        public Text(IStreamReader reader, RecordType id, UInt16 length)
            : base(reader, id, length)
        {
            // assert that the correct record type is instantiated
            Debug.Assert(this.Id == ID);

            // initialize class members from stream
            this.at       = (HorizontalAlignment)reader.ReadByte();
            this.vat      = (VerticalAlignment)reader.ReadByte();
            this.wBkgMode = (BackgroundMode)reader.ReadUInt16();
            this.rgbText  = new RGBColor(reader.ReadInt32(), RGBColor.ByteOrder.RedFirst);
            this.x        = reader.ReadInt32();
            this.y        = reader.ReadInt32();
            this.dx       = reader.ReadInt32();
            this.dy       = reader.ReadInt32();
            UInt16 flags = reader.ReadUInt16();

            this.fAutoColor = Utils.BitmaskToBool(flags, 0x1);
            this.fShowKey   = Utils.BitmaskToBool(flags, 0x2);
            this.fShowValue = Utils.BitmaskToBool(flags, 0x4);
            // 0x8 is unused
            this.fAutoText  = Utils.BitmaskToBool(flags, 0x10);
            this.fGenerated = Utils.BitmaskToBool(flags, 0x20);
            this.fDeleted   = Utils.BitmaskToBool(flags, 0x40);
            this.fAutoMode  = Utils.BitmaskToBool(flags, 0x80);
            // 0x100, 0x200, 0x400 are unused
            this.fShowLabelAndPerc = Utils.BitmaskToBool(flags, 0x800);
            this.fShowPercent      = Utils.BitmaskToBool(flags, 0x1000);
            this.fShowBubbleSizes  = Utils.BitmaskToBool(flags, 0x2000);
            this.fShowLabel        = Utils.BitmaskToBool(flags, 0x4000);
            //0x8000 is reserved
            this.icvText = reader.ReadUInt16();
            UInt16 values = reader.ReadUInt16();

            this.dlp           = Utils.BitmaskToInt(values, 0xF);
            this.iReadingOrder = (ReadingOrder)Utils.BitmaskToInt(values, 0xC000);
            this.trot          = reader.ReadUInt16();

            // assert that the correct number of bytes has been read from the stream
            Debug.Assert(this.Offset + this.Length == this.Reader.BaseStream.Position);
        }
Esempio n. 9
0
 private void Navigate(HtmlContentFileViewModel targetHtmlContentFileViewModel)
 {
     if (targetHtmlContentFileViewModel == null)
     {
         CurrentHtmlContentFile  = null;
         previousHtmlContentFile = null;
         nextHtmlContentFile     = null;
     }
     else if (CurrentHtmlContentFile != targetHtmlContentFileViewModel)
     {
         CurrentHtmlContentFile = targetHtmlContentFileViewModel;
         int currentReadingOrderItemIndex = ReadingOrder.IndexOf(CurrentHtmlContentFile);
         if (currentReadingOrderItemIndex != -1)
         {
             if (currentReadingOrderItemIndex > 0)
             {
                 previousHtmlContentFile = ReadingOrder[currentReadingOrderItemIndex - 1];
             }
             else
             {
                 previousHtmlContentFile = null;
             }
             if (currentReadingOrderItemIndex < ReadingOrder.Count - 1)
             {
                 nextHtmlContentFile = ReadingOrder[currentReadingOrderItemIndex + 1];
             }
             else
             {
                 nextHtmlContentFile = null;
             }
         }
         else
         {
             previousHtmlContentFile = null;
             nextHtmlContentFile     = null;
         }
     }
     NotifyPropertyChanged(nameof(IsPreviousButtonVisible));
     NotifyPropertyChanged(nameof(IsNextButtonVisible));
 }
Esempio n. 10
0
 public Alignment(
     HorizontalAlignment horizontal,
     VerticalAlignment vertical,
     bool wrapText,
     ReadingOrder readingOrder,
     uint?textRotation    = null,
     uint?indent          = null,
     int?relativeIndent   = null,
     bool?justifyLastLine = null,
     bool?shrinkToFit     = null,
     string mergeCell     = null)
 {
     Horizontal      = horizontal;
     Vertical        = vertical;
     Wrap            = wrapText;
     ReadingOrder    = readingOrder;
     TextRotation    = textRotation;
     Indent          = indent;
     RelativeIndent  = relativeIndent;
     JustifyLastLine = justifyLastLine;
     Shrink          = shrinkToFit;
     MergeCell       = mergeCell;
 }
Esempio n. 11
0
 public static string ToSerialString(this ReadingOrder value) => value switch
 {