本文整理汇总了C#中EntityType.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# EntityType.ToString方法的具体用法?C# EntityType.ToString怎么用?C# EntityType.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntityType
的用法示例。
在下文中一共展示了EntityType.ToString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetChildDetailsUrl
public static string GetChildDetailsUrl(this Entity entity, EntityGroup group, EntityType entityType, Guid guid)
{
string url = String.Format(
"~/{0}/{1}Details.aspx?guid={2}",
group.ToString().ToLower(),
entityType.ToString(),
guid.ToString());
return url;
}
示例2: GetNewChildFormUrl
public static string GetNewChildFormUrl(this Entity entity, EntityType entityType)
{
EntityGroup group = GetDefaultEntityGroup(entityType);
string url = String.Format(
"~/{0}/{1}Form.aspx?parentGuid={2}",
group.ToString().ToLower(),
entityType.ToString(),
entity.Guid.ToString());
return url;
}
示例3: GetDetailsUrl
public static string GetDetailsUrl(EntityType entityType, EntityGroup group, Guid guid)
{
string url = string.Empty;
OverrideEntityGroup(entityType, ref group);
url = String.Format(
"~/{0}/{1}Details.aspx?guid={2}",
group.ToString().ToLower(),
entityType.ToString(),
guid.ToString());
return url;
}
示例4: GetProjectActivitiesByFilter
public IEnumerable<ProjectActivityWrapper> GetProjectActivitiesByFilter(int projectId, ApiDateTime periodStart, ApiDateTime periodStop, Guid user, EntityType? entity, int lastId)
{
var filter = new ProjectActivityFilter
{
ProjectId = projectId,
UserId = user,
Type = entity.ToString(),
From = periodStart,
To = periodStop,
SortBy = _context.SortBy,
SortOrder = !_context.SortDescending,
SearchText = _context.FilterValue,
Offset = (int) _context.StartIndex,
Max = (int) _context.Count,
LastId = lastId
};
_context.SetDataPaginated();
_context.SetDataFiltered();
_context.SetDataSorted();
return EngineFactory.GetProjectActivityEngine().GetByFilter(filter).NotFoundIfNull().Select(a => new ProjectActivityWrapper(a)).ToSmartList();
}
示例5: Entity
public Entity(SpriteBatch spriteBatch, Soul game, string filename, Vector2 dimension, string alias, EntityType type)
{
sprite = new Sprite(spriteBatch, game, filename);
screenBoundaries = new Rectangle(0, 0, Constants.RESOLUTION_VIRTUAL_WIDTH, Constants.RESOLUTION_VIRTUAL_HEIGHT);
this.alias = alias;
this.dimension = dimension;
offset.X = dimension.X * 0.5f;
offset.Y = dimension.Y * 0.5f;
this.type = type;
animation = new Animation(((int)(sprite.X / dimension.X)) - 1);
this.game = game;
this.spriteBatch = spriteBatch;
//IniFile config = new IniFile("Content\\Config\\config.ini");
//config.parse();
debug = bool.Parse(game.config.getValue("Debug","Hitbox"));
bool varyingEntity = false;
List<String> varyingEntities = new List<string>();
varyingEntities.Add("BLUE_BLOOD_VESSEL");
varyingEntities.Add("RED_BLOOD_VESSEL");
varyingEntities.Add("PURPLE_BLOOD_VESSEL");
varyingEntities.Add("DARK_THOUGHT");
varyingEntities.Add("DARK_WHISPER");
varyingEntities.Add("INNER_DEMON");
varyingEntities.Add("LESSER_DEMON");
varyingEntities.Add("NIGHTMARE");
varyingEntities.Add("PLAYER");
varyingEntities.Add("BOSS");
foreach (String entityType in varyingEntities)
{
if (type.ToString().Equals(entityType))
{
varyingEntity = true;
}
}
if (varyingEntity)
{
//IniFile ini = new IniFile("Content\\Config\\constants.ini");
//ini.parse();
health = int.Parse(game.constants.getValue(type.ToString(), "HEALTH"));
if (type.ToString().Equals("PLAYER"))
{
maxHealth = int.Parse(game.constants.getValue(type.ToString(), "MAXHEALTH"));
}
if (!type.ToString().Equals("BOSS"))
{
hitRadius = int.Parse(game.constants.getValue(type.ToString(), "RADIUS"));
maxVelocity = new Vector2(float.Parse(game.constants.getValue(type.ToString(), "SPEED")), float.Parse(game.constants.getValue(type.ToString(), "SPEED")));
}
if (!type.ToString().Equals("INNER_DEMON") && !type.ToString().Equals("LESSER_DEMON") && !type.ToString().Equals("BOSS"))
{
damage = int.Parse(game.constants.getValue(type.ToString(), "DAMAGE"));
}
if (type.ToString().Equals("DARK_THOUGHT") || type.ToString().Equals("PLAYER"))
{
fireRate = float.Parse(game.constants.getValue(type.ToString(), "RATE"));
}
if (type.ToString().Equals("DARK_THOUGHT") || type.ToString().Equals("BOSS"))
{
burst = int.Parse(game.constants.getValue(type.ToString(), "BURSTPERIOD"));
}
if (type.ToString().Equals("INNER_DEMON") || type.ToString().Equals("BOSS"))
{
minSpawn = int.Parse(game.constants.getValue(type.ToString(), "MINSPAWN"));
maxSpawn = int.Parse(game.constants.getValue(type.ToString(), "MAXSPAWN"));
}
if (type.ToString().Equals("DARK_WHISPER"))
{
spikeDamage = int.Parse(game.constants.getValue(type.ToString(), "SPIKEDAMAGE"));
spikeSpeed = int.Parse(game.constants.getValue(type.ToString(), "SPIKESPEED"));
spikeRange = int.Parse(game.constants.getValue(type.ToString(), "SPIKERANGE"));
}
}
}
示例6: RegisterClientScript
private void RegisterClientScript(EntityType entityType)
{
var apiServer = new Api.ApiServer();
var templateConatainerList = apiServer.GetApiResponse(
String.Format("{0}crm/{1}/tasktemplatecontainer.json", SetupInfo.WebApiBaseUrl, entityType.ToString().ToLower()), "GET");
Page.JsonPublisher(templateConatainerList, "templateConatainerList");
}
示例7: GetItems
public virtual List<TaskTemplateContainer> GetItems(EntityType entityType)
{
if (!_supportedEntityType.Contains(entityType))
throw new ArgumentException("", entityType.ToString());
using (var db = GetDb())
{
return db.ExecuteList(GetQuery(Exp.Eq("entity_type", (int)entityType)))
.ConvertAll(row => ToObject(row));
}
}
示例8: SetupPool
private void SetupPool(EntityType Type, List<GameObject> Pool, int Amount)
{
GameObject prefab = GetPrefabByType(Type);
if (prefab != null)
{
GameObject holder = new GameObject(Type.ToString() + " Holder");
holder.transform.SetParent(transform);
holder.transform.position = Vector3.zero;
holder.transform.rotation = Quaternion.identity;
for (int i = 0; i < Amount; i++)
{
GameObject o = Instantiate(prefab, prefab.transform.position, prefab.transform.rotation) as GameObject;
TransportEntityView objView = o.AddComponent<TransportEntityView>();
objView.Spawner = this;
objView.Type = Type;
o.SetActive(false);
o.transform.SetParent(holder.transform);
Pool.Add(o);
if(Type == EntityType.Car)
prefab = GetPrefabByType(Type);
}
}
}
示例9: DataListContactTab
public static void DataListContactTab(BasePage page, Int32 entityID, EntityType entityType)
{
page.RegisterInlineScript(String.Format(" var entityData = {0}; ",
JsonConvert.SerializeObject(new
{
id = entityID,
type = entityType.ToString().ToLower()
})), onReady: false);
}
示例10: GetEntityTypes
private static Dictionary<int, string> GetEntityTypes(EntityType type)
{
XDocument doc = XDocument.Load(path);
var x = from c in doc.Descendants(type.ToString())
select c.DescendantNodes().ToList();
Dictionary<int, string> list = new Dictionary<int, string>();
foreach (XElement item in x.FirstOrDefault())
{
int id = int.Parse(item.Attribute(GlobalStringResource.Identifier).Value);
string name = item.Attribute(GlobalStringResource.Name).Value;
list.Add(id, name);
}
return list;
}
示例11: SendOffensiveEntityMail
private void SendOffensiveEntityMail(ReportEntityDetails details, EntityType entityType)
{
//// TODO: Need to send mail asynchronously.
try
{
// Send Mail.
var request = new FlaggedRequest()
{
ID = details.ReportEntityID,
EntityType = entityType,
ParentID = details.ParentID,
UserComments = details.Comment,
FlaggedOn = DateTime.UtcNow,
FlaggedAs = details.ReportEntityType.ToString(),
UserID = details.ReportedByID,
UserName = details.ReportedBy,
UserLink = string.Format(CultureInfo.InvariantCulture, "{0}Profile/Index/{1}", HttpContext.Request.Url.GetServerLink(), details.ReportedByID),
};
switch (entityType)
{
case EntityType.Community:
case EntityType.Folder:
request.Link = string.Format(CultureInfo.InvariantCulture, "{0}Community/Index/{1}", HttpContext.Request.Url.GetServerLink(), details.ReportEntityID);
break;
default:
request.Link = string.Format(CultureInfo.InvariantCulture, "{0}{1}/Index/{2}", HttpContext.Request.Url.GetServerLink(), entityType.ToString(), details.ReportEntityID);
break;
}
_notificationService.NotifyFlagged(request);
}
catch (Exception)
{
// Ignore all exceptions.
}
}
示例12: DetachFileFromEntity
public void DetachFileFromEntity(EntityType entityType, int entityId, object fileId)
{
using (var dao = FilesIntegration.GetTagDao())
{
dao.RemoveTags(new Tag(entityType.ToString() + entityId, TagType.System, Guid.Empty) {EntryType = FileEntryType.File, EntryId = fileId});
}
}
示例13: AttachFileToEntity
public void AttachFileToEntity(EntityType entityType, int entityId, object fileId)
{
using (var dao = FilesIntegration.GetTagDao())
{
dao.SaveTags(new Tag(entityType.ToString() + entityId, TagType.System, Guid.Empty) {EntryType = FileEntryType.File, EntryId = fileId});
GenerateImageThumb(GetFile(fileId, 0));
}
}