I am using a set of third-party controls, and I am considering using the extension method to set some properties that are required almost anytime when this control is used in the application.
Is it good to use extension methods for this kind of use? Why or why not?
For more details, the third-party library is DevExpress, and the extension method that I want to write will disable all customization and editing on a specific control.
Therefore, instead of writing
barManager.AllowCustomization = false; barManager.AllowMoveBarOnToolbar = false; barManager.AllowQuickCustomization = false; barManager.AllowShowToolbarsPopup = false; barManager.AutoSaveInRegistry = false; foreach (Bar bar in barManager.Bars) { bar.OptionsBar.DrawDragBorder = false; }
I could write
barManager.DisableEditing();
source share