Esempio n. 1
0
    public static void Bind(IntPtr L)
    {
        objectWrap.Register(L);
        ObjectWrap.Register(L);
        coroutineWrap.Register(L);
        TypeWrap.Register(L);
        TimeWrap.Register(L);
        Vector2Wrap.Register(L);
        Vector3Wrap.Register(L);
        GameObjectWrap.Register(L);
        ComponentWrap.Register(L);
        BehaviourWrap.Register(L);
        TransformWrap.Register(L);
        MonoBehaviourWrap.Register(L);
        ApplicationWrap.Register(L);
        KeyframeWrap.Register(L);
        AnimationCurveWrap.Register(L);
        TestToLuaWrap.Register(L);
        TestEnumWrap.Register(L);
        SpaceWrap.Register(L);
        LightWrap.Register(L);
        LightTypeWrap.Register(L);
        MotionWrap.Register(L);
        AnimationClipWrap.Register(L);

        WrapSpriteRenderer.Register(L);
        WrapText.Register(L);
        WrapToggle.Register(L);
        WrapList_int.Register(L);
        WrapList_string.Register(L);
        WrapDictionary.Register(L);
        WrapDictEnumerator.Register(L);
    }
Esempio n. 2
0
        public static void AddColumnHeaderToSheet(
            ref Worksheet ws,
            int columnNumber,
            int columnWidth,
            int headerRow,
            string headerTitle  = "",
            int headerFontSize  = cHeaderFontSize,
            MakeBold headerBold = MakeBold.Yes,
            XlUnderlineStyle headerUnderline   = XlUnderlineStyle.xlUnderlineStyleNone,
            WrapText headerWrapText            = WrapText.Yes,
            XlHAlign headerHorizontalAlignment = XlHAlign.xlHAlignGeneral,
            int headerOrientation = 0)
        {
            Range column = (Range)ws.Columns[columnNumber];

            column.ColumnWidth = columnWidth;

            if (!string.IsNullOrEmpty(headerTitle))
            {
                Range header = (Range)ws.Cells[headerRow, columnNumber];
                header.Value               = headerTitle;
                header.Font.Size           = headerFontSize;
                header.Font.Bold           = headerBold;
                header.Font.Underline      = headerUnderline;
                header.WrapText            = headerWrapText;
                header.HorizontalAlignment = headerHorizontalAlignment;
                header.Orientation         = headerOrientation;
            }
        }
Esempio n. 3
0
        public TextStyle(
            [NotNull] IUIFont font,
            Color textColor,
            Color?backgroundColor = null,
            Color outlineColor    = new Color(),
            float outlineRadius   = 0,
            Alignment alignment   = Alignment.Start,
            bool underlined       = false,
            bool strikeThrough    = false,
            WrapText wrapText     = WrapText.Auto)
        {
            if (font == null)
            {
                throw new ArgumentNullException(nameof(font));
            }

            Font            = font;
            TextColor       = textColor;
            BackgroundColor = backgroundColor;
            OutlineColor    = outlineColor;
            OutlineRadius   = outlineRadius;
            Underlined      = underlined;
            StrikeThrough   = strikeThrough;
            WrapText        = wrapText;
            Alignment       = alignment;
        }
Esempio n. 4
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = (int)VerticalAligment;
         hashCode = (hashCode * 397) ^ (int)HorizontalAligment;
         hashCode = (hashCode * 397) ^ WrapText.GetHashCode();
         return(hashCode);
     }
 }
Esempio n. 5
0
 public override int GetHashCode()
 {
     return((Int32)Horizontal
            ^ (Int32)Vertical
            ^ Indent
            ^ JustifyLastLine.GetHashCode()
            ^ (Int32)ReadingOrder
            ^ RelativeIndent
            ^ ShrinkToFit.GetHashCode()
            ^ TextRotation
            ^ WrapText.GetHashCode());
 }
        public override int GetHashCode()
        {
            int hashCode = 253911835;

            hashCode = hashCode * -1521134295 + HorizontalAlignment.GetHashCode();
            hashCode = hashCode * -1521134295 + VerticalAlignment.GetHashCode();
            hashCode = hashCode * -1521134295 + HasBorder.GetHashCode();
            hashCode = hashCode * -1521134295 + WrapText.GetHashCode();
            hashCode = hashCode * -1521134295 + BackgroundColor.GetHashCode();
            hashCode = hashCode * -1521134295 + Font.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(DataFormat);

            return(hashCode);
        }
Esempio n. 7
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = Border.GetHashCode();
         result = (result * 397) ^ Font.GetHashCode();
         result = (result * 397) ^ Format.GetHashCode();
         result = (result * 397) ^ VerticalAlignment.GetHashCode();
         result = (result * 397) ^ HorizontalAlignment.GetHashCode();
         result = (result * 397) ^ Fill.GetHashCode();
         result = (result * 397) ^ WrapText.GetHashCode();
         return(result);
     }
 }
Esempio n. 8
0
 public static void AddContentToCell(Range rng, string text,
                                     int fontSize  = 10,
                                     MakeBold bold = MakeBold.No,
                                     XlUnderlineStyle underline   = XlUnderlineStyle.xlUnderlineStyleNone,
                                     WrapText wrapText            = WrapText.No,
                                     XlHAlign horizontalAlignment = XlHAlign.xlHAlignGeneral)
 {
     rng.Value               = text;
     rng.Font.Size           = fontSize;
     rng.Font.Bold           = (int)bold;
     rng.Font.Underline      = underline;
     rng.WrapText            = (int)wrapText;
     rng.HorizontalAlignment = horizontalAlignment;
     //rng.NumberFormat = "MM/DD/YYYY";
 }
        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. 10
0
        public static void AddColumnToSheet(
            ref Worksheet ws,
            int columnNumber,
            int columnWidth,
            bool columnWrapText,
            string columnNumberFormat,
            XlDirection shiftDirection,
            XlInsertFormatOrigin insertFormatOrigin,
            int headerRow,
            string headerTitle  = "",
            int headerFontSize  = cHeaderFontSize,
            MakeBold headerBold = MakeBold.Yes,
            XlUnderlineStyle headerUnderline   = XlUnderlineStyle.xlUnderlineStyleSingle,
            WrapText headerWrapText            = WrapText.Yes,
            XlHAlign headerHorizontalAlignment = XlHAlign.xlHAlignCenter,
            int headerOrientation = 0)
        {
            // Insert the new column and apply things that pertain to all cells in the column
            //((Range)ws.Columns[columnNumber]).Insert(Shift: shiftDirection, CopyOrigin: insertFormatOrigin);

            Range newColumn = (Range)ws.Columns[columnNumber];

            newColumn.Insert(Shift: shiftDirection, CopyOrigin: insertFormatOrigin);
            newColumn.WrapText     = columnWrapText;
            newColumn.NumberFormat = columnNumberFormat;

            // Pass all the rest on
            AddColumnHeaderToSheet(ref ws,
                                   columnNumber,
                                   columnWidth,
                                   headerRow,
                                   headerTitle,
                                   headerFontSize,
                                   headerBold,
                                   headerUnderline,
                                   headerWrapText,
                                   headerHorizontalAlignment,
                                   headerOrientation);
        }
Esempio n. 11
0
 protected bool Equals(Aligment other)
 {
     return(VerticalAligment == other.VerticalAligment && HorizontalAligment == other.HorizontalAligment && WrapText.Equals(other.WrapText));
 }
Esempio n. 12
0
        private void Update(EvaluationContext context)
        {
            var text       = Text.GetValue(context);
            var bufferSize = BufferSize.GetValue(context);
            var wrapText   = WrapText.GetValue(context);
            var textOffset = TextOffset.GetValue(context);

            var columns = bufferSize.Width;
            var rows    = bufferSize.Height;

            if (columns <= 0 || rows <= 0)
            {
                return;
            }

            if (string.IsNullOrEmpty(text))
            {
                return;
            }

            var textCycle = (int)textOffset.X + (int)(textOffset.Y) * columns;

            var size = rows * columns;

            if (_bufferContent == null || _bufferContent.Length != size)
            {
                _bufferContent = new BufferLayout[size];
            }

            var index = 0;

            char c;
            var  highlightChars = HighlightCharacters.GetValue(context);

            for (var rowIndex = 0; rowIndex < rows; rowIndex++)
            {
                for (var columnIndex = 0; columnIndex < columns; columnIndex++)
                {
                    if (wrapText)
                    {
                        var i = (index + textCycle) % text.Length;
                        if (i < 0)
                        {
                            i += text.Length;
                        }

                        c = text[i];
                    }
                    else
                    {
                        var i            = index + textCycle;
                        var indexIsValid = i >= 0 && i < text.Length;
                        c = indexIsValid ? text[i] : ' ';
                    }

                    var highlight = highlightChars.IndexOf(c) > -1 ? 1f : 0;      // oh, that's slow!

                    _bufferContent[index] = new BufferLayout(
                        pos: new Vector2((float)columnIndex / columns, 1 - (float)rowIndex / rows),
                        uv: new Vector2(c % 16, (c >> 4)),
                        highlight: highlight);

                    index++;
                }
            }

            ResourceManager.Instance().SetupStructuredBuffer(_bufferContent, ref Buffer.Value);
            Buffer.Value.DebugName = nameof(TypoGridBuffer);

            VertexCount.Value = size * 6;
        }
 public override int GetHashCode()
 {
     return(FontSize.GetHashCode() ^ FontName.GetHashCode() ^ FontBold.GetHashCode() ^ FontColor.GetHashCode() ^ FGColor.GetHashCode() ^ Borders[0].GetHashCode() ^ Borders[1].GetHashCode() ^ Borders[2].GetHashCode() ^ Borders[3].GetHashCode() ^ CellWidth.GetHashCode() ^ CellHeight.GetHashCode() ^ HorizontalAlignment.GetHashCode() ^ VerticalAlignment.GetHashCode() ^ WrapText.GetHashCode());
 }