Ejemplo n.º 1
0
        private System.Drawing.Point GetDrawStringOffset(System.Drawing.Graphics CurGraphics, System.Int32 X, System.Int32 Y, System.Char CurChar)
        {
            //prntSome.printSome("GetDrawStringOffset");
            // DrawString doesn't actually print where you tell it to but instead consistently prints
            // with an offset. This is annoying when the other draw commands do not print with an offset
            // this method returns a point defining the offset so we can take it off the printstring command.

            System.Drawing.CharacterRange[] characterRanges =
            {
                new System.Drawing.CharacterRange(0, 1)
            };

            System.Drawing.RectangleF layoutRect = new System.Drawing.RectangleF(X, Y, 100, 100);

            System.Drawing.StringFormat stringFormat = new System.Drawing.StringFormat();

            stringFormat.SetMeasurableCharacterRanges(characterRanges);

            System.Drawing.Region[] stringRegions = new System.Drawing.Region[1];

            stringRegions = CurGraphics.MeasureCharacterRanges(
                CurChar.ToString(),
                this.Font,
                layoutRect,
                stringFormat);

            System.Drawing.RectangleF measureRect1 = stringRegions[0].GetBounds(CurGraphics);

            return(new System.Drawing.Point((int)(measureRect1.X + 0.5), (int)(measureRect1.Y + 0.5)));
        }
Ejemplo n.º 2
0
 virtual protected void conditionalComment(System.Char find)
 {
     System.Int32 pos = this.input.IndexOf(find, this.index);
     if (pos < 0)
     {
         pos = this.length;
     }
     this.appendComment(pos, "//", find.ToString());
 }
        void DoProcess()
        {
            if (!(owner.Value is OpenCVForUnityPlayMakerActions.Char))
            {
                owner.Value = new OpenCVForUnityPlayMakerActions.Char(new System.Char());
            }

            System.Char wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Char, System.Char>(owner);
            storeResult.Value = (string)wrapped_owner.ToString();
        }
Ejemplo n.º 4
0
 //1023
 public static System.String ConvertUint32ToString(System.UInt32 number)
 {
     System.UInt32 rank         = GetRankOf(number);
     System.UInt32 numberLength = rank + 1;
     System.Char[] result       = new System.Char[numberLength];
     for (System.UInt32 i = 0; i < numberLength; i++)
     {
         result[i] = (System.Char)(GetNumberOfDigit(number, rank)) + '0';
         rank--;
     }
     System.Console.WriteLine($"rank={rank}");
     return(result.ToString());
 }
Ejemplo n.º 5
0
        public void Add(System.Char CurChar)
        {
            //prntSome.printSome("Add");
            if (this.Count() < 1)
            {
                this.Elements.Add("0");
            }

            if (CurChar == ';')
            {
                this.Elements.Add("0");
            }
            else
            {
                int i = this.Elements.Count - 1;
                this.Elements[i] = this.Elements[i] + CurChar.ToString();
            }
        }
Ejemplo n.º 6
0
 virtual protected System.Boolean isAlNum(System.Char c)
 {
     return(c > 126 || c == '\\' || System.Text.RegularExpressions.Regex.IsMatch(c.ToString(), "^(\\w|\\$)$"));
 }
Ejemplo n.º 7
0
 public System.String ToJSON()
 {
     return("{ \"data\": " + data.ToString() + "}");
 }
Ejemplo n.º 8
0
        public void ShowChar(
            System.Drawing.Graphics CurGraphics,
            System.Char CurChar,
            System.Int32 Y,
            System.Int32 X,
            CharAttribs CurAttribs)
        {
            //prntSome.printSome("ShowChar");
            if (CurChar == '\0')
            {
                return;
            }

            System.Drawing.Color CurFGColor = System.Drawing.Color.White;
            System.Drawing.Color CurBGColor = System.Drawing.Color.Black;

            this.AssignColors(CurAttribs, ref CurFGColor, ref CurBGColor);

            if ((CurBGColor != this.BackColor && (this.Modes.Flags & uc_Mode.LightBackground) == 0) ||
                (CurBGColor != this.FGColor && (this.Modes.Flags & uc_Mode.LightBackground) > 0))
            {
                // Erase the current Character underneath the cursor postion
                this.EraseBuffer.Clear(CurBGColor);

                // paint a rectangle over the cursor position in the character's BGColor
                CurGraphics.DrawImageUnscaled(
                    this.EraseBitmap,
                    X,
                    Y);
            }

            if (CurAttribs.IsUnderscored)
            {
                CurGraphics.DrawLine(new System.Drawing.Pen(CurFGColor, 1),
                                     X, Y + this.UnderlinePos,
                                     X + this.CharSize.Width, Y + this.UnderlinePos);
            }

            /*VT220*/

            /*
             * if ((CurAttribs.IsDECSG == true) &&
             *  (CurChar == 'l' ||
             *   CurChar == 'q' ||
             *   CurChar == 'w' ||
             *   CurChar == 'k' ||
             *   CurChar == 'x' ||
             *   CurChar == 't' ||
             *   CurChar == 'n' ||
             *   CurChar == 'u' ||
             *   CurChar == 'm' ||
             *   CurChar == 'v' ||
             *   CurChar == 'j' ||
             *   CurChar == '`'))
             * {
             *  this.ShowSpecialChar (
             *      CurGraphics,
             *      CurChar,
             *      Y,
             *      X,
             *      CurFGColor,
             *      CurBGColor);
             *
             *  return;
             * }*/
            /**/
            //ANSI
            if ((CurAttribs.IsDECSG == true) &&
                (CurChar == 'Z' ||
                 CurChar == 'l' ||
                 CurChar == 'q' ||
                 CurChar == 'D' ||
                 CurChar == 'B' ||
                 CurChar == '?' ||
                 CurChar == '3' ||
                 CurChar == 'C' ||
                 CurChar == 'E' ||
                 CurChar == '4' ||
                 CurChar == '@' ||
                 CurChar == 'A' ||
                 CurChar == 'Y' ||
                 CurChar == '`'))
            {
                this.ShowSpecialChar(
                    CurGraphics,
                    CurChar,
                    Y,
                    X,
                    CurFGColor,
                    CurBGColor);

                return;
            }
            /**/
            //prntSome.add2stringrdb(CurChar.ToString());
            CurGraphics.DrawString(
                CurChar.ToString(),
                this.Font,
                new System.Drawing.SolidBrush(CurFGColor),
                X - this.DrawStringOffset.X,
                Y - this.DrawStringOffset.Y);
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Deletes a existing resource.
 /// </summary>
 /// <param name="ID">The ID of the resource to be deleted.</param>
 public void Delete(System.Char ID) => this.Delete(ID.ToString());
Ejemplo n.º 10
0
 /// <summary>
 /// Deletes a existing resource.
 /// </summary>
 /// <param name="ID">The ID of the resource to be deleted.</param>
 public async System.Threading.Tasks.Task DeleteAsync(System.Char ID) => await this.DeleteAsync(ID.ToString());
Ejemplo n.º 11
0
 /// <summary>
 /// Gets a single resource by ID.
 /// </summary>
 /// <param name="ID">The ID of the resource to show.</param>
 /// <returns>A resource represented by ID.</returns>
 public T Show(System.Char ID) => this.Show(ID.ToString());
Ejemplo n.º 12
0
 public void NvtSendWont(System.Char CurChar)
 {
     //prntSome.printSome("NvtSendWont: " + CurChar.ToString(), "montdis", countmontdisrdb);
     //countmontdisrdb++;
     DispatchMessage(this, "\xFF\xFC" + CurChar.ToString());
 }
Ejemplo n.º 13
0
 public void NvtSendSubNeg(System.Char CurChar, System.String CurString)
 {
     //prntSome.printSome("NvtSendSubNeg: " + CurChar.ToString(), "montdis", countmontdisrdb);
     //countmontdisrdb++;
     DispatchMessage(this, "\xFF\xFA" + CurChar.ToString() + "\x00" + CurString + "\xFF\xF0");
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Updates a resource partially.
 /// </summary>
 /// <param name="ID">The ID of the resource to be modified.</param>
 /// <param name="Model">The object that contains the fields and values ​​to be modified.</param>
 /// <returns>The modified resource.</returns>
 public T Modify(System.Char ID, System.Object Model) => this.Modify(ID.ToString(), Model);