本文整理汇总了C#中Profile类的典型用法代码示例。如果您正苦于以下问题:C# Profile类的具体用法?C# Profile怎么用?C# Profile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Profile类属于命名空间,在下文中一共展示了Profile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Populate
public void Populate() {
var Profile1 = new Profile {
Title = "Main Profile",
};
Profile1.Fingerprint.Value = "blahhhh";
Selector.Add(Profile1);
var Profile2 = new Profile {
Title = "Site Profile"
};
Profile2.Fingerprint.Value = "More blahdy blah";
Selector.Add(Profile2);
Profile1.Devices.Value = new List<Goedel.Trojan.Object>();
var Device1 = new Device {
Title = "Voodoo" };
Profile1.Devices.Value.Add(Device1);
var Device2 = new Device {
Title = "iPad" };
Profile1.Devices.Value.Add(Device2);
var Device3 = new Device {
Title = "Router" };
Profile1.Devices.Value.Add(Device3);
}
示例2: LoadProfile
public static Profile LoadProfile(string ProfileFilePath)
{
Helper_FileEncoding.CheckFileEncodingAndChange(ProfileFilePath, Setting_Global.DefaultIniFileEncoding);
string ProfileName = Path.GetFileName(ProfileFilePath);
string[] ButtonsName = Helper_INIFile.IniGetAllSections(ProfileFilePath);
if (ButtonsName.Length > 0)
{
Profile.Button[] ProfileButtons = new Profile.Button[ButtonsName.Length];
for (int i = 0; i < ButtonsName.Length; i++)
{
string ButtonName = ButtonsName[i];
string KeyQuery = Helper_INIFile.IniReadValue(ButtonsName[i], "KeyQuery", ProfileFilePath);
int Repeat = Convert.ToInt32(Helper_INIFile.IniReadValue(ButtonsName[i], "Repeat", ProfileFilePath));
Profile.Button.TimeInterval RepeatInterval = new Profile.Button.TimeInterval(Helper_INIFile.IniReadValue(ButtonsName[i], "RepeatInterval", ProfileFilePath));
Profile.Button ProfileButton = new Profile.Button(ButtonName, KeyQuery, Repeat, RepeatInterval);
ProfileButtons[i] = ProfileButton;
}
Profile Profile = new Profile(ProfileName, ProfileButtons);
return Profile;
}
else
{
return null;
}
}
示例3: TestAuthenticateAnonymousMechanismSpecifiedAuthenticationFailure
public void TestAuthenticateAnonymousMechanismSpecifiedAuthenticationFailure()
{
using (var server = new PopPseudoServer()) {
server.Start();
var prof = new Profile(null, "user%40pop.example.net;auth=anonymous", server.HostPort);
// greeting
server.EnqueueResponse("+OK\r\n");
// CAPA response
server.EnqueueResponse("+OK\r\n" +
"SASL ANONYMOUS\r\n" +
".\r\n");
// AUTH response
server.EnqueueResponse("-ERR\r\n");
try {
Assert.IsNull(PopSessionCreator.CreateSession(prof, null, null));
Assert.Fail("PopAuthenticationException not thrown");
}
catch (PopAuthenticationException ex) {
Assert.IsNull(ex.InnerException);
Assert.IsNotNull(ex.Result);
Assert.AreEqual(Protocol.Client.PopCommandResultCode.Error, ex.Result.Code);
}
server.DequeueRequest(); // CAPA
StringAssert.StartsWith("AUTH ANONYMOUS dXNlckBwb3AuZXhhbXBsZS5uZXQ=", server.DequeueRequest());
}
}
示例4: PutProfile
public async Task<IHttpActionResult> PutProfile(int id, Profile profile)
{
if (!ModelState.IsValid)
{
return BadRequest(ModelState);
}
if (id != profile.ProfileID)
{
return BadRequest();
}
db.Entry(profile).State = EntityState.Modified;
try
{
await db.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!ProfileExists(id))
{
return NotFound();
}
else
{
throw;
}
}
return StatusCode(HttpStatusCode.NoContent);
}
示例5: SetUp
public void SetUp()
{
var validatorMock = new Mock<IValidator>();
validatorMock.Setup(v => v.TryValidate(It.IsAny<Profile>()))
.Returns(true);
var repoMock = new Mock<IRepository<Profile, int>>();
repoMock.Setup(m => m.Add(It.IsAny<Profile>()))
.Returns(new Profile
{
Id = 65,
FirstName = "Joe",
LastName = "Smith",
EmailAddress = "[email protected]"
});
_interactor = new AddProfileInteractor(repoMock.Object, validatorMock.Object)
{
FirstName = "Joe",
LastName = "Smith",
EmailAddress = "[email protected]"
};
_result = _interactor.Execute();
}
示例6: BuildRegister
public User BuildRegister(AccountRegisterViewModel viewModel)
{
if (viewModel == null)
{
throw new ArgumentNullException("viewModel");
}
if (!viewModel.Password.Equals(viewModel.PasswordConfirmation))
{
throw new ArgumentException("The passwords are not equal.");
}
var resultUser = new User(viewModel.Email);
var resultProfile = new Profile(resultUser);
resultUser.UserProfile = resultProfile;
resultProfile.FirstName = viewModel.FirstName;
resultProfile.LastName = viewModel.LastName;
resultProfile.RegistrationDate = DateTime.UtcNow;
resultProfile.LastSignIn = DateTime.UtcNow;
resultProfile.LastSignOut = DateTime.UtcNow;
resultProfile.IsSignedIn = true;
resultUser.PasswordSalt =
this._hashGenerator.GenerateSalt(User.MaxLengthFor.PasswordSalt);
resultUser.PasswordHash = this._hashGenerator.GetPasswordHash(
viewModel.Password,
resultUser.PasswordSalt);
return resultUser;
}
示例7: BeginProcessing
protected override void BeginProcessing()
{
Profile profile = new Profile(Name);
Profile checkProfile =
CurrentData.GetProfile(profile.Name);
if (checkProfile == null) {
CurrentData.Profiles.Add(profile);
WriteObject(this, profile);
} else {
// 20130323
// ErrorRecord err =
// new ErrorRecord(
// new Exception("The profile already exists"),
// "ProfileAlreadyExists",
// ErrorCategory.InvalidArgument,
// profile);
// err.ErrorDetails =
// new ErrorDetails("The profile already exists");
// WriteError(this, err, true);
WriteError(
this,
"The profile already exists",
"ProfileAlreadyExists",
ErrorCategory.InvalidArgument,
true);
}
}
示例8: saveExistingProfile
public void saveExistingProfile(Profile profileToBeSaved)
{
BinaryFormatter bf = new BinaryFormatter();
FileStream file = File.Open(Application.dataPath + "/../Profiles/" + profileToBeSaved.getFileName(), FileMode.Create);
bf.Serialize(file, profileToBeSaved);
file.Close();
}
示例9: CreateSortedListFromProfile
/// <summary>
/// Meldet alle Quellen zu einem Geräteprofil vorbereitet zur Anzeige.
/// </summary>
/// <param name="profile">Das gewünschte Geräteprofil.</param>
/// <returns>Die sortierte Liste aller Quellen.</returns>
public static List<SourceItem> CreateSortedListFromProfile( Profile profile )
{
// Create list
List<SourceItem> items =
profile
.AllSources
.Where( s => { Station st = (Station) s.Source; return st.IsService || (st.SourceType != SourceTypes.Unknown); } )
.Select( s => new SourceItem( s ) )
.ToList();
// Sort by unique name
items.Sort( ( l, r ) => string.Compare( l.Source.QualifiedName, r.Source.QualifiedName, StringComparison.InvariantCultureIgnoreCase ) );
// Link together
for (int i = 0; i < items.Count; )
{
// Back
if (i > 0)
items[i].PreviousSource = items[i - 1].Source;
// Forward
if (++i < items.Count)
items[i - 1].NextSource = items[i].Source;
}
// Report
return items;
}
示例10: SyncDatabases
public static void SyncDatabases(Profile src, Profile dest , string dbtype)
{
DeploymentSyncOptions syncOptions = new DeploymentSyncOptions();
DeploymentBaseOptions destBaseOptions = new DeploymentBaseOptions();
DeploymentBaseOptions sourceBaseOptions = new DeploymentBaseOptions();
destBaseOptions.Trace += TraceEventHandler;
sourceBaseOptions.Trace += TraceEventHandler;
destBaseOptions.TraceLevel = TraceLevel.Verbose;
sourceBaseOptions.TraceLevel = TraceLevel.Verbose;
DeploymentProviderOptions destProviderOptions = null;
DeploymentObject sourceObj = null;
if (dbtype.Equals("mysql", StringComparison.InvariantCultureIgnoreCase))
{
destProviderOptions = new DeploymentProviderOptions(DeploymentWellKnownProvider.DBMySql);
destProviderOptions.Path = dest.mysqlConnectionstring;
sourceObj = DeploymentManager.CreateObject(DeploymentWellKnownProvider.DBMySql, src.mysqlConnectionstring, sourceBaseOptions);
}
else if (dbtype.Equals("sql", StringComparison.InvariantCultureIgnoreCase))
{
destProviderOptions = new DeploymentProviderOptions(DeploymentWellKnownProvider.DBFullSql);
destProviderOptions.Path = dest.sqlazureconnectionstring;
sourceObj = DeploymentManager.CreateObject(DeploymentWellKnownProvider.DBFullSql,src.sqlazureconnectionstring, sourceBaseOptions);
}
if (sourceObj != null)
{
sourceObj.SyncTo(destProviderOptions, destBaseOptions, syncOptions);
}
}
示例11: FoundPortal
public GreedState FoundPortal()
{
if (ProfileManager.CurrentProfile.Path != _GreedProfile && ProfileManager.CurrentProfile.Path != _GreedProfileBackUp)
{
Logger.Log("Loading Greed Profile - " + DateTime.Now.ToString());
_currentProfile = ProfileManager.CurrentProfile;
LoadProfile(_GreedProfile, true, 1);
if (ProfileManager.CurrentProfile.Path != _GreedProfile)
LoadProfile(_GreedProfileBackUp, true, 1);
}
if (ZetaDia.CurrentWorldId != 379962 && ZetaDia.CurrentWorldId != 380753)
{
DiaObject portalObject = ZetaDia.Actors.RActorList.OfType<DiaObject>().FirstOrDefault(r => r.ActorSNO == _GreedPortalSNO);
if (portalObject != null && !ZetaDia.Me.IsInCombat)
{
Logger.Log("Moving to portal - Distance " + (int)ZetaDia.Me.Position.Distance2D(portalObject.Position) + " feet away");
Navigator.MoveTo(portalObject.Position);
PauseBot(0, 300);
portalObject.Interact();
PauseBot(0, 300);
}
}
else
return GreedState.InsidePortal;
return ConfirmWorld();
}
示例12: getProfile
public static Profile getProfile(XmlDocument doc )
{
XmlElement root = doc.DocumentElement;
XmlNodeList list = root.SelectNodes("//publishProfile");
Profile profiledata = new Profile();
foreach (XmlNode node in list)
{
if (node.Attributes["profileName"].Value.Contains("Web Deploy"))
{
profiledata.userPwd = node.Attributes["userPWD"].Value;
profiledata.userName = node.Attributes["userName"].Value;
profiledata.mysqlConnectionstring = node.Attributes["mySQLDBConnectionString"].Value;
profiledata.sqlazureconnectionstring = node.Attributes["SQLServerDBConnectionString"].Value;
profiledata.publishUrl = node.Attributes["publishUrl"].Value;
profiledata.sitename = node.Attributes["msdeploySite"].Value;
profiledata.destinationUrl = node.Attributes["destinationAppUrl"].Value;
return profiledata;
}
}
return null;
}
示例13: MainViewModel
public MainViewModel()
{
Model = new PlotModel();
var profile = new Profile(Gender.Male, 80);
var start = DateTime.Now.AddHours(-5);
var drinks = new List<DrinkEntry> {
new DrinkEntry(DrinkType.Beer, start.AddMinutes(5), 330.0, 4.6),
new DrinkEntry(DrinkType.Beer, start.AddMinutes(25), 330.0, 4.6),
new DrinkEntry(DrinkType.Beer, start.AddMinutes(50), 330.0, 4.6),
new DrinkEntry(DrinkType.Beer, start.AddMinutes(75), 330.0, 4.6),
new DrinkEntry(DrinkType.Spirits, start.AddMinutes(90), 40.0, 40.0)
};
var result = Library.Promillekoll.calculateAlcoholLevelOverTime(profile, ListModule.OfSeq(drinks));
var series = new LineSeries("Alcohol Level");
foreach (var entry in result)
{
var minutesSinceFirstDrink = entry.Item1.Subtract(start).TotalMinutes;
series.Points.Add(new DataPoint(minutesSinceFirstDrink, entry.Item2));
}
Model.Series.Add(series);
}
示例14: UpdateModelInfo
static void UpdateModelInfo(dynamic model)
{
var modelType = model.GetType();
var profile = new Profile();
profile.Address1 = model.Address1;
profile.Telephone = model.Telephone;
}
示例15: Add
public ActionResult Add(Profile model)
{
try
{
if (Request.Form["ProfileTypeId"] == "3")
{
return RedirectToAction("Begin", "Twitter", new { serviceInterval = Convert.ToInt32(Request.Form["Interval"]) });
}
else if (Request.Form["ProfileTypeId"] == "2")
{
return RedirectToAction("Index", "Google");
}
Session["ProfileTypeId"] = Request.Form["ProfileTypeId"];
PageId = Request.Form["PageId"];
ServiceInterval = Convert.ToInt32(Request.Form["Interval"]);
SetPagePermissions();
return Json("Success");
}
catch (Exception ex)
{
JavaScriptSerializer jss = new JavaScriptSerializer();
return Json("Fail");
// throw ex;
}
}