コード例 #1
0
 public void HotKeyPrefix_SetInvalid_ThrowsInvalidEnumArgumentException(HotkeyPrefix prefix)
 {
     using (var format = new StringFormat())
     {
         AssertExtensions.Throws <InvalidEnumArgumentException>("value", () => format.HotkeyPrefix = prefix);
     }
 }
コード例 #2
0
        public override void StartRenderSession(HotkeyPrefix hotKeys)
        {
            this.xae3b2752a89e7464 = TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPadding;
            if (false)
            {
                goto label_3;
            }
            else
            {
                goto label_2;
            }
label_1:
            ++this.x03bb1ee2adad51ea;
            return;

label_2:
            switch (hotKeys)
            {
            case HotkeyPrefix.None:
                break;

            case HotkeyPrefix.Hide:
                this.xae3b2752a89e7464 |= TextFormatFlags.HidePrefix;
                goto label_1;

            default:
                goto label_1;
            }
label_3:
            this.xae3b2752a89e7464 |= TextFormatFlags.NoPrefix;
            goto label_1;
        }
コード例 #3
0
 public void HotKeyPrefix_SetInvalid_ThrowsInvalidEnumArgumentException(HotkeyPrefix prefix)
 {
     using (var format = new StringFormat())
     {
         Assert.ThrowsAny <ArgumentException>(() => format.HotkeyPrefix = prefix);
     }
 }
コード例 #4
0
        public override void StartRenderSession(HotkeyPrefix hotKeys)
        {
            this.x166a89f4cd379ec8 = new SolidBrush(this.x7f2683d69c01d139);
            do
            {
                this.x7a0be2490cda8794             = new Pen(this.x228f9881a1be0e5d);
                this.x050be261498a0c97             = new Pen(this.xfca0e3085d5a7f42);
                this.x54c190ae969c389d             = new SolidBrush(this.x1da108dbfca32343);
                this.xa33e6094d9ed12d6             = new Pen(this.x9c1f2f40026567ee);
                this.x2771fbe8bb84042b             = new StringFormat(StringFormat.GenericDefault);
                this.x2771fbe8bb84042b.FormatFlags = StringFormatFlags.NoWrap;
                this.x2771fbe8bb84042b.Alignment   = StringAlignment.Center;
                if (false)
                {
                    goto label_2;
                }
            }while (false);
            goto label_5;
label_2:
            this.x2771fbe8bb84042b.HotkeyPrefix = hotKeys;
            return;

label_5:
            if (false)
            {
                return;
            }
            this.x2771fbe8bb84042b.LineAlignment = StringAlignment.Center;
            goto label_2;
        }
コード例 #5
0
 public StiStringFormatGeom(StringFormat sf)
 {
     this.Alignment     = sf.Alignment;
     this.FormatFlags   = sf.FormatFlags;
     this.HotkeyPrefix  = sf.HotkeyPrefix;
     this.LineAlignment = sf.LineAlignment;
     this.Trimming      = sf.Trimming;
 }
コード例 #6
0
ファイル: StringFormatTests.cs プロジェクト: stickybun/corefx
        public void HotKeyPrefix_SetValid_GetReturnsExpected(HotkeyPrefix prefix)
        {
            var format = new StringFormat {
                HotkeyPrefix = prefix
            };

            Assert.Equal(prefix, format.HotkeyPrefix);
        }
コード例 #7
0
		public StringFormat(StringFormatFlags options, int lang) {
			_alignment = StringAlignment.Near;
			_digitSubstituteLanguage = lang;
			_digitSubstituteMethod = StringDigitSubstitute.User;
			_flags = options;
			_hotkeyPrefix = HotkeyPrefix.None;
			_lineAlignment = StringAlignment.Near;
			_trimming = StringTrimming.Character;
		}
コード例 #8
0
 public StringFormat(StringFormatFlags options, int lang)
 {
     _alignment = StringAlignment.Near;
     _digitSubstituteLanguage = lang;
     _digitSubstituteMethod   = StringDigitSubstitute.User;
     _flags         = options;
     _hotkeyPrefix  = HotkeyPrefix.None;
     _lineAlignment = StringAlignment.Near;
     _trimming      = StringTrimming.Character;
 }
コード例 #9
0
 public bitsTextOptions(bool rightToLeft, bool lineLimit, float angle, float firstTabOffset, float distanceBetweenTabs,
                        HotkeyPrefix hotkeyPrefix, StringTrimming trimming)
 {
     this.RightToLeft         = rightToLeft;
     this.LineLimit           = lineLimit;
     this.Angle               = angle;
     this.FirstTabOffset      = firstTabOffset;
     this.DistanceBetweenTabs = distanceBetweenTabs;
     this.HotkeyPrefix        = hotkeyPrefix;
     this.Trimming            = trimming;
 }
コード例 #10
0
		public StringFormat (StringFormat source) {
			if (source == null)
				throw new ArgumentNullException("format");

			_alignment = source.LineAlignment;
			_digitSubstituteLanguage = source.DigitSubstitutionLanguage;
			_digitSubstituteMethod = source.DigitSubstitutionMethod;
			_flags = source.FormatFlags;
			_hotkeyPrefix = source.HotkeyPrefix;
			_lineAlignment = source.LineAlignment;
			_trimming = source.Trimming;
		}
コード例 #11
0
        public override JObject SaveToJsonObject(StiJsonSaveMode mode)
        {
            var jObject = base.SaveToJsonObject(mode);

            jObject.Add(new JProperty("IsGeneric", IsGeneric));
            jObject.Add(new JProperty("Alignment", Alignment.ToString()));
            jObject.Add(new JProperty("FormatFlags", FormatFlags.ToString()));
            jObject.Add(new JProperty("HotkeyPrefix", HotkeyPrefix.ToString()));
            jObject.Add(new JProperty("LineAlignment", LineAlignment.ToString()));
            jObject.Add(new JProperty("Trimming", Trimming.ToString()));

            return(jObject);
        }
コード例 #12
0
        public StringFormat(StringFormat source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("format");
            }

            _alignment = source.LineAlignment;
            _digitSubstituteLanguage = source.DigitSubstitutionLanguage;
            _digitSubstituteMethod   = source.DigitSubstitutionMethod;
            _flags         = source.FormatFlags;
            _hotkeyPrefix  = source.HotkeyPrefix;
            _lineAlignment = source.LineAlignment;
            _trimming      = source.Trimming;
        }
コード例 #13
0
            private static TextFormatFlags TranslateHotkeyPrefixForGdi(HotkeyPrefix prefix)
            {
                switch (prefix)
                {
                case HotkeyPrefix.Show:
                    return(0);

                case HotkeyPrefix.Hide:
                    return(TextFormatFlags.HidePrefix);

                case HotkeyPrefix.None:
                    return(TextFormatFlags.NoPrefix);
                }

                Debug.Fail("Unknown HotkeyPrefix");
                return(0);
            }
コード例 #14
0
	public StringFormat(StringFormat format)
			{
				if(format == null)
				{
					throw new ArgumentNullException("format");
				}
				this.options = format.options;
				this.language = format.language;
				this.alignment = format.alignment;
				this.digitMethod = format.digitMethod;
				this.hotkeyPrefix = format.hotkeyPrefix;
				this.lineAlignment = format.lineAlignment;
				this.trimming = format.trimming;
				this.ranges = format.ranges;
				this.firstTabOffset = format.firstTabOffset;
				this.tabStops = format.tabStops;
			}
コード例 #15
0
ファイル: StringFormat.cs プロジェクト: ForNeVeR/pnet
 public StringFormat(StringFormat format)
 {
     if (format == null)
     {
         throw new ArgumentNullException("format");
     }
     this.options        = format.options;
     this.language       = format.language;
     this.alignment      = format.alignment;
     this.digitMethod    = format.digitMethod;
     this.hotkeyPrefix   = format.hotkeyPrefix;
     this.lineAlignment  = format.lineAlignment;
     this.trimming       = format.trimming;
     this.ranges         = format.ranges;
     this.firstTabOffset = format.firstTabOffset;
     this.tabStops       = format.tabStops;
     this.IsTypographic  = format.IsTypographic;
 }
コード例 #16
0
        /// <summary>
        /// Creates a new object of the type StiTextOptions.
        /// </summary>
        /// <param name="rightToLeft">Horizontal output direction.</param>
        /// <param name="lineLimit">Show completed lines only.</param>
        /// <param name="wordWrap">Word wrap.</param>
        /// <param name="angle">Angle of a text rotation.</param>
        /// <param name="hotkeyPrefix">Type to draw hot keys.</param>
        /// <param name="trimming">Type to trim the end of a line.</param>
        /// <param name="firstTabOffset">First tab offset.</param>
        /// <param name="distanceBetweenTabs">Distance between tabs.</param>
        public StiTextOptions(bool rightToLeft, bool lineLimit, bool wordWrap,
                              float angle, HotkeyPrefix hotkeyPrefix, StringTrimming trimming,
                              float firstTabOffset, float distanceBetweenTabs)
        {
            this.wordWrap = wordWrap;

            if (rightToLeft == false &&
                lineLimit == false &&
                angle == 0f &&
                hotkeyPrefix == HotkeyPrefix.None &&
                trimming == StringTrimming.None &&
                firstTabOffset == 40f &&
                distanceBetweenTabs == 20f)
            {
                this.bits = null;
            }
            else
            {
                this.bits = new bitsTextOptions(rightToLeft, lineLimit, angle, firstTabOffset, distanceBetweenTabs, hotkeyPrefix, trimming);
            }
        }
コード例 #17
0
        public void StartRenderSession(HotkeyPrefix tabHotKeys)
        {
            this.xae3b2752a89e7464 = TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPadding;
            if (true)
            {
                goto label_4;
            }
label_1:
            if (true)
            {
                return;
            }
label_3:
            if (tabHotKeys != HotkeyPrefix.Hide)
            {
                return;
            }
            this.xae3b2752a89e7464 |= TextFormatFlags.HidePrefix;
            goto label_1;
label_4:
            if (tabHotKeys != HotkeyPrefix.None)
            {
                if (true)
                {
                    goto label_3;
                }
                else
                {
                    goto label_1;
                }
            }
            else
            {
                this.xae3b2752a89e7464 |= TextFormatFlags.NoPrefix;
            }
        }
コード例 #18
0
            private static TextFormatFlags TranslateHotkeyPrefixForGdi(HotkeyPrefix prefix)
            {
                switch (prefix)
                {
                    case HotkeyPrefix.Show:
                        return 0;

                    case HotkeyPrefix.Hide:
                        return TextFormatFlags.HidePrefix;

                    case HotkeyPrefix.None:
                        return TextFormatFlags.NoPrefix;
                }

                Debug.Fail("Unknown HotkeyPrefix");
                return 0;
            }
コード例 #19
0
ファイル: Gdiplus.cs プロジェクト: JianwenSun/cc
 internal static extern int GdipGetStringFormatHotkeyPrefix(HandleRef format, out HotkeyPrefix hotkeyPrefix);
コード例 #20
0
ファイル: gdipFunctions.cs プロジェクト: Profit0004/mono
		internal static extern Status GdipGetStringFormatHotkeyPrefix(IntPtr format, out HotkeyPrefix hotkeyPrefix);
コード例 #21
0
ファイル: StringDrawUtils.cs プロジェクト: ChrisMoreton/Test3
		/// <summary>
		/// Creates <see cref="CharacterFormat"/> object with implicit formatting.
		/// </summary>
		public CharacterFormat()
		{
			Font=new Font(FontFamily.GenericSansSerif,8.25f);
			Brush=new SolidBrush(Color.Black);
			Angle=0;
			HotkeyPrefix=HotkeyPrefix.Show;
			Formatted=false;
			FilledBounds=false;
			IgnoreColorFormatting=false;
		}
コード例 #22
0
 internal static extern int GdipSetStringFormatHotkeyPrefix(HandleRef format, HotkeyPrefix hotkeyPrefix);
コード例 #23
0
ファイル: RendererBase.cs プロジェクト: javagg/DemoDock
 public abstract void StartRenderSession(HotkeyPrefix hotKeys);
コード例 #24
0
ファイル: MilborneRenderer.cs プロジェクト: javagg/DemoDock
        public void StartRenderSession(HotkeyPrefix tabHotKeys)
        {
            _textFormat = TextFormatFlags.EndEllipsis | TextFormatFlags.HorizontalCenter | TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPadding;
            if (tabHotKeys == HotkeyPrefix.None)
            {
                _textFormat |= TextFormatFlags.NoPrefix;
            }
            else if (tabHotKeys == HotkeyPrefix.Hide)
            {
                _textFormat |= TextFormatFlags.HidePrefix;
            }

        }
コード例 #25
0
 /// <summary>
 /// Creates a new object of the type StiTextOptions.
 /// </summary>
 /// <param name="rightToLeft">Horizontal output direction.</param>
 /// <param name="lineLimit">Show completed lines only.</param>
 /// <param name="wordWrap">Word wrap.</param>
 /// <param name="angle">Angle of a text rotation.</param>
 /// <param name="hotkeyPrefix">Type to draw hot keys.</param>
 /// <param name="trimming">Type to trim the end of a line.</param>
 public StiTextOptions(bool rightToLeft, bool lineLimit, bool wordWrap,
                       float angle, HotkeyPrefix hotkeyPrefix, StringTrimming trimming) :
     this(rightToLeft, lineLimit, wordWrap, angle, hotkeyPrefix, trimming,
          40f, 20f)
 {
 }
コード例 #26
0
ファイル: StringDrawUtils.cs プロジェクト: ChrisMoreton/Test3
		/// <summary>
		/// Creates <see cref="CharacterFormat"/> object.
		/// </summary>
		/// <param name="f"></param>
		/// <param name="br"></param>
		/// <param name="a"></param>
		/// <param name="hp"></param>
		/// <param name="formatted"></param>
		public CharacterFormat(Font f, Brush br, float a, HotkeyPrefix hp, bool formatted)
		{
			Font = f;
			Brush = br;
			Angle = a;
			HotkeyPrefix = hp;
			Formatted = formatted;
			FilledBounds = false;
			IgnoreColorFormatting = false;
		}
コード例 #27
0
 public override void StartRenderSession(HotkeyPrefix hotKeys)
 {
     base.StartRenderSession(hotKeys);
 }
コード例 #28
0
ファイル: Office2007Renderer.cs プロジェクト: javagg/DemoDock
		public override void StartRenderSession(HotkeyPrefix hotKeys)
		{
			_textFormat = (TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPadding);
			if (hotKeys != HotkeyPrefix.None)
			{
				if (hotKeys == HotkeyPrefix.Hide)
				{
					_textFormat |= TextFormatFlags.HidePrefix;
				}
			}
			else
			{
				_textFormat |= TextFormatFlags.NoPrefix;
			}
			_sessionCount++;
		}
コード例 #29
0
ファイル: EverettRenderer.cs プロジェクト: javagg/DemoDock
		public override void StartRenderSession(HotkeyPrefix hotKeys)
		{
			_backBrush = new SolidBrush(TabStripBackgroundColor);
			pen_0 = new Pen(_shadowColor);
			pen_1 = new Pen(_highlightColor);
			solidBrush_1 = new SolidBrush(BackgroundTabForeColor);
			pen_2 = new Pen(_collapsedTabOutlineColor);
		    stringFormat_2 = new StringFormat(StringFormat.GenericDefault)
		    {
		        FormatFlags = StringFormatFlags.NoWrap,
		        Alignment = StringAlignment.Center,
		        LineAlignment = StringAlignment.Center,
		        HotkeyPrefix = hotKeys
		    };
		}
コード例 #30
0
 public abstract void StartRenderSession(HotkeyPrefix hotKeys);
コード例 #31
0
 public override void StartRenderSession(HotkeyPrefix hotKeys)
 {
     TextFormat = TextFormatFlags.EndEllipsis | TextFormatFlags.SingleLine | TextFormatFlags.VerticalCenter | TextFormatFlags.PreserveGraphicsClipping | TextFormatFlags.NoPadding;
     TextFormat |= hotKeys != HotkeyPrefix.None && hotKeys == HotkeyPrefix.Hide ? TextFormatFlags.HidePrefix : TextFormatFlags.NoPrefix;
     _sessionCount++;
 }