Dev2.Runtime.Configuration.ComponentModel.SettingsObjectAttribute.SettingsObjectAttribute C# (CSharp) Method

SettingsObjectAttribute() public method

public SettingsObjectAttribute ( Type view, Type viewModel ) : System
view System.Type
viewModel System.Type
return System
        public SettingsObjectAttribute(Type view, Type viewModel)
        {
            if (!CheckInheretenceHierarchy(view, typeof(UserControl)))
            {
                throw new Exception("View type must inherit from UserControl.");
            }

            if (view.GetConstructor(Type.EmptyTypes) == null)
            {
                throw new Exception("View type must contain a parameterless contructor.");
            }

            if (!CheckInheretenceHierarchy(viewModel, typeof(SettingsViewModelBase)))
            {
                throw new Exception("ViewModel type must inherit from SettingsViewModelBase.");
            }

            if (viewModel.GetConstructor(Type.EmptyTypes) == null)
            {
                throw new Exception("ViewModel type must contain a parameterless contructor.");
            }
            
            View = view;
            ViewModel = viewModel;
        }