本文整理汇总了C#中IEntity类的典型用法代码示例。如果您正苦于以下问题:C# IEntity类的具体用法?C# IEntity怎么用?C# IEntity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IEntity类属于命名空间,在下文中一共展示了IEntity类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: HitBoxMessage
public HitBoxMessage(IEntity source, List<CollisionBox> newboxes, HashSet<string> enable, bool clear)
{
Source = source;
AddBoxes = newboxes;
EnableBoxes = enable;
Clear = clear;
}
开发者ID:laazer,项目名称:cs_megaman,代码行数:7,代码来源:Messages.cs
示例2: OnEntityAdded
public override void OnEntityAdded(IEntity entity)
{
base.OnEntityAdded(entity);
var polygon = entity.GetComponent<HexagonComponent>();
var mesh = polygon.Renderer.Mesh;
var vertices = mesh.vertices;
polygon.Points = new List<PolygonPoint>(vertices.Length);
polygon.Segments = new List<PolygonSegment>(vertices.Length);
polygon.Contour = new PolygonContour();
for (int i = 0; i < vertices.Length - 1; i++)
polygon.Points.Add(new PolygonPoint { Shape = polygon, Index = i });
for (int i = 0; i < polygon.Points.Count; i++)
{
var pointA = polygon.Points[i];
var pointB = polygon.Points[(i + 1) % polygon.Points.Count];
var segment = new PolygonSegment { Shape = polygon, Index = i, PointA = pointA, PointB = pointB };
pointA.SegmentB = segment;
pointB.SegmentA = segment;
polygon.Segments.Add(segment);
polygon.Contour.Segments.Add(segment);
}
}
开发者ID:Magicolo,项目名称:Isomorphage,代码行数:26,代码来源:HexagonSystem.cs
示例3: GetModifier
string GetModifier(IEntity decoration)
{
string ret = "";
if (IncludeHtmlMarkup) {
ret += "<i>";
}
if (decoration.IsStatic) {
ret += "static ";
} else if (decoration.IsSealed) {
ret += "sealed ";
} else if (decoration.IsVirtual) {
ret += "virtual ";
} else if (decoration.IsOverride) {
ret += "override ";
} else if (decoration.IsNew) {
ret += "new ";
}
if (IncludeHtmlMarkup) {
ret += "</i>";
}
return ret;
}
开发者ID:pusp,项目名称:o2platform,代码行数:26,代码来源:CSharpAmbience.cs
示例4: IsAccessible
/// <summary>
/// Gets whether <paramref name="entity"/> is accessible in the current class.
/// </summary>
/// <param name="entity">The entity to test</param>
/// <param name="allowProtectedAccess">Whether protected access is allowed.
/// True if the type of the reference is derived from the current class.</param>
public bool IsAccessible(IEntity entity, bool allowProtectedAccess)
{
if (entity == null)
throw new ArgumentNullException("entity");
// C# 4.0 spec, §3.5.2 Accessiblity domains
switch (entity.Accessibility) {
case Accessibility.None:
return false;
case Accessibility.Private:
return entity.DeclaringTypeDefinition == currentTypeDefinition;
case Accessibility.Public:
return true;
case Accessibility.Protected:
return allowProtectedAccess && IsProtectedAccessible(entity.DeclaringTypeDefinition);
case Accessibility.Internal:
return IsInternalAccessible(entity.ProjectContent);
case Accessibility.ProtectedOrInternal:
return (allowProtectedAccess && IsProtectedAccessible(entity.DeclaringTypeDefinition))
|| IsInternalAccessible(entity.ProjectContent);
case Accessibility.ProtectedAndInternal:
return (allowProtectedAccess && IsProtectedAccessible(entity.DeclaringTypeDefinition))
&& IsInternalAccessible(entity.ProjectContent);
default:
throw new Exception("Invalid value for Accessibility");
}
}
开发者ID:constructor-igor,项目名称:cudafy,代码行数:32,代码来源:MemberLookup.cs
示例5: Insert
/// <summary>插入</summary>
/// <param name="entity"></param>
/// <returns></returns>
public virtual Int32 Insert(IEntity entity)
{
// 添加数据前,处理Guid
SetGuid(entity);
DbParameter[] dps = null;
String sql = SQL(entity, DataObjectMethodType.Insert, ref dps);
if (String.IsNullOrEmpty(sql)) return 0;
Int32 rs = 0;
IEntityOperate op = EntityFactory.CreateOperate(entity.GetType());
//检查是否有标识列,标识列需要特殊处理
FieldItem field = op.Table.Identity;
if (field != null && field.IsIdentity)
{
Int64 res = dps != null && dps.Length > 0 ? op.InsertAndGetIdentity(sql, CommandType.Text, dps) : op.InsertAndGetIdentity(sql);
if (res > 0) entity[field.Name] = res;
rs = res > 0 ? 1 : 0;
}
else
{
rs = dps != null && dps.Length > 0 ? op.Execute(sql, CommandType.Text, dps) : op.Execute(sql);
}
//清除脏数据,避免连续两次调用Save造成重复提交
if (entity.Dirtys != null) entity.Dirtys.Clear();
return rs;
}
开发者ID:windygu,项目名称:asxinyunet,代码行数:34,代码来源:IEntityPersistence.cs
示例6: GetIdForm
internal GetIdForm(IEntity ent, IdHandle idh)
{
InitializeComponent();
m_Entity = ent;
m_IdHandle = idh;
}
开发者ID:steve-stanton,项目名称:backsight,代码行数:7,代码来源:GetIdForm.cs
示例7: EntityCompletionData
ICompletionData ICompletionDataFactory.CreateEntityCompletionData(IEntity entity, string text)
{
return new EntityCompletionData(entity) {
CompletionText = text,
DisplayText = text
};
}
开发者ID:kristjan84,项目名称:SharpDevelop,代码行数:7,代码来源:CSharpCompletionDataFactory.cs
示例8: Init
public override void Init(IEntity entity)
{
base.Init(entity);
DropDownPanel = _uiFactory.GetPanel(entity.ID + "_Panel", new EmptyImage(1f, 1f), 0f, 0f);
DropDownPanel.Visible = false;
_tree = entity.GetComponent<IInObjectTree>();
}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:AGSComboBoxComponent.cs
示例9: TowerEntity
public TowerEntity(ITile location, Texture2D texture, Color color,
bool isBlocked, float layerDepth, IEntity owner)
: base(location)
{
this.destinationRectangle = new Rectangle
{
X = location.Rectangle.X,
Y = location.Rectangle.Y,
Height = location.Rectangle.Height,
Width = location.Rectangle.Width
};
this.enabled = true;
this.isBlocked = true;
this.texture = texture;
this.color = color;
this.layerDepth = layerDepth;
this.owner = owner;
this.timer = 5.0f;
this.IsEnemy = false;
this.Intensity = 70.0f;
this.HP = 150;
this.Damage = 100;
this.attackRate = 50;
}
开发者ID:milesgray,项目名称:resatiate,代码行数:27,代码来源:TowerEntity.cs
示例10: GetModifier
string GetModifier(IEntity decoration)
{
StringBuilder builder = new StringBuilder();
if (IncludeHtmlMarkup) {
builder.Append("<i>");
}
if (decoration.IsStatic) {
builder.Append("Shared ");
}
if (decoration.IsAbstract) {
builder.Append("MustOverride ");
} else if (decoration.IsSealed) {
builder.Append("NotOverridable ");
}
if (decoration.IsVirtual) {
builder.Append("Overridable ");
} else if (decoration.IsOverride) {
builder.Append("Overrides ");
}
if (decoration.IsNew) {
builder.Append("Shadows ");
}
if (IncludeHtmlMarkup) {
builder.Append("</i>");
}
return builder.ToString();
}
开发者ID:SAD1992,项目名称:justdecompile-plugins,代码行数:31,代码来源:VBNetAmbience.cs
示例11: NavigateToEntity
public bool NavigateToEntity(IEntity entity)
{
if (entity == null)
throw new ArgumentNullException("entity");
// Get the underlying entity for generic instance members
while ((entity is IMember) && ((IMember)entity).GenericMember != null)
entity = ((IMember)entity).GenericMember;
IClass declaringType = (entity as IClass) ?? entity.DeclaringType;
if (declaringType == null)
return false;
// get the top-level type
while (declaringType.DeclaringType != null)
declaringType = declaringType.DeclaringType;
ReflectionProjectContent rpc = entity.ProjectContent as ReflectionProjectContent;
if (rpc != null) {
string assemblyLocation = ILSpyController.GetAssemblyLocation(rpc);
if (!string.IsNullOrEmpty(assemblyLocation) && File.Exists(assemblyLocation)) {
NavigateTo(assemblyLocation, declaringType.DotNetName, ((AbstractEntity)entity).DocumentationTag);
return true;
}
}
return false;
}
开发者ID:AdamLStevenson,项目名称:SharpDevelop,代码行数:26,代码来源:NavigateToDecompiledEntityService.cs
示例12: FindReferencesAsync
/// <summary>
/// Finds all references to the specified entity.
/// The results are reported using the callback.
/// FindReferences may internally use parallelism, and may invoke the callback on multiple
/// threads in parallel.
/// </summary>
public static async Task FindReferencesAsync(IEntity entity, IProgressMonitor progressMonitor, Action<SearchedFile> callback)
{
if (entity == null)
throw new ArgumentNullException("entity");
if (progressMonitor == null)
throw new ArgumentNullException("progressMonitor");
if (callback == null)
throw new ArgumentNullException("callback");
SD.MainThread.VerifyAccess();
if (SD.ParserService.LoadSolutionProjectsThread.IsRunning) {
progressMonitor.ShowingDialog = true;
MessageService.ShowMessage("${res:SharpDevelop.Refactoring.LoadSolutionProjectsThreadRunning}");
progressMonitor.ShowingDialog = false;
return;
}
double totalWorkAmount;
List<ISymbolSearch> symbolSearches = PrepareSymbolSearch(entity, progressMonitor.CancellationToken, out totalWorkAmount);
double workDone = 0;
ParseableFileContentFinder parseableFileContentFinder = new ParseableFileContentFinder();
foreach (ISymbolSearch s in symbolSearches) {
progressMonitor.CancellationToken.ThrowIfCancellationRequested();
using (var childProgressMonitor = progressMonitor.CreateSubTask(s.WorkAmount / totalWorkAmount)) {
await s.FindReferencesAsync(new SymbolSearchArgs(childProgressMonitor, parseableFileContentFinder), callback);
}
workDone += s.WorkAmount;
progressMonitor.Progress = workDone / totalWorkAmount;
}
}
开发者ID:2594636985,项目名称:SharpDevelop,代码行数:35,代码来源:FindReferenceService.cs
示例13: Template
public Template(IEntity templateEntity)
{
if(templateEntity == null)
throw new Exception("Template entity is null");
_templateEntity = templateEntity;
}
开发者ID:BravoSierra,项目名称:2sxc,代码行数:7,代码来源:Template.cs
示例14: Delete
/// <summary>
/// Deletes the provided entity.
/// </summary>
/// <param name="entity">The entity to delete.</param>
public override void Delete(IEntity entity)
{
if (entity == null)
throw new ArgumentNullException("entity");
using (LogGroup logGroup = LogGroup.StartDebug("Deleting provided '" + entity.ShortTypeName + "' entity."))
{
Db4oDataStore store = (Db4oDataStore)GetDataStore(entity);
if (DataAccess.Data.IsStored(entity))
{
using (Batch batch = BatchState.StartBatch())
{
IDataReader reader = Provider.InitializeDataReader();
reader.AutoRelease = false;
entity = reader.GetEntity(entity);
if (entity == null)
throw new Exception("The entity wasn't found.");
// PreDelete must be called to ensure all references are correctly managed
PreDelete(entity);
// Delete the entity
if (entity != null)
{
store.ObjectContainer.Delete(entity);
store.Commit();
}
}
}
}
}
开发者ID:jeremysimmons,项目名称:sitestarter,代码行数:39,代码来源:Db4oDataDeleter.cs
示例15: Init
public override void Init(IEntity entity)
{
base.Init(entity);
_transform = entity.GetComponent<ITranslateComponent>();
_uiEvents = entity.GetComponent<IUIEvents>();
_uiEvents.MouseDown.Subscribe(onMouseDown);
}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:AGSDraggableComponent.cs
示例16: OnAdded
public override void OnAdded(IEntity parent)
{
base.OnAdded( parent );
if ( parent is Mobile && Burning )
Mobiles.MeerMage.StopEffect( (Mobile)parent, true );
}
开发者ID:nathanvy,项目名称:runuo,代码行数:7,代码来源:Torch.cs
示例17: OnAdded
public override void OnAdded(IEntity parent)
{
if ( Burning && parent is Container )
Douse();
base.OnAdded( parent );
}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:7,代码来源:BaseEquipableLight.cs
示例18: IsHiddenBy
private static bool IsHiddenBy(IEntity entity, IEnumerable<IEntity> members)
{
var m = entity as IMethod;
if (m != null)
return members.OfType<IMethod>().Any(existing => SameNameAndSignature(m, existing));
return members.OfType<IEntity>().Any(existing => existing.Name == entity.Name);
}
开发者ID:Bombadil77,项目名称:boo,代码行数:7,代码来源:MemberCollector.cs
示例19: Rename
public static void Rename (IEntity entity, string newName)
{
if (newName == null) {
var options = new RefactoringOptions () {
SelectedItem = entity
};
new RenameRefactoring ().Run (options);
return;
}
using (var monitor = new NullProgressMonitor ()) {
var col = ReferenceFinder.FindReferences (entity, true, monitor);
List<Change> result = new List<Change> ();
foreach (var memberRef in col) {
var change = new TextReplaceChange ();
change.FileName = memberRef.FileName;
change.Offset = memberRef.Offset;
change.RemovedChars = memberRef.Length;
change.InsertedText = newName;
change.Description = string.Format (GettextCatalog.GetString ("Replace '{0}' with '{1}'"), memberRef.GetName (), newName);
result.Add (change);
}
if (result.Count > 0) {
RefactoringService.AcceptChanges (monitor, result);
}
}
}
开发者ID:RainsSoft,项目名称:playscript-monodevelop,代码行数:27,代码来源:RenameRefactoring.cs
示例20: Delete
public static int Delete( int id, IEntity obj, EntityInfo entityInfo )
{
List<IInterceptor> ilist = MappingClass.Instance.InterceptorList;
for (int i = 0; i < ilist.Count; i++) {
ilist[i].BeforDelete( obj );
}
int rowAffected = 0;
rowAffected += deleteSingle( id, entityInfo );
if (entityInfo.ChildEntityList.Count > 0) {
foreach (EntityInfo info in entityInfo.ChildEntityList) {
rowAffected += deleteSingle( id, MappingClass.Instance.ClassList[info.Type.FullName] as EntityInfo );
}
}
if (entityInfo.Parent != null) {
IEntity objP = Entity.New( entityInfo.Parent.Type.FullName );
rowAffected += deleteSingle( id, Entity.GetInfo( objP ) );
}
for (int i = 0; i < ilist.Count; i++) {
ilist[i].AfterDelete( obj );
}
CacheUtil.CheckCountCache( "delete", obj, entityInfo );
return rowAffected;
}
开发者ID:nust03,项目名称:xcore,代码行数:27,代码来源:DeleteOperation.cs
注:本文中的IEntity类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论