There is a need to set a text mask for two components of different types. Each of them supports this feature. I want to solve this with one method. I have never used it before, I think it's time to explore universal methods. I write this:
public static void SetDocNumMask<T>(int id_doctype, ref T ctrl) { ctrl.Mask.MaskType = DevExpress.XtraEditors.Mask.MaskType.Simple; ctrl.Mask.EditMask = new string('0', 9); } Studio swears at the word Mask
This is a list of how it can be found. or an assembly assembly?)
I call the method in two places
Mask.SetDocNumMask<DevExpress.XtraEditors.ComboBoxEdit>(doc_type, ref cbDocNum); Mask.SetDocNumMask< DevExpress.XtraEditors.Repository.RepositoryItemTextEdit>(id_doctype, ref repForDocNum); What am I doing wrong?
Tcan be any. Even to those who do not have theMaskproperty, so the compiler quite rightly says that it is impossible to do this. - Grundy