本文整理汇总了C#中TList类的典型用法代码示例。如果您正苦于以下问题:C# TList类的具体用法?C# TList怎么用?C# TList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TList类属于命名空间,在下文中一共展示了TList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
public static void Process (TList<EmailMessage> list)
{
if ( list != null)
{
if (list.Count > 0)
ProcessFailureProvider.Instance().Process(list);
}
}
示例2: Bind
/// <summary>
/// Bind control
/// </summary>
public void Bind(TList<Cart> cart)
{
if (cart != null)
{
repOrdered.DataSource = cart;
repOrdered.DataBind();
}
}
示例3: Main
static void Main(string[] args)
{
int A = 0;
Console.Write("Podaj ilosc liczb A: ");
A = int.Parse(Console.ReadLine());
Console.Write("Podaj max wartosc M: ");
int M = int.Parse(Console.ReadLine());
Heap<int> heap = new Heap<int>(A);
TList<int> list = new TList<int>();
Console.Write("Podaj ilosc liczb B: ");
int B = int.Parse(Console.ReadLine());
Console.Write("Podaj max wartosc N: ");
int N = int.Parse(Console.ReadLine());
Random r = new Random(DateTime.Now.Millisecond);
Console.WriteLine("Kopiec :)");
var time = Stopwatch.StartNew();
for(var i=A;i>0;i--)
{
var tmp = r.Next(0, M);
heap.Push(tmp,tmp);
}
for(var i= B;i>0;i--)
{
var tmp = r.Next(0, N);
heap.DeleteMax();
heap.Push(tmp,tmp);
}
time.Stop();
var timeMs = time.ElapsedMilliseconds;
Console.WriteLine("Uplynelo {0} ms", timeMs);
Console.ReadLine();
Console.WriteLine("Lista :(");
time = Stopwatch.StartNew();
for (var i = A; i > 0; i--)
{
var tmp = r.Next(0, M);
list.Push(tmp,tmp);
}
for (var i = B; i > 0; i--)
{
list.DeleteAt(list.MinIndex());
var tmp = r.Next(0, N);
list.Push(tmp, tmp);
}
time.Stop();
timeMs = time.ElapsedMilliseconds;
Console.WriteLine("Uplynelo {0} ms", timeMs);
Console.ReadLine();
}
示例4: CreateMockInstance_Generated
///<summary>
/// Returns a Typed Region Entity with mock values.
///</summary>
public static Region CreateMockInstance_Generated(TransactionManager tm)
{
Region mock = new Region();
mock.RegionId = TestUtility.Instance.RandomNumber();
mock.RegionDescription = TestUtility.Instance.RandomString(24, false);;
// create a temporary collection and add the item to it
TList<Region> tempMockCollection = new TList<Region>();
tempMockCollection.Add(mock);
tempMockCollection.Remove(mock);
return (Region)mock;
}
示例5: Recieve
public override TList<EmailMessage> Recieve( )
{
//
TList<EmailMessage> list = new TList<EmailMessage>();
string connectionString = ConfigurationManager.ConnectionStrings["SmartMassEmailConnectionString2005"].ConnectionString;
string queueSchema = "dbo";
string queueName = "SMEPostQueue";
// Create the connection and service objects.
//
SqlConnection conn = new SqlConnection(connectionString);
GroupCommitService service = new GroupCommitService(
conn, queueSchema, queueName);
// Time interval to wait for messages to arrive on a queue before giving up
// and returning from the receive loop.
//
service.QueueEmptyTimeout = TimeSpan.FromSeconds(10);
// Time interval to receive additional batches of messages (i.e. lock
// additional conversation group) from the time we receive first set
// of messages.
//
service.GroupCommitTimeout = TimeSpan.FromSeconds(3);
// At most we are willing to lock 5 conversation (groups) in a single
// transaction.
//
service.ReceivesPerTransaction = 5;
try
{
conn.Open();
// Loop to receive and process incoming messages.
//
list = service.Run();
conn.Close();
}
catch (SqlException se)
{
Console.Error.WriteLine("Exception thrown by SqlClient: {0}", se.Message);
}
return list;
}
示例6: CreateMockInstance_Generated
///<summary>
/// Returns a Typed Categories Entity with mock values.
///</summary>
public static Categories CreateMockInstance_Generated(TransactionManager tm)
{
Categories mock = new Categories();
mock.CategoryName = TestUtility.Instance.RandomString(6, false);;
mock.Description = TestUtility.Instance.RandomString(2, false);;
mock.Picture = new byte[] { TestUtility.Instance.RandomByte() };
// create a temporary collection and add the item to it
TList<Categories> tempMockCollection = new TList<Categories>();
tempMockCollection.Add(mock);
tempMockCollection.Remove(mock);
return (Categories)mock;
}
示例7: AttributeConversion
/// <summary>
/// 法宝技能——属性转换
/// </summary>
/// <param name="userID"></param>
/// <returns></returns>
public static TList<GeneralProperty> AttributeConversion(string userID, decimal powerNum, decimal soulNum, decimal intellectNum)
{
decimal changeNum = 0;
TList<GeneralProperty> propertyList = new TList<GeneralProperty>();
UserGeneral general = UserGeneral.GetMainGeneral(userID);
if (general == null)
{
return propertyList;
}
UserTrump userTrump = new GameDataCacheSet<UserTrump>().FindKey(userID, TrumpInfo.CurrTrumpID);
if (userTrump != null && userTrump.LiftNum > 0 && userTrump.SkillInfo.Count > 0)
{
foreach (SkillInfo skillInfo in userTrump.SkillInfo)
{
AbilityInfo abilityInfo = new ConfigCacheSet<AbilityInfo>().FindKey(skillInfo.AbilityID);
if (abilityInfo != null && abilityInfo.AttackType == AttackType.Change)
{
SkillLvInfo skillLvInfo = new ConfigCacheSet<SkillLvInfo>().FindKey(skillInfo.AbilityID, skillInfo.AbilityLv);
if (skillLvInfo == null)
{
break;
}
switch (abilityInfo.ChangeAbility)
{
case AbilityType.PowerNum:
changeNum = powerNum;
break;
case AbilityType.SoulNum:
changeNum = soulNum;
break;
case AbilityType.IntelligenceNum:
changeNum = intellectNum;
break;
default:
changeNum = 0;
break;
}
GeneralProperty property = new GeneralProperty();
property.AbilityType = abilityInfo.AfterAbility;
property.AbilityValue = changeNum * skillLvInfo.Coefficient;
propertyList.Add(property);
}
}
}
return propertyList;
}
示例8: validateUser
public Customers validateUser(string Email, string Password)
{
TList<Customers> objcust = new TList<Customers>();
Email.Trim();
Password.Trim();
//string whereclaus = CustomersColumn.EmailId + " LIKE '" + SearchPanel1.Username + "%' and Usertype=7";
//string whereclaus = CustomersColumn.EmailId + " LIKE '" + username + "%' and "+CustomersColumn.Password+ "='" + Password + "' and " +CustomersColumn.IsActive +"=1";
string whereclaus = CustomersColumn.EmailId + " ='" + Email + "' and " + CustomersColumn.Password + "='" + Password + "' and " + CustomersColumn.IsActive + "=1";
int Total = 0;
string orderby = string.Empty;
objcust = DataRepository.CustomersProvider.GetPaged(whereclaus, orderby, 0, int.MaxValue, out Total);
//DataRepository.CustomersProvider.DeepLoad(objcust, true);
if ((objcust != null) && (objcust.Count > 0))
{
return objcust.First();
}
return null;
}
示例9: SaveOrderLineItems
/// <summary>
/// Saves the new order line items
/// </summary>
/// <param name="orderId">The order id of the item</param>
/// <param name="cartItems">The cart items</param>
public void SaveOrderLineItems(int orderId, TList<Cart> cartItems)
{
var lineItemService = new LineItemService();
var lineNum = 0;
foreach (var item in cartItems)
{
var lineItem = new LineItem
{
OrderId = orderId,
ItemId = item.ItemId,
LineNum = ++lineNum,
Quantity = item.Quantity,
UnitPrice = item.Price
};
lineItemService.Save(lineItem);
}
}
示例10: CreateMockInstance_Generated
///<summary>
/// Returns a Typed CustomerCustomerDemo Entity with mock values.
///</summary>
public static CustomerCustomerDemo CreateMockInstance_Generated(TransactionManager tm)
{
CustomerCustomerDemo mock = new CustomerCustomerDemo();
//OneToOneRelationship
CustomerDemographics mockCustomerDemographicsByCustomerTypeId = CustomerDemographicsTest.CreateMockInstance(tm);
DataRepository.CustomerDemographicsProvider.Insert(tm, mockCustomerDemographicsByCustomerTypeId);
mock.CustomerTypeId = mockCustomerDemographicsByCustomerTypeId.CustomerTypeId;
//OneToOneRelationship
Customers mockCustomersByCustomerId = CustomersTest.CreateMockInstance(tm);
DataRepository.CustomersProvider.Insert(tm, mockCustomersByCustomerId);
mock.CustomerId = mockCustomersByCustomerId.CustomerId;
// create a temporary collection and add the item to it
TList<CustomerCustomerDemo> tempMockCollection = new TList<CustomerCustomerDemo>();
tempMockCollection.Add(mock);
tempMockCollection.Remove(mock);
return (CustomerCustomerDemo)mock;
}
示例11: Main
internal static void Main()
{
//// adding element + AutoGrow()
TList<int> somelist = new TList<int>(2);
somelist.Add(1);
somelist.Add(2);
somelist.Add(3);
//// removing element by index
somelist.RemoveAt(1);
//// inserting element at given position
somelist.InsertAt(0, 0);
//// accessing element by index (I feel so sleepy that I dont't see 2)
for (int i = 0; i < somelist.Count; i++)
{
Console.WriteLine(somelist[i]);
}
//// finding element by its value
Console.WriteLine(somelist.Contains(3));
////ToString override
Console.WriteLine(somelist.ToString());
//// Min and max value
int minValue = somelist.Min();
int maxValue = somelist.Max();
Console.WriteLine("MinValue = {0}\nMaxValue = {1}\n", minValue, maxValue);
////Clear list - List is empty & nothing is printed
somelist.Clear();
for (int i = 0; i < somelist.Count; i++)
{
Console.WriteLine(somelist[i]);
}
}
示例12: Process
public override void Process(TList<EmailMessage> list )
{
//
//
foreach (EmailMessage em in list)
{
if (em.NumberOfRetry < em.MaximumRetry)
{
em.Status = (int)EmailMessage.EmailMessageStatus.Pending;
em.NumberOfRetry = em.NumberOfRetry + 1;
//ReTry again after 10 min
em.RetryTime = em.RetryTime.AddMinutes(10);
DataRepository.EmailMessageProvider.Update(em);
}
else
{
//Delete the Message
DataRepository.EmailMessageProvider.Delete(em);
}
}
}
示例13: CreateMockInstance_Generated
///<summary>
/// Returns a Typed Suppliers Entity with mock values.
///</summary>
public static Suppliers CreateMockInstance_Generated(TransactionManager tm)
{
Suppliers mock = new Suppliers();
mock.CompanyName = TestUtility.Instance.RandomString(19, false);;
mock.ContactName = TestUtility.Instance.RandomString(14, false);;
mock.ContactTitle = TestUtility.Instance.RandomString(14, false);;
mock.Address = TestUtility.Instance.RandomString(29, false);;
mock.City = TestUtility.Instance.RandomString(6, false);;
mock.Region = TestUtility.Instance.RandomString(6, false);;
mock.PostalCode = TestUtility.Instance.RandomString(10, false);;
mock.Country = TestUtility.Instance.RandomString(6, false);;
mock.Phone = TestUtility.Instance.RandomString(11, false);;
mock.Fax = TestUtility.Instance.RandomString(11, false);;
mock.HomePage = TestUtility.Instance.RandomString(2, false);;
// create a temporary collection and add the item to it
TList<Suppliers> tempMockCollection = new TList<Suppliers>();
tempMockCollection.Add(mock);
tempMockCollection.Remove(mock);
return (Suppliers)mock;
}
示例14: BindCtgRtp
public void BindCtgRtp()
{
objprodctglist = ObjprodClass.GetAllProdCategories();
rptmnctg.DataSource = objprodctglist;
rptmnctg.DataBind();
}
示例15: bindlistitems
private void bindlistitems()
{
objprodctglist = ObjprodClass.GetAllProdCategories();
lstprntctg.DataSource = objprodctglist;
lstprntctg.DataTextField = "Name";
lstprntctg.DataValueField = "ID";
lstprntctg.DataBind();
}