本文整理汇总了C#中UserData类的典型用法代码示例。如果您正苦于以下问题:C# UserData类的具体用法?C# UserData怎么用?C# UserData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UserData类属于命名空间,在下文中一共展示了UserData类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: From
public static UserResult From(UserData item, ISessionAwareCoreService client)
{
var result = new UserResult
{
Description = TextEntry.From(item.Description, Resources.LabelDescription)
};
if (item.IsEnabled == false)
{
result.Status = TextEntry.From(Resources.Disabled, Resources.LabelStatus);
}
if (item.Privileges == 1)
{
result.IsAdministrator = TextEntry.From(Resources.Yes, Resources.LabelIsAdministrator);
}
if (item.LanguageId != null)
{
result.Language = TextEntry.From(GetLanguageById(item.LanguageId.Value, client), Resources.LabelLanguage);
}
if (item.LocaleId != null)
{
result.Locale = TextEntry.From(GetLocaleById(item.LocaleId.Value), Resources.LabelLocale);
}
if (item.GroupMemberships != null)
{
result.GroupMemberships = TextEntry.From(GetGroupMembershipSummary(item.GroupMemberships), Resources.LabelGroupMemberships);
}
AddCommonProperties(item, result);
return result;
}
示例2: AvatarEffectsInventoryComponent
internal AvatarEffectsInventoryComponent(uint UserId, GameClient Client, UserData Data)
{
this.UserId = UserId;
this.Session = Client;
this.Effects = new List<AvatarEffect>();
foreach (AvatarEffect current in Data.effects)
{
if (!current.HasExpired)
{
this.Effects.Add(current);
}
else
{
using (IQueryAdapter queryreactor = CyberEnvironment.GetDatabaseManager().getQueryReactor())
{
queryreactor.runFastQuery(string.Concat(new object[]
{
"DELETE FROM user_effects WHERE user_id = ",
UserId,
" AND effect_id = ",
current.EffectId,
"; "
}));
}
}
}
}
示例3: Post
public async Task<HttpResponseMessage> Post(int campaignId, [FromBody]string jsonUserData)
{
dynamic rawUserData = JsonConvert.DeserializeObject(jsonUserData);
var userData = new UserData() { Name = rawUserData.Name,
Phone = rawUserData.Phone,
Birthday = rawUserData.Birthday,
Email = rawUserData.Email,
CreationDate = DateTimeOffset.Now };
LogExtensions.Log.DebugCall(() => userData);
var campaign = context.Campaigns.Include("OnShareConversionTriggers").FirstOrDefault(x => x.ID == campaignId);
if (campaign == null)
throw new ArgumentException("No campaign was found with an ID: " + campaignId);
var landingUser = context.LandingUsers.FirstOrDefault(user => user.Phone == userData.Phone || (user.Email == userData.Email && user.Phone == null));
if (landingUser == null)
{
landingUser = context.LandingUsers.Add(userData);
}
else
{
landingUser.Phone = string.IsNullOrWhiteSpace(userData.Phone) ? landingUser.Phone : userData.Phone;
landingUser.Email = string.IsNullOrWhiteSpace(userData.Email) ? landingUser.Email : userData.Email;
landingUser.Birthday = (userData.Birthday == null) ? landingUser.Birthday : userData.Birthday;
}
context.SaveChanges();
await TriggerCampaignTriggersAsync(campaign, landingUser, rawUserData);
return Request.CreateResponse(HttpStatusCode.OK);
}
示例4: getObject
public new UserData getObject()
{
XmlSerializer serializer = new XmlSerializer(typeof(UserData));
FileStream fs = new FileStream(xmlFile, FileMode.Open);
UserData udata = new UserData("名称未設定",
"",
2000,
1,
1,
12,
0,
0,
35.685175,
139.7528,
"東京都中央区",
"",
"JST");
try
{
udata = (UserData)serializer.Deserialize(fs);
} catch (Exception e)
{
MessageBox.Show("ファイルの読み込みで異常が発生しました。");
Console.WriteLine(e.Message);
}
fs.Close();
return udata;
}
示例5: btnCreate_Click
private void btnCreate_Click(object sender, RoutedEventArgs e)
{
if (txtAppId.Text.IsNullOrEmpty())
{
MessageBox.Show("Application Id не может быть пустым");
return;
}
using (ConfigurationManager man = new ConfigurationManager())
{
UserData data = new UserData();
data.UserName = txtUserName.Text;
data.Password = txtUserPassword.Text;
data.Email = txtEmail.Text;
data.AppId = long.Parse(txtAppId.Text);
data.AccessKey = txtAccessKey.Text;
if (man.CreateUser(data))
MessageBox.Show("Пользователь успешено создан", "Информация", MessageBoxButton.OK,
MessageBoxImage.Information);
else
MessageBox.Show("Ошибка создания пользователя", "Информация", MessageBoxButton.OK,
MessageBoxImage.Error);
}
Refresh();
}
示例6: User
public User(UserData d, UserEvent e, string filename, int index)
{
udata = d;
uevent = e;
this.filename = filename;
this.index = index;
}
示例7: CreateUser
/**************************************************
* Server Data Services
**************************************************/
public void CreateUser(UserData data)
{
// TODO: Refactor string MySql queries
var query = "INSERT INTO User (UID, Username, Email, Password, DateCreated)" +
"VALUES('" + data.UID + "', '" + data.UserName + "','" +
data.Email + "','" + data.Password + "', Date('" + data.DateCreated.Date.ToString("yyyy-MM-dd HH:mm:ss") + "'))";
using (_mySqlConnection = new MySqlConnection(_mySqlConnectionService.ConnectionString()))
{
using (var command = new MySqlCommand(query, _mySqlConnection))
{
try
{
_mySqlConnection.Open();
command.ExecuteNonQuery();
_mySqlConnection.Close();
Console.print("Created User Successfully");
}
catch (SqlException e)
{
throw new Exception(e.ToString());
}
}
}
}
示例8: CreateTag
public string CreateTag(Tag model, UserData userData)
{
try
{
client = new HttpClient();
var postData = new List<KeyValuePair<string, string>>();
postData.Add(new KeyValuePair<string, string>("name", model.name));
HttpContent content = new FormUrlEncodedContent(postData);
content.Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
content.Headers.Add("Timestamp", userData.Timestamp.ToString());
content.Headers.Add("Digest", userData.AuthenticationHash);
content.Headers.Add("Public-Key", userData.PublicKey);
client.PostAsync("http://localhost:3000/tag", content)
.ContinueWith(postTask =>
{
postTask.Result.EnsureSuccessStatusCode();
var result = postTask.Result.Content.ReadAsStringAsync();
client.Dispose();
return result;
});
}
catch (Exception ex)
{
throw ex;
}
return null;
}
示例9: SaveUserData
public void SaveUserData(UserData products)
{
using (var stream = File.Create(FileName))
{
products.Serialize(stream);
}
}
示例10: OnUpdate
/// <summary>
/// 処理
/// </summary>
/// <param name="part"></param>
public static void OnUpdate( SpritePart part, AttributeBase attribute )
{
bool hasInt = [email protected]( 0 );
bool hasPoint = [email protected]( 1 );
bool hasRect = [email protected]( 2 );
bool hasString = [email protected]( 3 );
Vector2 point = Vector2.zero;
Rect rect = new Rect();
int index = 0;
if ( hasPoint ) {
point = new Vector2( [email protected]( 0 ), [email protected]( 1 ) );
index = 2;
}
if ( hasRect ) {
rect = new Rect(
[email protected]( index + 0 ),
[email protected]( index + 1 ),
[email protected]( index + 2 ),
[email protected]( index + 3 ) );
}
var data = new UserData() {
integer = [email protected]( 0 ),
text = hasString ? [email protected]( 0 ) : null,
point = point,
rect = rect,
};
part.Root.NotifyUserData( part, data );
}
示例11: Autoload
//Load Function called from start of scene to Initialise level/ game
public void Autoload()
{
_FileName="Autosave.xml";
// Load our UserData into myData
QuickLoadXML();
if(_data.ToString() != "")
{
// notice how I use a reference to type (UserData) here, you need this
// so that the returned object is converted into the correct type
myData = (UserData)DeserializeObject(_data);
//Load the save position
savePosition = new Vector3(myData._iUser.x,myData._iUser.y,myData._iUser.z);
//Load the Time
saveTime = myData._iUser.time;
//Load the Date
saveDate = myData._iUser.date;
//Load the Play Time
savePlayTime = myData._iUser.playTime;
//Load Level Name
saveLevelName = myData._iUser.levelName;
//Load Latest Time
saveLatestTime = myData._iUser.latestTime;
// just a way to show that we loaded in ok
//Debug.Log(myData._iUser.x);
}
}
示例12: InventoryComponent
internal InventoryComponent(uint UserId, GameClient Client, UserData UserData)
{
this.mClient = Client;
this.UserId = UserId;
this.floorItems = new HybridDictionary();
this.wallItems = new HybridDictionary();
this.discs = new HybridDictionary();
foreach (UserItem current in UserData.inventory)
{
if (current.GetBaseItem().InteractionType == InteractionType.musicdisc)
{
this.discs.Add(current.Id, current);
}
if (current.isWallItem)
{
this.wallItems.Add(current.Id, current);
}
else
{
this.floorItems.Add(current.Id, current);
}
}
this.InventoryPets = new SafeDictionary<uint, Pet>(UserData.pets);
this.InventoryBots = new SafeDictionary<uint, RoomBot>(UserData.Botinv);
this.mAddedItems = new HybridDictionary();
this.mRemovedItems = new HybridDictionary();
this.isUpdated = false;
}
示例13: DeleteGroup
public string DeleteGroup(string id, UserData userData)
{
try
{
client = new HttpClient();
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("Timestamp", userData.Timestamp.ToString());
client.DefaultRequestHeaders.Add("Digest", userData.AuthenticationHash);
client.DefaultRequestHeaders.Add("Public-Key", userData.PublicKey);
client.DeleteAsync("http://localhost:3000/contact/" + id)
.ContinueWith(deleteTask =>
{
deleteTask.Result.EnsureSuccessStatusCode();
var result = deleteTask.Result.Content.ReadAsStringAsync();
client.Dispose();
return result;
});
}
catch (Exception ex)
{
throw ex;
}
return null;
}
示例14: ConvertFrom
public static UserData ConvertFrom(UserInfo userInfo)
{
var data = new UserData();
data.ID = userInfo.ID;
data.ScreenName = userInfo.ScreenName;
data.Name = userInfo.Name;
data.DefineAs = userInfo.DefineAs;
data.Province = userInfo.Province;
data.City = userInfo.City;
data.Location = userInfo.Location;
data.Description = userInfo.Description;
data.Url = userInfo.Url;
data.ProfileImageUrl = userInfo.ProfileImageUrl;
data.Domain = userInfo.Domain;
data.Gender = userInfo.Gender;
data.FollowersCount = userInfo.FollowersCount;
data.FriendsCount = userInfo.FriendsCount;
data.StatusesCount = userInfo.StatusesCount;
data.FavouritesCount = userInfo.FavouritesCount;
data.CreatedAt = userInfo.CreatedAt;
data.GeoEnabled = userInfo.GeoEnabled;
data.AllowAllActMsg = userInfo.AllowAllActMsg;
data.Following = userInfo.Following;
data.Verified = userInfo.Verified;
if (null != userInfo.LatestStatus)
data.LatestStatus = ConvertFrom(userInfo.LatestStatus);
return data;
}
示例15: CreateData
//saving data.......................................................................................
void CreateData()
{
UserData user = new UserData();
user.q_id = "Start Page";
//user.time1 = Mathf.RoundToInt(Time.timeSinceLevelLoad);
saveData.createData(user);
}