View Single Post
  #1 (permalink)  
Old March 13th, 2006, 11:55 PM
netstudy netstudy is offline
Registered User
 
Join Date: Mar 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default object builder questions

the questions are as follows:

¾¯¸æ 1 ¡°System.Diagnostics.PerformanceCounterCategory. Create(string, string, System.Diagnostics.CounterCreationDataCollection) ±Òѹýʱ:¡°This method has been deprecated. Please use System.Diagnostics.PerformanceCounterCategory.Crea te(string categoryName, string categoryHelp, PerformanceCounterCategoryType categoryType, CounterCreationDataCollection counterData) instead. http://go.microsoft.com/fwlink/?linkid=14202¡± C:\BookManager\EnterpriseObjects\EnterpriseCounter s.cs 103 5 EnterpriseObjects

the source code is : CounterCreationDataCollection list = new CounterCreationDataCollection();

                // go through each counter...
                foreach(EnterpriseCounter counter in Counters)
                {
                    // create some new data...
                    CounterCreationData data = new CounterCreationData();
                    data.CounterName = counter.Name;
                    data.CounterHelp = counter.HelpText;
                    data.CounterType = counter.Type;


                    // add it...
                    list.Add(data);
                }

                // create the category and all of the counters...
                PerformanceCounterCategory.Create(PerformanceObjec tName,"",list);


¾¯¸æ 2 ¡°BookManagerObjects.BookAuthorBoundCollectionBa se.this[int]¡±Òþ²ØÁ˼̳еijÉÔ±¡°Enterprise Objects.EntityBoundCollection.this[int]¡±¡£Èç¹ûÊÇÓÐÒâÒþ²Ø£¬ÇëÊ¹Ó Ã¹Ø¼ü×Ö new¡£ C:\BookManager\BookManagerObjects\BookManagerObjec ts\BookAuthorBoundCollectionBase.cs 20 27 BookManagerObjects
the source code is :
namespace BookManagerObjects
{


    // EntityBoundCollection base implementation for table 'Payments'
    // *DO NOT* add your modifications to this file
    public class PaymentBoundCollectionBase : EnterpriseObjects.EntityBoundCollection
    {

        public Payment this[int index]
        {
            get
            {
                return ((Payment)(this.EntitySet.GetEntity(this.TableInde x, index)));
            }
        }
    }
}