Exemple #1
0
        /// <summary>
        /// Initializes static members of the <see cref="UserControlLogic" /> class.
        /// </summary>
        static UserControlLogic()
        {
            ApiCop.RegisterRule(new UnusedFeatureApiCopRule("UserControlLogic.InfoBarMessageControl", "The InfoBarMessageControl is not found in the visual tree. This will have a negative impact on performance. Consider setting the SkipSearchingForInfoBarMessageControl or DefaultSkipSearchingForInfoBarMessageControlValue to true.", ApiCopRuleLevel.Error,
                                                            "http://docs.catelproject.com/vnext/faq/performance-considerations.htm"));

            ApiCop.RegisterRule(new UnusedFeatureApiCopRule("UserControlLogic.CreateWarningAndErrorValidator", "The InfoBarMessageControl is not found in the visual tree. Only use this feature in combination with the InfoBarMessageControl or a customized class which uses the WarningAndErrorValidator. Consider setting the CreateWarningAndErrorValidatorForViewModel or DefaultCreateWarningAndErrorValidatorForViewModelValue to false.", ApiCopRuleLevel.Error,
                                                            "http://docs.catelproject.com/vnext/faq/performance-considerations.htm"));

            ApiCop.RegisterRule(new UnusedFeatureApiCopRule("UserControlLogic.SupportParentViewModelContainers", "No parent IViewModelContainer is found in the visual tree. Only use this feature when there are parent IViewModelContainer instances. Consider setting the SupportParentViewModelContainers to false.", ApiCopRuleLevel.Error,
                                                            "http://docs.catelproject.com/vnext/faq/performance-considerations.htm"));

            DefaultSupportParentViewModelContainersValue = true;
            DefaultUnloadBehaviorValue = UnloadBehavior.SaveAndCloseViewModel;

#if NET || NETCORE
            DefaultCreateWarningAndErrorValidatorForViewModelValue = true;
#endif
        }
Exemple #2
0
        /// <summary>
        /// Initializes static members of the <see cref="UserControlLogic" /> class.
        /// </summary>
        static UserControlLogic()
        {
            ApiCop.RegisterRule(new UnusedFeatureApiCopRule("UserControlLogic.InfoBarMessageControl", "The InfoBarMessageControl is not found in the visual tree. This will have a negative impact on performance. Consider setting the SkipSearchingForInfoBarMessageControl or DefaultSkipSearchingForInfoBarMessageControlValue to true.", ApiCopRuleLevel.Error,
                                                            "https://catelproject.atlassian.net/wiki/display/CTL/Performance+considerations"));

            ApiCop.RegisterRule(new UnusedFeatureApiCopRule("UserControlLogic.CreateWarningAndErrorValidator", "The InfoBarMessageControl is not found in the visual tree. Only use this feature in combination with the InfoBarMessageControl or a customized class which uses the WarningAndErrorValidator. Consider setting the CreateWarningAndErrorValidatorForViewModel or DefaultCreateWarningAndErrorValidatorForViewModelValue to false.", ApiCopRuleLevel.Error,
                                                            "https://catelproject.atlassian.net/wiki/display/CTL/Performance+considerations"));

            ApiCop.RegisterRule(new UnusedFeatureApiCopRule("UserControlLogic.SupportParentViewModelContainers", "No parent IViewModelContainer is found in the visual tree. Only use this feature when there are parent IViewModelContainer instances. Consider setting the SupportParentViewModelContainers to false.", ApiCopRuleLevel.Error,
                                                            "https://catelproject.atlassian.net/wiki/display/CTL/Performance+considerations"));

            DefaultUnloadBehaviorValue = UnloadBehavior.SaveAndCloseViewModel;

#if !XAMARIN
            DefaultTransferStylesAndTransitionsToViewModelGridValue = false;
#endif

#if NET || SL5
            DefaultCreateWarningAndErrorValidatorForViewModelValue = true;
#endif
        }
 /// <summary>
 /// Initializes static members of the <see cref="SerializerBase{TSerializationContext}"/> class.
 /// </summary>
 static SerializerBase()
 {
     ApiCop.RegisterRule(new InitializationApiCopRule("SerializerBase.WarmupAtStartup", "It is recommended to warm up the serializers at application startup", ApiCopRuleLevel.Hint, InitializationMode.Eager,
                                                      "http://docs.catelproject.com/vnext/catel-core/serialization/introduction.htm#warming-up-serialization"));
 }
Exemple #4
0
 static TypeFactory()
 {
     ApiCop.RegisterRule(new TooManyDependenciesApiCopRule("TypeFactory.LimitDependencyInjection", "It is recommended not to inject too many types using dependency injection as this might be a code-smell. Is the class too big? Try splitting it up into smaller classes with less dependencies.", ApiCopRuleLevel.Hint));
 }
 /// <summary>
 /// Initializes static members of the <see cref="SerializerBase{TSerializationContext}"/> class.
 /// </summary>
 static SerializerBase()
 {
     ApiCop.RegisterRule(new InitializationApiCopRule("SerializerBase.WarmupAtStartup", "It is recommended to warm up the serializers at application startup", ApiCopRuleLevel.Hint, InitializationMode.Eager,
                                                      "https://catelproject.atlassian.net/wiki/display/CTL/Introduction+to+serialization#Introductiontoserialization-Warmingupserialization"));
 }