public Logable(IMyEntity entity, string secondaryState) { CallerAssembly = Assembly.GetCallingAssembly(); SecondaryState = secondaryState; if (entity == null) { Context = PrimaryState = null; } else if (entity is IMyCubeBlock) { IMyCubeBlock block = (IMyCubeBlock)entity; Context = block.CubeGrid.NameWithId(); PrimaryState = block.NameWithId(); } else { Context = entity.NameWithId(); PrimaryState = null; } }
public Logable(IMyEntity entity) { CallerAssembly = Assembly.GetCallingAssembly(); if (entity == null) { Context = PrimaryState = SecondaryState = null; } else if (entity is IMyCubeBlock) { IMyCubeBlock block = (IMyCubeBlock)entity; Context = block.CubeGrid.NameWithId(); PrimaryState = block.DefinitionDisplayNameText; SecondaryState = block.NameWithId(); } else { Context = entity.NameWithId(); PrimaryState = SecondaryState = null; } }