本文整理汇总了C#中Profile类的典型用法代码示例。如果您正苦于以下问题:C# Profile类的具体用法?C# Profile怎么用?C# Profile使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Profile类属于命名空间,在下文中一共展示了Profile类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:hallambaker,项目名称:Mathematical-Mesh,代码行数:30,代码来源:Main.cs
示例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;
}
}
开发者ID:angieduan,项目名称:wowmultiplay,代码行数:30,代码来源:Helper_Profile.cs
示例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());
}
}
开发者ID:pengyancai,项目名称:cs-util,代码行数:30,代码来源:PopSessionCreator.cs
示例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);
}
开发者ID:srichatala,项目名称:Asp.Net_WebAPI_App,代码行数:32,代码来源:ProfilesController.cs
示例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();
}
开发者ID:shawnewallace,项目名称:r-and-d,代码行数:25,代码来源:AddProfileInteractor.cs
示例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;
}
开发者ID:RamanBut-Husaim,项目名称:TermWork-SignalRChat,代码行数:26,代码来源:UserAccountMapper.cs
示例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);
}
}
开发者ID:MatkoHanus,项目名称:STUPS,代码行数:30,代码来源:NewUIATestProfileCommand.cs
示例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();
}
开发者ID:Alkinn,项目名称:PFA-Seriousgame,代码行数:7,代码来源:ProfileManager.cs
示例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;
}
开发者ID:davinx,项目名称:DVB.NET---VCR.NET,代码行数:33,代码来源:SourceItem.cs
示例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);
}
}
开发者ID:SunBuild,项目名称:azure-clone-webapps,代码行数:33,代码来源:Program.cs
示例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();
}
开发者ID:Deathnetworks,项目名称:VaultRunner,代码行数:35,代码来源:GreedEvents.cs
示例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;
}
开发者ID:SunBuild,项目名称:azure-clone-webapps,代码行数:27,代码来源:Program.cs
示例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);
}
开发者ID:follesoe,项目名称:fsharpintro,代码行数:26,代码来源:MainViewModel.cs
示例14: UpdateModelInfo
static void UpdateModelInfo(dynamic model)
{
var modelType = model.GetType();
var profile = new Profile();
profile.Address1 = model.Address1;
profile.Telephone = model.Telephone;
}
开发者ID:thekoehl,项目名称:dot-NET-stuff-to-remember,代码行数:7,代码来源:Program.cs
示例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;
}
}
开发者ID:riskypathak,项目名称:Poster,代码行数:27,代码来源:ProfileController.cs
示例16: Start
void Start()
{
player = GameObject.FindObjectOfType<Player>();
profile = GameObject.FindObjectOfType<Profile>();
dotSpawner = GameObject.FindObjectOfType<DotSpawner>();
feerieSpawner = GameObject.FindObjectOfType<FeerieSpawner>();
message = GameObject.Find("Message").GetComponent<Text>();
timeButtons = RectTransform.FindObjectsOfType<Button>();
Button[] newTimeButtons = new Button[timeButtons.Length];
for (int i = 0; i < timeButtons.Length; i++)
{
for (int j = 0; j < timeButtons.Length; j++)
{
if (timeButtons[j].name.Contains((i + 1).ToString()))
{
newTimeButtons[i] = timeButtons[j];
break;
}
}
}
timeButtons = newTimeButtons;
hideButtons();
dotSpawner.setMode(DotSpawner.ModeSpawner.silent);
//feerieSpawner.setSilence(true);
startTimer = 0f;
started = false;
unlocked = false;
Screen.sleepTimeout = 10;
}
开发者ID:TeamTendresse,项目名称:GGJ16,代码行数:31,代码来源:GameManager.cs
示例17: AddProfileToDatabase
// Create new profile using Entity Framework and save the changes to the database
private void AddProfileToDatabase(String name)
{
if (textBoxName.Text.Length == 0)
{
MessageBox.Show(@"Please enter a name");
return;
}
if (textBoxName.Text.Length > 20)
{
MessageBox.Show(@"There is a limit of 20 characters" + Environment.NewLine +
@"You entered " + textBoxName.Text.Length + @" characters");
return;
}
using (var db = new HighscoresEntities())
{
var profile = new Profile {ProfileName = name};
db.Profiles.Add(profile);
db.SaveChanges();
}
textBoxName.Clear();
CollapseForm();
}
开发者ID:cstewart90,项目名称:maths-quiz,代码行数:27,代码来源:FormProfile.cs
示例18: CreateNewProfile
public void CreateNewProfile(string newProfileName)
{
Profile newProfile = new Profile(newProfileName, 0);
string[] profileParser = new string[_Profiles.Count + 1];
string profileLineConvention = newProfile.ProfileName + "[&]";
profileLineConvention += 0 + "[&]";
profileParser[0] = profileLineConvention;
for (int i = 0; i < _Profiles.Count; i++)
{
profileLineConvention = _Profiles[i].ProfileName + "[&]";
profileLineConvention += _Profiles[i].CampaignProgress + "[&]";
profileParser[i + 1] = profileLineConvention;
}
if (!System.IO.Directory.Exists(pathToDirectory))
System.IO.Directory.CreateDirectory(pathToDirectory);
try
{
System.IO.File.WriteAllLines(pathToProfiles, profileParser);
//Clear list
_Profiles.Clear();
//Load new list with new profiles
ParseProfile();
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
开发者ID:Bang-Bang-Studios,项目名称:Big-Sunday,代码行数:30,代码来源:ProfileManager.cs
示例19: LoadProfiles_SettingsIsEmpty_ShouldReturnExistentProfilesEnumerable
public void LoadProfiles_SettingsIsEmpty_ShouldReturnExistentProfilesEnumerable([Content] Item item, CurrentInteraction currentInteraction, ITracker tracker, Profile profile)
{
var profileSettingItem = item.Add("profileSetting", new TemplateID(Templates.ProfilingSettings.ID));
var profileItem = item.Add("profile", new TemplateID(ProfileItem.TemplateID));
var provider = new ProfileProvider();
var fakeSiteContext = new FakeSiteContext(new StringDictionary
{
{
"rootPath", "/sitecore"
},
{
"startItem", profileSettingItem.Paths.FullPath.Remove(0, "/sitecore".Length)
}
});
fakeSiteContext.Database = item.Database;
using (new SiteContextSwitcher(fakeSiteContext))
{
provider.GetSiteProfiles().Count().Should().Be(0);
}
}
开发者ID:robearlam,项目名称:Habitat,代码行数:25,代码来源:ProfileProviderTests.cs
示例20: TestAuthenticateAnonymousMechanismSpecified
public void TestAuthenticateAnonymousMechanismSpecified()
{
using (var server = new ImapPseudoServer()) {
server.Start();
var prof = new Profile(null, "user%40imap.example.net;auth=anonymous", server.HostPort);
// greeting
server.EnqueueResponse("* OK ready\r\n");
// CAPABILITY response
server.EnqueueResponse("* CAPABILITY IMAP4rev1 AUTH=ANONYMOUS\r\n" +
"0000 OK done\r\n");
// AUTHENTICATE response
server.EnqueueResponse("+ \r\n");
server.EnqueueResponse("* CAPABILITY IMAP4rev1\r\n" +
"0001 OK done\r\n");
using (var session = ImapSessionCreator.CreateSession(prof, null, null)) {
Assert.AreEqual(ImapSessionState.Authenticated, session.State);
Assert.AreEqual(prof.Authority, session.Authority);
}
server.DequeueRequest(); // CAPABILITY
StringAssert.Contains("AUTHENTICATE ANONYMOUS", server.DequeueRequest());
StringAssert.Contains("[email protected]", Base64.GetDecodedString(server.DequeueRequest()));
}
}
开发者ID:pengyancai,项目名称:cs-util,代码行数:27,代码来源:ImapSessionCreator.cs
注:本文中的Profile类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论