本文整理汇总了C#中Letter类的典型用法代码示例。如果您正苦于以下问题:C# Letter类的具体用法?C# Letter怎么用?C# Letter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Letter类属于命名空间,在下文中一共展示了Letter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
public void Update(Letter newLetter){
this.letter = newLetter.letter;
this.sprite.name = newLetter.letter.ToString();
this.sprite.spriteName = newLetter.sprite.spriteName;
this.sprite.MakePixelPerfect();
GBlue.Util.SetActive(this.gameObject, true);
}
示例2: Insert
///<summary>Inserts one Letter into the database. Provides option to use the existing priKey.</summary>
public static long Insert(Letter letter,bool useExistingPK){
if(!useExistingPK && PrefC.RandomKeys) {
letter.LetterNum=ReplicationServers.GetKey("letter","LetterNum");
}
string command="INSERT INTO letter (";
if(useExistingPK || PrefC.RandomKeys) {
command+="LetterNum,";
}
command+="Description,BodyText) VALUES(";
if(useExistingPK || PrefC.RandomKeys) {
command+=POut.Long(letter.LetterNum)+",";
}
command+=
"'"+POut.String(letter.Description)+"',"
+ DbHelper.ParamChar+"paramBodyText)";
if(letter.BodyText==null) {
letter.BodyText="";
}
OdSqlParameter paramBodyText=new OdSqlParameter("paramBodyText",OdDbType.Text,letter.BodyText);
if(useExistingPK || PrefC.RandomKeys) {
Db.NonQ(command,paramBodyText);
}
else {
letter.LetterNum=Db.NonQ(command,true,paramBodyText);
}
return letter.LetterNum;
}
示例3: Insert
///<summary>Inserts one Letter into the database. Returns the new priKey.</summary>
internal static long Insert(Letter letter)
{
if(DataConnection.DBtype==DatabaseType.Oracle) {
letter.LetterNum=DbHelper.GetNextOracleKey("letter","LetterNum");
int loopcount=0;
while(loopcount<100){
try {
return Insert(letter,true);
}
catch(Oracle.DataAccess.Client.OracleException ex){
if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){
letter.LetterNum++;
loopcount++;
}
else{
throw ex;
}
}
}
throw new ApplicationException("Insert failed. Could not generate primary key.");
}
else {
return Insert(letter,false);
}
}
示例4: Form1
public Form1()
{
InitializeComponent();
parcels = new List<Parcel>(); // List of parcels
addresses = new List<Address>(); // List of addresses
Address a1 = new Address("John Smith", "123 Any St.", "Apt. 45",
"Louisville", "KY", 40202); // Test Address 1
Address a2 = new Address("Jane Doe", "987 Main St.", "",
"Beverly Hills", "CA", 90210); // Test Address 2
Address a3 = new Address("James Kirk", "654 Roddenberry Way", "Suite 321",
"El Paso", "TX", 79901); // Test Address 3
Address a4 = new Address("John Crichton", "678 Pau Place", "Apt. 7",
"Portland", "ME", 04101); // Test Address 4
Letter letter1 = new Letter(a1, a2, 3.95M); // Letter test object
GroundPackage gp1 = new GroundPackage(a3, a4, 14, 10, 5, 12.5); // Ground test object
NextDayAirPackage ndap1 = new NextDayAirPackage(a1, a3, 25, 15, 15, // Next Day test object
85, 7.50M);
TwoDayAirPackage tdap1 = new TwoDayAirPackage(a4, a1, 46.5, 39.5, 28.0, // Two Day test object
80.5, TwoDayAirPackage.Delivery.Saver);
addresses.Add(a1);
addresses.Add(a2);
addresses.Add(a3);
addresses.Add(a4);
parcels.Add(letter1);
parcels.Add(gp1);
parcels.Add(ndap1);
parcels.Add(tdap1);
}
示例5: Invoice
public Invoice(int invoice_id, int entity_id, int invoice_type_id, int booking_id, int payer_organisation_id, int payer_patient_id, int non_booking_invoice_organisation_id, string healthcare_claim_number, int reject_letter_id, string message,
int staff_id, int site_id, DateTime invoice_date_added, decimal total, decimal gst, decimal receipts_total, decimal vouchers_total, decimal credit_notes_total, decimal refunds_total,
bool is_paid, bool is_refund, bool is_batched, int reversed_by, DateTime reversed_date, DateTime last_date_emailed)
{
this.invoice_id = invoice_id;
this.entity_id = entity_id;
this.invoice_type = new IDandDescr(invoice_type_id);
this.booking = booking_id == -1 ? null : new Booking(booking_id);
this.payer_organisation = payer_organisation_id == 0 ? null : new Organisation(payer_organisation_id);
this.payer_patient = payer_patient_id == -1 ? null : new Patient(payer_patient_id);
this.non_booking_invoice_organisation = non_booking_invoice_organisation_id == -1 ? null : new Organisation(non_booking_invoice_organisation_id);
this.healthcare_claim_number = healthcare_claim_number;
this.reject_letter = reject_letter_id == -1 ? null : new Letter(reject_letter_id);
this.message = message;
this.staff = new Staff(staff_id);
this.site = site_id == -1 ? null : new Site(site_id);
this.invoice_date_added = invoice_date_added;
this.total = total;
this.gst = gst;
this.receipts_total = receipts_total;
this.vouchers_total = vouchers_total;
this.credit_notes_total = credit_notes_total;
this.refunds_total = refunds_total;
this.is_paid = is_paid;
this.is_refund = is_refund;
this.is_batched = is_batched;
this.reversed_by = reversed_by == -1 ? null : new Staff(reversed_by);
this.reversed_date = reversed_date;
this.last_date_emailed = last_date_emailed;
}
示例6: Main
// Precondition: None
// Postcondition: Small list of Parcels is created and displayed
static void Main(string[] args)
{
Address a1 = new Address("John Smith", "123 Any St.", "Apt. 45",
"Louisville", "KY", 40202); // Test Address 1
Address a2 = new Address("Jane Doe", "987 Main St.", "",
"Beverly Hills", "CA", 90210); // Test Address 2
Address a3 = new Address("James Kirk", "654 Roddenberry Way", "Suite 321",
"El Paso", "TX", 79901); // Test Address 3
Address a4 = new Address("John Crichton", "678 Pau Place", "Apt. 7",
"Portland", "ME", 04101); // Test Address 4
Letter l1 = new Letter(a1, a3, 1.50M); // Test Letter 1
Letter l2 = new Letter(a2, a4, 1.25M); // Test Letter 2
Letter l3 = new Letter(a4, a1, 1.75M); // Test Letter 3
List<Parcel> parcels = new List<Parcel>(); // Test list of parcels
// Add test data to list
parcels.Add(l1);
parcels.Add(l2);
parcels.Add(l3);
// Display data
Console.WriteLine("Program 0 - List of Parcels\n\n");
foreach (Parcel p in parcels)
{
Console.WriteLine(p);
Console.WriteLine("--------------------");
}
}
示例7: postLetter
public void postLetter(Inhabitant prmReceiver, Letter prmLetter)
{
hisCity.sendLetter(prmLetter);
this.getBankAccount().setDebit(prmLetter.getPrice());
Console.WriteLine("-> inhabitant-" + this.number + " mails " + prmLetter.putContent() + " to inhabitant-" + prmReceiver.number + " for a cost of " + prmLetter.getPrice() + " euros");
Console.WriteLine(" - " + prmLetter.getPrice() + " euros are debited from inhabitant-" + this.number + " account whose balance is now " + this.getBankAccount().getAmount() + " euros");
}
示例8: RegisteredLetter
public RegisteredLetter(Sender prmSender, Receiver prmReceiver, Letter prmContent)
: base(prmSender, prmReceiver)
{
price = registeredLetterPrice = 15 + prmContent.getPrice();
//prmSender.objInhabitant.objBankAccount.setDebit(price);
letterContent = prmContent;
}
示例9: LetterTreatmentTemplate
public LetterTreatmentTemplate(int letter_treatment_template_id, int field_id, int first_letter_id, int last_letter_id, int last_letter_pt_id, int last_letter_when_replacing_epc_id, int treatment_notes_letter_id, int site_id)
{
this.letter_treatment_template_id = letter_treatment_template_id;
this.field = new IDandDescr(field_id);
this.first_letter = new Letter(first_letter_id);
this.last_letter = new Letter(last_letter_id);
this.last_letter_pt = new Letter(last_letter_pt_id);
this.last_letter_when_replacing_epc = new Letter(last_letter_when_replacing_epc_id);
this.treatment_notes_letter = new Letter(treatment_notes_letter_id);
this.site = new Site(site_id);
}
示例10: TestGetString
public void TestGetString()
{
var letterManager = new LetterManager();
var letterA = new Letter('a', 0);
letterManager.AddLetter(letterA);
var letterB = new Letter('b', 2);
letterManager.AddLetter(letterB);
letterManager.AddLetter(new Letter('c', 5));
Assert.AreEqual("a b c", letterManager.GetString());
}
示例11: Test_Letter_MoveNextAndMovePrevious
public void Test_Letter_MoveNextAndMovePrevious()
{
var letter = new Letter('a', 0);
letter.MoveNext();
Assert.AreEqual(1, letter.Position);
letter.MovePrevious();
Assert.AreEqual(0, letter.Position);
letter.MovePrevious();
Assert.AreEqual(0, letter.Position);
}
示例12: ShowLine
bool ShowLine(Alphabet alphabet, Letter letter) {
if (currentLine.DrawNextChar (alphabet, letter, transform)) {
currentLineIndex++;
if (currentLineIndex >= linesInCard.Length) {
persistState = true;
return false;
}
currentLine = linesInCard [currentLineIndex];
}
return true;
}
示例13: Draggable
/// <summary>
/// Initializes a new instance of the <see cref="Draggable"/> class.
/// </summary>
public Draggable(Letter letter)
{
InitializeComponent();
IsDraggable = true;
Letter = letter;
DataBind();
CellX = uint.MaxValue;
CellY = uint.MaxValue;
Loaded += new RoutedEventHandler(Draggable_Loaded);
}
示例14: TestAddingLetters
public void TestAddingLetters()
{
var letterManager = new LetterManager();
var letterA = new Letter('a', 0);
letterManager.AddLetter(letterA);
var letterB = new Letter('b', 2);
letterManager.AddLetter(letterB);
letterManager.AddLetter(new Letter('c', 5));
Assert.AreEqual(letterA, letterManager.GetElementAt(0));
Assert.AreEqual(letterB, letterManager.GetElementAt(2));
Assert.AreEqual(new Letter('c', 5), letterManager.GetElementAt(5));
}
示例15: DrawKeyboardRow
private void DrawKeyboardRow(string[] row, RectTransform container)
{
int space = GetButtonOffset(containerWidth,row.Length);
for(int i = 0; i < row.Length; i++){
string val = row[i];
btn = Instantiate(btnprefab) as Letter;
btn.transform.SetParent(container.transform);
btn.transform.localPosition = new Vector2(i* 57+(i*space),0);
btn.GetComponentInParent<Button>().GetComponentInChildren<Text>().text = val;
btn.GetComponent<Letter>().value = val;
}
}