generate pdf417 c# BrokenRulesCollection Class in C#.NET

Maker PDF 417 in C#.NET BrokenRulesCollection Class

BrokenRulesCollection Class
Draw PDF 417 In C#.NET
Using Barcode creator for .NET Control to generate, create PDF-417 2d barcode image in .NET applications.
www.OnBarcode.com
PDF-417 2d Barcode Recognizer In C#
Using Barcode decoder for .NET Control to read, scan read, scan image in .NET framework applications.
www.OnBarcode.com
The BrokenRulesCollection class is used by ValidationRules to maintain the list of currently broken rules. Each broken rule is represented by a BrokenRule object. The collection inherits from Csla. Core.ReadOnlyBindingList and so is a read-only collection. [Serializable()] public class BrokenRulesCollection : Core.ReadOnlyBindingList<BrokenRule> Though the collection is read-only, it does provide some internal methods to allow ValidationRules to add and remove items. These methods are used in the CheckRules() methods to ensure that broken rules are only in the list when appropriate. The Add() methods are pretty straightforward. internal void Add(IAsyncRuleMethod rule, AsyncRuleResult result) { Remove(rule); IsReadOnly = false; BrokenRule item = new BrokenRule(rule, result); IncrementCount(item); Add(item); IsReadOnly = true; } internal void Add(IRuleMethod rule) { Remove(rule); IsReadOnly = false; BrokenRule item = new BrokenRule(rule); IncrementCount(item); Add(item); IsReadOnly = true; } Both overloads do essentially the same thing, but for asynchronous and synchronous rule methods. To avoid possible duplicate object issues, they first ensure that the broken rule isn t already in the list by calling the Remove() method. Then they change the collection to be read-write, add the rule to the collection, and set the collection back to be read-only. While they could just see if the collection contains the broken rule, removing and re-adding the rule is better, because it ensures that the human-readable description for the rule is current. The rule method could have changed the description over time. The IncrementCount() method is used to maintain counters for the number of Error, Warning, and Information severity rules that are broken. Each broken rule has one of these severities, and as an optimization, BrokenRulesCollection maintains a running count of the number of each severity that is broken at any point in time.
Printing Matrix Barcode In C#
Using Barcode generation for Visual Studio .NET Control to generate, create Matrix image in .NET framework applications.
www.OnBarcode.com
Drawing DataMatrix In C#.NET
Using Barcode maker for VS .NET Control to generate, create ECC200 image in VS .NET applications.
www.OnBarcode.com
CHAPTER 11 BUS INE SS AND V ALIDA TION RULES
Making Linear Barcode In C#
Using Barcode drawer for .NET Control to generate, create Linear image in VS .NET applications.
www.OnBarcode.com
Generating PDF417 In Visual C#
Using Barcode drawer for .NET framework Control to generate, create PDF417 image in VS .NET applications.
www.OnBarcode.com
The Remove() method is a bit more complex. internal void Remove(IRuleMethod rule) { IsReadOnly = false; for (int index = 0; index < Count; index++) if (this[index].RuleName == rule.RuleName) { DecrementCount(this[index]); RemoveAt(index); break; } IsReadOnly = true; } It has to scan through the collection to find a rule with the same rule name. Notice that no exception is thrown if the item isn t in the collection. If it isn t there, that s fine then there s just no need to remove it. The DecrementCount() method is used to maintain counters for the number of Error, Warning, and Information severity rules that are broken. Each broken rule has one of these severities, and as an optimization, BrokenRulesCollection maintains a running count of the number of each severity that is broken at any point in time. There are a few other methods in BrokenRulesCollection worth mentioning. They provide information about the contents of the collection and are listed in Table 11-2.
Printing Barcode In C#
Using Barcode maker for VS .NET Control to generate, create Barcode image in VS .NET applications.
www.OnBarcode.com
Making Planet In C#.NET
Using Barcode creator for Visual Studio .NET Control to generate, create Planet image in .NET applications.
www.OnBarcode.com
Table 11-2. Methods and Properties Providing Information About Broken Rules
PDF-417 2d Barcode Decoder In Visual Basic .NET
Using Barcode decoder for VS .NET Control to read, scan read, scan image in .NET applications.
www.OnBarcode.com
PDF 417 Generation In Visual Studio .NET
Using Barcode drawer for .NET Control to generate, create PDF-417 2d barcode image in .NET applications.
www.OnBarcode.com
Property/Method
Generate Code 128C In Objective-C
Using Barcode encoder for iPhone Control to generate, create USS Code 128 image in iPhone applications.
www.OnBarcode.com
Encode QR Code ISO/IEC18004 In None
Using Barcode maker for Online Control to generate, create QR Code image in Online applications.
www.OnBarcode.com
ErrorCount WarningCount InformationCount GetFirstMessage(string) GetFirstMessage(string, RuleSeverity)
PDF417 Maker In None
Using Barcode drawer for Software Control to generate, create PDF417 image in Software applications.
www.OnBarcode.com
ECC200 Printer In Java
Using Barcode drawer for Java Control to generate, create DataMatrix image in Java applications.
www.OnBarcode.com
Description
Generating UCC - 12 In None
Using Barcode creator for Online Control to generate, create UPC Code image in Online applications.
www.OnBarcode.com
Create Barcode In Java
Using Barcode creator for BIRT Control to generate, create Barcode image in BIRT applications.
www.OnBarcode.com
Returns the current number of Error severity broken rules Returns the current number of Warning severity broken rules Returns the current number of Information severity broken rules Scans the list and returns the first broken rule of any severity (if any) for a specified property Scans the list and returns the first broken rule of the specified severity (if any) for a specified property Scans the list and returns the first broken rule of Error severity (if any) for a specified property; this method is used in BusinessBase to implement the IDataErrorInfo interface Returns an array of broken rule descriptions for the business object Returns an array of broken rule descriptions for a specific severity of broken rules in the business object
EAN-13 Drawer In None
Using Barcode generator for Word Control to generate, create GTIN - 13 image in Microsoft Word applications.
www.OnBarcode.com
UCC-128 Scanner In Visual C#.NET
Using Barcode decoder for Visual Studio .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
GetFirstBrokenRule(string)
Barcode Decoder In Visual Studio .NET
Using Barcode Control SDK for ASP.NET Control to generate, create, read, scan barcode image in ASP.NET applications.
www.OnBarcode.com
Scan Code 128A In Visual Basic .NET
Using Barcode decoder for .NET Control to read, scan read, scan image in VS .NET applications.
www.OnBarcode.com
ToArray() ToArray(RuleSeverity)
CHAPTER 11 BUS IN ESS AN D V ALIDA TION RULES
Table 11-2. Methods and Properties Providing Information About Broken Rules (Continued)
Property/Method
ToString()
Description
Concatenates the human-readable descriptions of all broken rules into a single string value, using Environment.NewLine as a separator; this too is used in the IDataErrorInfo implementation to return all the errors for the entire object Concatenates the human-readable descriptions of all broken rules into a single string value, using the string parameter as a separator; this is used in the IDataErrorInfo implementation to return all the errors for the entire object Concatenates the human-readable descriptions of all broken rules of the specified severity into a single string value, using the string parameter as a separator
ToString(string)
ToString(string, RuleSeverity)
All of these methods are available to the business and UI developer, and provide a great deal of flexibility for use of the broken rules information.
Copyright © OnBarcode.com . All rights reserved.