コード例 #1
0
        //*******************************************************************
        /// <summary>JobId変更時イベント</summary>
        /// <param name="sender">源</param>
        /// <param name="e">イベント</param>
        //*******************************************************************
        private void textBlockJobId_TargetUpdated(object sender, DataTransferEventArgs e)
        {
            bool IsTextTrimmed = false;
            var  textBlock     = sender as TextBlock;

            if (textBlock != null && textBlock.Tag != null && CheckUtil.IsLenOver(textBlock.Tag.ToString(), GetJobIdTrimLimitLength()))
            {
                IsTextTrimmed = true;
            }
            TextBlockService.SetIsTextTrimmed(textBlock, IsTextTrimmed);
        }
コード例 #2
0
        void TextBlockTextTrimmingB185312()
        {
            FrameworkElement control = ((DemoModule)DemoBaseTesting.CurrentDemoModule).DemoModuleControl.OptionsContent;

            if (control == null)
            {
                return;
            }
            List <TextBlock> editors = FindAllElements <TextBlock>(control);

            foreach (TextBlock edit in editors)
            {
                bool trimmed = TextBlockService.CalcIsTextTrimmed(edit) && edit.DesiredSize.Width > (edit.ActualWidth + edit.Margin.Left + edit.Margin.Right);
                AssertLog.IsFalse(trimmed, "Text is trimmed: " + DemoBaseTesting.CurrentDemoModule.GetType().Name + " text=" + edit.Text + ", Name=" + edit.Name +
                                  ", actual " + edit.ActualWidth + "px, desired:" + edit.DesiredSize.Width + "px");
            }
        }