本文整理汇总了C#中ILocation类的典型用法代码示例。如果您正苦于以下问题:C# ILocation类的具体用法?C# ILocation怎么用?C# ILocation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILocation类属于命名空间,在下文中一共展示了ILocation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DepartFrom
public override VoyageState DepartFrom (ILocation location)
{
if(LastKnownLocation.Equals(location.UnLocode))
return this;
string message = string.Format("The voyage departed from {0}.", LastKnownLocation);
throw new ArgumentException(message, "location");
}
示例2: LeaveSystem
/// <summary>Make the object leave the solar system</summary>
/// <param name="obj"></param>
public void LeaveSystem(ILocation @obj)
{
lock (objects)
{
this.objects.Remove(obj);
}
}
示例3: CircleReport
public CircleReport(double time, ILocation loc, double size, GraphicsPath gradientPath)
{
this.time = time;
loc1 = loc;
this.size = size;
this.gradientPath = gradientPath;
}
示例4: GetFaces
public IEnumerable<Face> GetFaces(ILocation location)
{
if (this.contacts.Count == 0) // contacts.xml not loaded for some reason
yield break;
var ini = this.iniFileFinder.FindIn(location);
if (ini == null)
yield break;
var parsed = this.parser.Parse(ini);
var rawFaces = from pair in parsed.Items
from face in pair.Value.Faces
select new { FileName = pair.Key, face.ContactHash };
var contactsIndex = parsed.Contacts.ToDictionary(c => c.Hash);
foreach (var rawFace in rawFaces) {
var contact = contactsIndex.GetValueOrDefault(rawFace.ContactHash);
if (contact == null)
continue;
var file = location.GetFile(rawFace.FileName);
if (file == null)
continue;
var key = new ContactKey(contact.UserCode, contact.ID);
var person = this.contacts.GetValueOrDefault(key);
if (person == null)
continue;
yield return new Face(person, file);
}
}
示例5: GetPiece
public IPiece GetPiece(ILocation location)
{
if (location == null)
throw new ArgumentNullException("Location must not be null");
return GetPiece(location.X, location.Y);
}
示例6: JavaDebugCodeContext
public JavaDebugCodeContext(JavaDebugProgram program, ILocation location)
{
Contract.Requires<ArgumentNullException>(program != null, "program");
Contract.Requires<ArgumentNullException>(location != null, "location");
_program = program;
_location = location;
}
示例7: Copy
public bool Copy(ILocation sourceLocation, ILocation destinationLocation, ReplaceMode replaceMode)
{
if (replaceMode == ReplaceMode.UserAsking)
throw new Exception ("Use Copy(ILocation,ILocation,Func<ReplaceMode>) call.");
return Copy (sourceLocation, destinationLocation, replaceMode, null);
}
示例8: CompareByParts
public static int CompareByParts(this ILocation location1, ILocation location2)
{
var location1Parts = (location1 == null) ? (new string[0]) : (location1.GetParts().ToArray());
var location2Parts = (location2 == null) ? (new string[0]) : (location2.GetParts().ToArray());
for (var i = 0; i < location1Parts.Length && i < location2Parts.Length; i++)
{
var location1Part = location1Parts[i];
var location2Part = location2Parts[i];
var result = string.Compare(location1Part, location2Part, StringComparison.InvariantCultureIgnoreCase);
if (result != 0)
{
return result;
}
}
if (location1Parts.Length < location2Parts.Length)
{
return -1;
}
else if (location1Parts.Length > location2Parts.Length)
{
return 1;
}
return 0;
}
示例9: MigrationEvent
public MigrationEvent(ILocation originLocation, ILocation destinationLocation, int cost, int generation)
: base(destinationLocation, cost, generation)
{
if (originLocation == null) throw new ArgumentNullException("originLocation");
this.OriginLocation = originLocation;
}
示例10: GetWalkPoints
public IEnumerable<ILocation> GetWalkPoints(ILocation from, ILocation to)
{
if (_mask == null || _mask [0] == null)
return new List<ILocation> ();
var grid = CreateGrid(_mask);
return getWalkPoints(grid, from, to);
}
示例11: getWalkPoints
private IEnumerable<ILocation> getWalkPoints(BaseGrid grid, ILocation from, ILocation to)
{
JumpPointParam input = new JumpPointParam (grid, getPos(from), getPos(to), AllowEndNodeUnwalkable, CrossCorner, CrossAdjacentPoint, Heuristics) { UseRecursive = UseRecursive };
var cells = JumpPointFinder.FindPath (input);
if (!SmoothPath) cells = JumpPointFinder.GetFullPath(cells);
return cells.Select (c => getLocation (c, to.Z));
}
示例12: StopOverAt
public void StopOverAt (ILocation location)
{
if(null == location)
throw new ArgumentNullException("location");
// Thread safe, lock free sincronization
VoyageState stateBeforeTransition;
VoyageState previousState = CurrentState;
do
{
stateBeforeTransition = previousState;
VoyageState newValue = stateBeforeTransition.StopOverAt(location);
previousState = Interlocked.CompareExchange<VoyageState>(ref this.CurrentState, newValue, stateBeforeTransition);
}
while (previousState != stateBeforeTransition);
if(!previousState.Equals(this.CurrentState))
{
VoyageEventArgs args = new VoyageEventArgs(previousState.LastKnownLocation, previousState.NextExpectedLocation);
EventHandler<VoyageEventArgs> handler = Stopped;
if(null != handler)
handler(this, args);
}
}
示例13: Leg
public Leg (IVoyage voyage, ILocation loadLocation, DateTime loadTime, ILocation unloadLocation, DateTime unloadTime)
{
if(null == voyage)
throw new ArgumentNullException("voyage");
if(null == loadLocation)
throw new ArgumentNullException("loadLocation");
if(null == unloadLocation)
throw new ArgumentNullException("unloadLocation");
if(loadTime >= unloadTime)
throw new ArgumentException("Unload time must follow the load time.","unloadTime");
if(loadLocation.UnLocode.Equals(unloadLocation.UnLocode))
throw new ArgumentException("The locations must not be differents.", "unloadLocation");
if(!voyage.WillStopOverAt(loadLocation))
{
string message = string.Format("The voyage {0} will not stop over the load location {1}.", voyage.Number, loadLocation.UnLocode);
throw new ArgumentException(message, "loadLocation");
}
if(!voyage.WillStopOverAt(unloadLocation))
{
string message = string.Format("The voyage {0} will not stop over the unload location {1}.", voyage.Number, unloadLocation.UnLocode);
throw new ArgumentException(message, "unloadLocation");
}
_voyage = voyage.Number;
_loadLocation = loadLocation.UnLocode;
_unloadLocation = unloadLocation.UnLocode;
_loadTime = loadTime;
_unloadTime = unloadTime;
}
示例14: ResolveSourceLocations
internal virtual IEnumerable<CopyOperation> ResolveSourceLocations(SourceSet[] sourceSet, ILocation destinationLocation)
{
bool copyContainer = this.Container;
foreach (var src in sourceSet) {
var resolver = GetLocationResolver(src.ProviderInfo);
foreach (var path in src.SourcePaths) {
var location = resolver.GetLocation(path);
var absolutePath = location.AbsolutePath;
if (!location.IsFile) {
// if this is not a file, then it should be a container.
if (!location.IsItemContainer) {
throw new ClrPlusException("Unable to resolve path '{0}' to a file or folder.".format(path));
}
// if it's a container, get all the files in the container
var files = location.GetFiles(Recurse);
foreach (var f in files) {
var relativePath = (copyContainer ? location.Name + @"\\" : "") + absolutePath.GetRelativePath(f.AbsolutePath);
yield return new CopyOperation {
Destination = destinationLocation.IsFileContainer ? destinationLocation.GetChildLocation(relativePath) : destinationLocation,
Source = f
};
}
continue;
}
yield return new CopyOperation {
Destination = destinationLocation.IsFileContainer ? destinationLocation.GetChildLocation(location.Name) : destinationLocation,
Source = location
};
}
}
}
示例15: MarkedLocation
public MarkedLocation(ILocation location)
: base(location)
{
MarkColor = new Marker();
//if location are marked white, it means they haven't yet being visited
MarkColor.Mark = Color.White;
}