本文整理汇总了C#中Registration类的典型用法代码示例。如果您正苦于以下问题:C# Registration类的具体用法?C# Registration怎么用?C# Registration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Registration类属于命名空间,在下文中一共展示了Registration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Unregister
/// <summary>
/// Unregister the profiler using %SystemRoot%\system\regsvr32.exe
/// </summary>
/// <param name="registration">User - use the /n /i:user switches</param>
public static void Unregister(Registration registration)
{
if (registration == Registration.Normal || registration == Registration.User)
{
ExecuteRegsvr32(registration == Registration.User, false);
}
}
示例2: btnRegister_Click
/* Register Button */
private void btnRegister_Click(object sender, EventArgs e)
{
try
{
custID = Convert.ToInt32(cmbCustomer.SelectedValue);
prodCode = cmbProduct.SelectedValue.ToString();
regDate = DTPickerRegistration.Value;
Registration rego = new Registration(custID, prodCode, regDate);
//RegistrationDB.AddRegistration(rego);
if (RegistrationDB.AddRegistration(rego) == true)
{
MessageBox.Show("Registration Complete.");
clearForm();
}
else
{
MessageBox.Show("Registration Failed.");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().ToString());
}
}
示例3: ValidateTemplateRegistrationAfterRegister
public void ValidateTemplateRegistrationAfterRegister(Registration registration, string zumoInstallationId)
{
ValidateTemplateRegistration(registration);
Assert.IsNotNull(registration.RegistrationId);
Assert.IsTrue(registration.Tags.Contains(zumoInstallationId));
Assert.AreEqual(registration.Tags.Count(), DefaultTags.Length + 1);
}
示例4: GetInstance
public object GetInstance(Container container, Registration reg)
{
if (reg.Instance == null)
reg.Instance = reg.CreateInstance(container);
return reg.Instance;
}
示例5: SendInvitationEmail
public static void SendInvitationEmail(string username, string sendername, string email,Guid teamid)
{
try
{
Registration reg = new Registration();
string tid = reg.MD5Hash(email);
MailHelper mailhelper = new MailHelper();
string mailpath = HttpContext.Current.Server.MapPath("~/Layouts/Mails/SendInvitation.htm");
string html = File.ReadAllText(mailpath);
string fromemail = ConfigurationManager.AppSettings["fromemail"];
string usernameSend = ConfigurationManager.AppSettings["username"];
string host = ConfigurationManager.AppSettings["host"];
string port = ConfigurationManager.AppSettings["port"];
string pass = ConfigurationManager.AppSettings["password"];
string urllogin = "http://woosuite.socioboard.com/Default.aspx";
string registrationurl = "http://woosuite.socioboard.com/Registration.aspx?tid="+teamid;
string Body = mailhelper.InvitationMail(html, username, sendername, "", urllogin, registrationurl);
string Subject = "You've been Invited to " + username + " Moople Social Account";
// MailHelper.SendMailMessage(host, int.Parse(port.ToString()), fromemail, pass, email, string.Empty, string.Empty, Subject, Body);
MailHelper.SendSendGridMail(host, Convert.ToInt32(port), fromemail, "", email, "", "", Subject, Body, usernameSend, pass);
}
catch (Exception ex)
{
logger.Error(ex.Message);
}
}
示例6: Validator
protected override bool Validator(Registration.Registration registration, DateTime datetime)
{
bool drive = true;
int position = registration.Number.Length -1;
String digit = registration.Number.Substring(position,1);
string weekday = datetime.DayOfWeek.ToString();
if (weekday == WeekDay.week_day.Monday.ToString() && (digit == "1" || digit == "2"))
{
drive = false;
}
else if (weekday == WeekDay.week_day.Tuesday.ToString() && (digit == "3" || digit == "4"))
{
drive = false;
}
else if (weekday == WeekDay.week_day.Wednesday.ToString() && (digit == "5" || digit == "6"))
{
drive = false;
}
else if (weekday == WeekDay.week_day.Thursday.ToString() && (digit == "7" || digit == "8"))
{
drive = false;
}
else if (weekday == WeekDay.week_day.Friday.ToString() && (digit == "9" || digit == "0"))
{
drive = false;
}
return drive;
}
示例7: Login
public string Login(string EmailId, string Password)
{
//
try
{
UserRepository userrepo = new UserRepository();
Registration regObject = new Registration();
User user = userrepo.GetUserInfo(EmailId, regObject.MD5Hash(Password));
if (user != null)
{
return new JavaScriptSerializer().Serialize(user);
}
else
{
return "Invalid user name or password";
}
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
return null;
}
}
示例8: ValidateTemplateRegistration
public void ValidateTemplateRegistration(Registration registration)
{
var mpnsTemplateRegistration = (MpnsTemplateRegistration)registration;
Assert.AreEqual(mpnsTemplateRegistration.BodyTemplate, BodyTemplate);
foreach (KeyValuePair<string, string> header in DefaultHeaders)
{
Assert.IsTrue(mpnsTemplateRegistration.MpnsHeaders.ContainsKey(header.Key));
Assert.AreEqual(mpnsTemplateRegistration.MpnsHeaders[header.Key], header.Value);
}
foreach (KeyValuePair<string, string> header in DetectedHeaders)
{
Assert.IsTrue(mpnsTemplateRegistration.MpnsHeaders.ContainsKey(header.Key));
Assert.AreEqual(mpnsTemplateRegistration.MpnsHeaders[header.Key], header.Value);
}
Assert.AreEqual(mpnsTemplateRegistration.MpnsHeaders.Count, DefaultHeaders.Count + DetectedHeaders.Count);
foreach (string tag in DefaultTags)
{
Assert.IsTrue(registration.Tags.Contains(tag));
}
Assert.AreEqual(mpnsTemplateRegistration.Name, DefaultToastTemplateName);
Assert.AreEqual(mpnsTemplateRegistration.TemplateName, DefaultToastTemplateName);
}
示例9: SubscribeToService
private void SubscribeToService()
{
try
{
// Get User
User msgUser = new User();
var msg = new GetUserMessage(this, message =>
{
msgUser = message;
});
Messenger.Default.Send(msg);
// Create Registration
Registration registration = new Registration();
registration.URI = httpChannel.ChannelUri.ToString();
registration.UserId = msgUser.UserId;
// Register
CapitalServiceClient client = new CapitalServiceClient();
client.RegisterCompleted += (s, e) => { };
client.RegisterAsync(registration);
}
catch
{
}
}
示例10: ValidateSchedule
public String ValidateSchedule(Schedule.Schedule schedule, Registration.Registration vehicle)
{
String information = "";
try
{
if (comboBoxCountry.SelectedItem.ToString() == Registration.Country.country_name.Ecuador.ToString())
{
vehicle = new Registration.EcuadorRegistration(this.textBoxRegistration.Text);
schedule = new Schedule.EcuadorSchedule();
DateTime dt = new DateTime();
dt = Convert.ToDateTime(dateTimePicker.Text);
if (!(schedule as Schedule.EcuadorSchedule).EcuadorValidator(vehicle, dt))
information = "El vehículo con matrícula " + vehicle.Number + " no puede conducir en la ciudad de Quito entre las las 7:00 y las 9:30 en la mañana y entre las 16:00 y las 19:30 en la tarde y noche.";
else
information = "El vehículo con matrícula " + vehicle.Number + " puede conducir libremente en la ciudad de Quito en la fecha seleccionada.";
}
else
information = "Información solo disponible para " + Registration.Country.country_name.Ecuador.ToString();
}
catch (Exception exception)
{
information = exception.Message;
}
return information;
}
示例11: HarmonizeConnector
public HarmonizeConnector(Registration.IFactory registrationFactory, With.Messaging.Client.IEndpoint messagingEndpoint)
{
_registrationFactory = registrationFactory;
_messagingEndpoint = messagingEndpoint;
_registrations = new Registration.Collection();
}
示例12: ValidateTemplateRegistration
public void ValidateTemplateRegistration(Registration registration)
{
var mpnsTemplateRegistration = (MpnsTemplateRegistration)registration;
Assert.AreEqual(mpnsTemplateRegistration.BodyTemplate, BodyTemplate);
foreach (KeyValuePair<string, string> header in DefaultHeaders)
{
string foundKey = mpnsTemplateRegistration.MpnsHeaders.Keys.Single(s => s.ToLower() == header.Key.ToLower());
Assert.IsNotNull(foundKey);
Assert.AreEqual(mpnsTemplateRegistration.MpnsHeaders[foundKey], header.Value);
}
foreach (KeyValuePair<string, string> header in DetectedHeaders)
{
string foundKey = mpnsTemplateRegistration.MpnsHeaders.Keys.Single(s => s.ToLower() == header.Key.ToLower());
Assert.IsNotNull(foundKey);
Assert.AreEqual(mpnsTemplateRegistration.MpnsHeaders[foundKey], header.Value);
}
Assert.AreEqual(mpnsTemplateRegistration.MpnsHeaders.Count, DefaultHeaders.Count + DetectedHeaders.Count);
foreach (string tag in DefaultTags)
{
Assert.IsTrue(registration.Tags.Contains(tag));
}
Assert.AreEqual(mpnsTemplateRegistration.Name, DefaultToastTemplateName);
Assert.AreEqual(mpnsTemplateRegistration.TemplateName, DefaultToastTemplateName);
}
示例13: AddRegister
private string[] AddRegister()
{
var regs = new Registration()
{
Adress = txtAdres.Text,
BirthDate = txtDogumTar.Text,
BirthPlace = txtDogumYeri.Text,
Chapter = txtBolum.Text,
FatherJob = txtBabaMeslek.Text,
FatherName = txtBabaMeslek.Text,
FatherTNo = txtBabaTCKNo.Text,
MailAdress = txtMail.Text,
MobileNumber = txtCepNo.Text,
MotherJob = txtAnneMeslek.Text,
MotherName = txtAnneAdi.Text,
Name = txtAd.Text,
Number = txtTel.Text,
SchoolLeaver = txtMezunOkul.Text,
Surname = txtSoyad.Text,
TCKNo = txtTckNo.Text
};
string[] returnResult = _registrationBusiness.AddRegistrtaion(regs);
return returnResult;
}
示例14: Register
// Register a node address for a given mesh ID
public int Register(string meshId, PeerNodeAddress nodeAddress)
{
bool newMeshId = false;
int registrationId;
Registration registration = new Registration(meshId, nodeAddress);
// Add the new registration to the registration table; update meshIdTable with the newly registered nodeAddress
lock (registrationTable)
{
registrationId = nextRegistrationId++;
lock (meshIdTable)
{
// Update the meshId table
Dictionary<int, PeerNodeAddress> addresses;
if (!meshIdTable.TryGetValue(meshId, out addresses))
{
// MeshID doesn't exist and needs to be added to meshIdTable
newMeshId = true;
addresses = new Dictionary<int, PeerNodeAddress>();
meshIdTable[meshId] = addresses;
}
addresses[registrationId] = nodeAddress;
// Add an entry to the registration table
registrationTable[registrationId] = new Registration(meshId, nodeAddress);
}
}
if (newMeshId)
Console.WriteLine("Registered new meshId {0}", meshId);
return registrationId;
}
示例15: CheckEquality
public void CheckEquality( Registration sut, string key, string other )
{
sut.Key = key;
Assert.True( sut.Equals( key ) );
Assert.False( sut.Equals( other ) );
}