Ejemplo n.º 1
0
        private void resultStatusLookUpEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            if (e.Value == null)
            {
                e.DisplayText = string.Empty;
            }
            if (controlOperationsView.IsValidRowHandle(controlOperationsView.FocusedRowHandle))
            {
                JointTestResult jointTestResult = controlOperationsView.GetRow(controlOperationsView.FocusedRowHandle) as JointTestResult;
                if (jointTestResult != null && jointTestResult.Operation != null)
                {
                    availableResults.Clear();

                    if (jointTestResult.Operation.TestHasAccepted)
                    {
                        availableResults.Add(new EnumWrapper <JointTestResultStatus>(JointTestResultStatus.Accepted));
                    }

                    if (jointTestResult.Operation.TestHasToRepair)
                    {
                        availableResults.Add(new EnumWrapper <JointTestResultStatus>(JointTestResultStatus.Repair));
                    }

                    if (jointTestResult.Operation.TestHasToWithdraw)
                    {
                        availableResults.Add(new EnumWrapper <JointTestResultStatus>(JointTestResultStatus.Withdraw));
                    }

                    resultStatusLookUpEdit.DataSource = availableResults;
                }
            }
        }
Ejemplo n.º 2
0
        void SpinEditCustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            if ((Decimal)e.Value == 0m)
            {
                return;
            }

            e.DisplayText = e.DisplayText.TrimEnd(new char[] { '0' });
            return;

            SpinEdit spinEdit;

            if ((spinEdit = sender as SpinEdit) == null)
            {
                return;
            }

            var regex = new Regex("0+$");
            var match = regex.Match(e.DisplayText);

            if (match.Success)
            {
                e.DisplayText = regex.Replace(e.DisplayText, string.Empty);
            }
        }
Ejemplo n.º 3
0
 private void lkpSoLo_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (lkpSoLo.EditValue == null)
     {
         return;
     }
 }
Ejemplo n.º 4
0
 private void secondJointElement_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     secondJointElement.Properties.Columns[0].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Number);
     secondJointElement.Properties.Columns[1].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Type);
     secondJointElement.Properties.Columns[2].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Connectors);
     secondJointElement.Properties.Columns[3].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Diameter);
 }
 private void searchLookUpEdit1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (null != e.Value)
     {
         e.DisplayText = this.shopName;
     }
 }
Ejemplo n.º 6
0
 private void PKNumber_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (viewModel != null && viewModel.NumberKP == int.MinValue)
     {
         PKNumber.Text = "";
     }
 }
Ejemplo n.º 7
0
        private void textEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            string value = string.Empty;

            if (e.Value != null)
            {
                value = e.Value.ToString();
            }
            else
            {
                value = "0";
            }

            switch (value)
            {
            case "0":
                e.DisplayText = "InActive";
                break;

            case "1":
                e.DisplayText = "Active";
                break;

            case "2":
                e.DisplayText = "Archive";
                break;

            default:
                e.DisplayText = "InActive";
                break;
            }
        }
 void Empty_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (string.IsNullOrEmpty(e.DisplayText))
     {
         e.DisplayText = "None";
     }
 }
Ejemplo n.º 9
0
        private void HandleCustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            if (e.Value == null || (e.Value is int && (int)e.Value <= 0))
            {
                e.DisplayText = GetCustomSearchEditorDisplayText(sender, null);
            }
            else
            {
                DataRow dr = null;
                if (e.Value is int)
                {
                    if (((CTechCore.Tools.CustomControls.CustomSearchEditor)sender).Properties.DataSource == null)
                    {
                        return;
                    }
                    dr = ((DataView)((CTechCore.Tools.CustomControls.CustomSearchEditor)sender).Properties.DataSource).Table.Select($"{GetCustomSearchEditor(sender)} = {(int)e.Value} ").FirstOrDefault();
                }
                else if (e.Value is DataRowView)
                {
                    dr = ((DataRowView)e.Value).Row;
                }
                else if (e.Value is DataRow)
                {
                    dr = (DataRow)e.Value;
                }
                else
                {
                }

                if (dr != null)
                {
                    e.DisplayText = GetCustomSearchEditorDisplayText(sender, dr);
                }
            }
        }
Ejemplo n.º 10
0
        public override string GetDisplayText(FormatInfo format, object editValue)
        {
            var displayText = string.Empty;
            var period      = editValue as PeriodsSet;

            if (period != null)
            {
                displayText = period.ToString(format.FormatString, SeparatorChar);
            }
            else
            {
                var s = editValue as string;
                if (s != null)
                {
                    displayText = PeriodsSet.Parse(s).ToString(format.FormatString, SeparatorChar);
                }
            }
            var e = new CustomDisplayTextEventArgs(editValue, displayText);

            if (format != EditFormat)
            {
                RaiseCustomDisplayText(e);
            }
            return(e.DisplayText);
        }
Ejemplo n.º 11
0
 public static void SetCustomDisplayText(CustomDisplayTextEventArgs e)
 {
     if (string.IsNullOrEmpty(e.DisplayText) && e.Value != null && !string.IsNullOrEmpty(e.Value.ToString()))
     {
         e.DisplayText = e.Value.ToString();
     }
 }
Ejemplo n.º 12
0
 void checkedItem_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (!IsNoneValue(e.Value) || _enumDescriptor == null)
     {
         return;
     }
     e.DisplayText = _enumDescriptor.GetCaption(e.Value);
 }
Ejemplo n.º 13
0
 private static void SetDisplayText(CustomDisplayTextEventArgs e, string displayText)
 {
     if (string.IsNullOrWhiteSpace(e.DisplayText))
     {
         e.DisplayText = displayText;
         e.Handled     = true;
     }
 }
Ejemplo n.º 14
0
 private void checkedItem_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (EnumDescriptor == null)
     {
         return;
     }
     e.DisplayText = GetCaption((Enum)e.Value);
 }
        private void RepositoryItemOnCustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            var typeInfo = XafTypesInfo.Instance.FindTypeInfo($"{e.Value}");

            if (typeInfo != null)
            {
                e.DisplayText = CaptionHelper.GetClassCaption(typeInfo.FullName);
            }
        }
 private void checkedComboBoxEdit1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (m_listBoxVehicleModel == null)
     {
         e.DisplayText = "不限";
     }
     else if (m_listBoxVehicleModel.Items[0].CheckState == CheckState.Checked)
     {
         e.DisplayText = "不限";
     }
 }
Ejemplo n.º 17
0
        private void inspectorsPopupContainerEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            if (e.Value == null)
            {
                e.DisplayText = string.Empty;
            }

            IList <Inspector> inspectors = e.Value as IList <Inspector>;

            e.DisplayText = viewModel.FormatInspectorList(inspectors);
        }
Ejemplo n.º 18
0
        private void weldersPopupContainerEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            if (e.Value == null)
            {
                e.DisplayText = string.Empty;
            }

            IList <Welder> welders = e.Value as IList <Welder>;

            e.DisplayText = viewModel.FormatWelderList(welders);
        }
Ejemplo n.º 19
0
 private void lookUpAuthor_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (e.Value == null)
     {
         return;
     }
     LibraryDataSet.AuthorRow authorRow = lds.Author.FindById((int)e.Value);
     if (authorRow == null)
     {
         return;
     }
     e.DisplayText = authorRow.FirstName + " " + authorRow.LastName;
 }
Ejemplo n.º 20
0
 private void TypeTextEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (e == null || e.Value == null)
     {
         return;
     }
     try
     {
         e.DisplayText = EventTypeReference.GetEventReference((EventTypes)e.Value);
     }catch (Exception)
     {
     }
 }
Ejemplo n.º 21
0
        private void colorPickEditMap_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            ColorPickEdit colorEdit = (sender as ColorPickEdit);

            if (colorEdit.Color.IsEmpty)
            {
                e.DisplayText = string.Empty;
            }
            else if (!colorEdit.Color.IsKnownColor)
            {
                Color color = colorEdit.Color;
                //X2 means 2 digit hex, so that F will be 0F
                e.DisplayText = String.Format("#{0:X2}{1:X2}{2:X2}", color.R, color.G, color.B);
            }
        }
Ejemplo n.º 22
0
 private void HandleDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (e.Value == null)
     {
     }
     else
     {
         if (e.Value is DataRow)
         {
             e.DisplayText = ((DataRow)e.Value).Field <string>("Name");
         }
         else
         {
         }
     }
 }
Ejemplo n.º 23
0
 static void OnProgressBarCustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     try
     {
         if (e.Value == DBNull.Value || e.Value == null)
         {
             e.DisplayText = string.Empty;
         }
         else
         {
             e.DisplayText = ((double)e.Value).ToString("F2");
         }
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 24
0
        /// <summary>
        /// Display list of selected items
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void ComboControlCustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            string captionText = string.Empty;

            foreach (CheckedListBoxItemWrapper item in comboControl.Properties.Items)
            {
                if (item.CheckState == CheckState.Checked)
                {
                    if (captionText.Length > 0)
                    {
                        captionText += ", ";
                    }
                    captionText += string.Format("{0}", item);
                }
            }
            e.DisplayText = captionText;
        }
Ejemplo n.º 25
0
        private void repositoryItemTextEdit1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            bool?gender = e.Value as bool?;

            if (gender == null)
            {
                e.DisplayText = "Herkes";
            }
            else if (gender == true)
            {
                e.DisplayText = "Erkek";
            }
            else if (gender == false)
            {
                e.DisplayText = "Kadın";
            }
        }
Ejemplo n.º 26
0
        private void resultStatusLookUpEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            JointTestResult jointTestResult = controlOperationsView.GetRow(controlOperationsView.FocusedRowHandle) as JointTestResult;

            if (e.Value != null)
            {
                JointTestResultStatus result;
                if (Enum.TryParse <JointTestResultStatus>(e.Value.ToString(), out result))
                {
                    e.DisplayText = (result == JointTestResultStatus.Undefined) ? "" : localizedResults[(int)result - 1];
                }
            }
            else
            {
                e.DisplayText = string.Empty;
            }
        }
 private void OnProgressBarCustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     try
     {
         if (e.Value == DBNull.Value || e.Value == null)
         {
             e.DisplayText = string.Empty;
         }
         else
         {
             //divide by 100 again to ensure that we show values formatted between 0 and 1
             e.DisplayText = _doubleFormatter.Format(((double)e.Value) / 100);
         }
     }
     catch (Exception)
     {
     }
 }
Ejemplo n.º 28
0
 private void searchLookUpEdit1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (FunctionHelper.GetValue(e.Value).Contains(","))
     {
         e.DisplayText = e.Value.ToString();
     }
     else
     {
         var re = GetLuValues();
         if (re[0].Count == 1)
         {
             e.DisplayText = re[1].First();
         }
         else
         {
             e.DisplayText = "";
         }
     }
 }
Ejemplo n.º 29
0
        void TextEdit3CustomDisplayText(object sender, CustomDisplayTextEventArgs customDisplayTextEventArgs)
        {
            // https://documentation.devexpress.com/#WPF/CustomDocument11336
            // https://documentation.devexpress.com/#WindowsForms/DevExpressXtraEditorsRepositoryRepositoryItem_CustomDisplayTexttopic

            if (customDisplayTextEventArgs.Value == null)
            {
                return;
            }

            var valueStr = customDisplayTextEventArgs.Value.ToString();
            var regex    = new Regex("(\\d{4})(\\d{4})(\\d{4})");
            var match    = regex.Match(valueStr);

            if (match.Success)
            {
                customDisplayTextEventArgs.DisplayText = regex.Replace(valueStr, "$1...$3");
            }
        }
Ejemplo n.º 30
0
 private void customDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (e.Value == null)
     {
         return;
     }
     try
     {
         e.DisplayText = Formatter.Format(e.Value.ConvertedTo <TPropertyType>());
     }
     //it's ok to catch formatting exception here. Message will be displayed in the errorProvider
     catch (FormatException)
     {
         e.DisplayText = string.Empty;
     }
     catch (OverflowException)
     {
         _textBox.EditValue = LastValue;
     }
 }
Ejemplo n.º 31
0
 void actionDropDown_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     var ykRow = gridView.GetFocusedDataRow();
     e.DisplayText = GetActionName(ykRow.Field<MatchState>("MatchState"), (ImportAction)e.Value);
 }
Ejemplo n.º 32
0
 private void secondJointElement_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     secondJointElement.Properties.Columns[0].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Number);
     secondJointElement.Properties.Columns[1].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Type);
     secondJointElement.Properties.Columns[2].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Connectors);
     secondJointElement.Properties.Columns[3].Caption = Program.LanguageManager.GetString(StringResources.Joint_JointElement_Diameter);
 }
Ejemplo n.º 33
0
 void checkedItem_CustomDisplayText(object sender, CustomDisplayTextEventArgs e) {
     if (!IsNoneValue(e.Value) || _enumDescriptor == null) return;
     e.DisplayText = _enumDescriptor.GetCaption(e.Value);
 }
Ejemplo n.º 34
0
        private void TypeTextEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            if (e == null || e.Value == null) return;
            try
            {
                e.DisplayText = EventTypeReference.GetEventReference((EventTypes) e.Value);
            }catch (Exception)
            {

            }
        }
Ejemplo n.º 35
0
        private void weldersPopupContainerEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            if(e.Value == null)
                e.DisplayText = string.Empty;

            IList<Welder> welders = e.Value as IList<Welder>;
            e.DisplayText = viewModel.FormatWelderList(welders);
        }
Ejemplo n.º 36
0
		private void OnCustomDisplayText(Object sender, CustomDisplayTextEventArgs e)
		{
			e.DisplayText = ((Color)e.Value).ToHex();
		}
Ejemplo n.º 37
0
 private void PKNumber_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     if (viewModel!=null && viewModel.NumberKP==int.MinValue)
     {
         PKNumber.Text = "";
     }
 }
Ejemplo n.º 38
0
 private void repositoryItemButtonEditAnswerOptions_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     e.DisplayText = "(AnswerOptionsCollection)";
 }
Ejemplo n.º 39
0
 private void ControlOperationLookUpEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     ControlOperationLookUpEdit.Columns[0].Caption = Program.LanguageManager.GetString(StringResources.Joint_OperationNameColumn);
 }
Ejemplo n.º 40
0
 private void progressBarControl1_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     double v = Convert.ToDouble(e.Value);
     e.DisplayText = v.ToString("n0");
 }
Ejemplo n.º 41
0
 private void cboFollowUpTimeStart_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     e.DisplayText = Convert.ToDateTime(e.DisplayText).ToString("HH:mm");
 }
Ejemplo n.º 42
0
        private void inspectorsPopupContainerEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
        {
            if(e.Value == null)
                e.DisplayText = string.Empty;

            IList<Inspector> inspectors = e.Value as IList<Inspector>;
            e.DisplayText = viewModel.FormatInspectorList(inspectors);
        }
Ejemplo n.º 43
0
 private void resultStatusLookUpEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     JointTestResult jointTestResult = controlOperationsView.GetRow(controlOperationsView.FocusedRowHandle) as JointTestResult;
     if(e.Value != null)
     {
         JointTestResultStatus result;
         if(Enum.TryParse<JointTestResultStatus>(e.Value.ToString(), out result))
         {
             e.DisplayText = (result == JointTestResultStatus.Undefined) ? "" : localizedResults[(int)result - 1];
         }
     }
     else
     {
         e.DisplayText = string.Empty;
     }
 }
Ejemplo n.º 44
0
 /// <summary>
 /// Display list of selected items
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void ComboControlCustomDisplayText(object sender, CustomDisplayTextEventArgs e) {
     string captionText = string.Empty;
     foreach (CheckedListBoxItem item in comboControl.Properties.Items) {
         if (item.CheckState == CheckState.Checked) {
             if (captionText.Length > 0) captionText += ", ";
             captionText += string.Format("{0}", item);
         }
     }
     e.DisplayText = captionText;
 }
Ejemplo n.º 45
0
 private void personEdit_CustomDisplayText(object sender, CustomDisplayTextEventArgs e)
 {
     var person = e.Value as Person;
     if (person != null) e.DisplayText = person.FullName;
 }