当前位置: 首页>>代码示例>>C#>>正文


C# ILocation类代码示例

本文整理汇总了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");
		}
开发者ID:hungdluit,项目名称:Epic.NET,代码行数:7,代码来源:MovingVoyage.cs

示例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);
     }
 }
开发者ID:andy-uq,项目名称:Echo,代码行数:9,代码来源:SolarSystem.cs

示例3: CircleReport

 public CircleReport(double time, ILocation loc, double size, GraphicsPath gradientPath)
 {
     this.time = time;
     loc1 = loc;
     this.size = size;
     this.gradientPath = gradientPath;
 }
开发者ID:malweth,项目名称:Modular-Network-Simulator,代码行数:7,代码来源:CircleReport.cs

示例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);
            }
        }
开发者ID:ashmind,项目名称:gallery,代码行数:33,代码来源:PicasaFaceProvider.cs

示例5: GetPiece

        public IPiece GetPiece(ILocation location)
        {
            if (location == null)
                throw new ArgumentNullException("Location must not be null");

            return GetPiece(location.X, location.Y);
        }
开发者ID:thebuchanan3,项目名称:ChessCs,代码行数:7,代码来源:Board.cs

示例6: JavaDebugCodeContext

 public JavaDebugCodeContext(JavaDebugProgram program, ILocation location)
 {
     Contract.Requires<ArgumentNullException>(program != null, "program");
     Contract.Requires<ArgumentNullException>(location != null, "location");
     _program = program;
     _location = location;
 }
开发者ID:Kav2018,项目名称:JavaForVS,代码行数:7,代码来源:JavaDebugCodeContext.cs

示例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);
        }
开发者ID:DrOuSS,项目名称:CnDCopy,代码行数:7,代码来源:Copier.cs

示例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;
        }
开发者ID:Mavtak,项目名称:roomie,代码行数:29,代码来源:LocationModelExtensions.cs

示例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;
        }
开发者ID:andrewanderson,项目名称:Web-Critters,代码行数:7,代码来源:MigrationEvent.cs

示例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);
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:EPPathFinder.cs

示例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));
		}
开发者ID:tzachshabtay,项目名称:MonoAGS,代码行数:7,代码来源:EPPathFinder.cs

示例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);
			}
		}
开发者ID:hungdluit,项目名称:Epic.NET,代码行数:25,代码来源:Voyage.cs

示例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;
		}
开发者ID:hungdluit,项目名称:Epic.NET,代码行数:29,代码来源:Leg.cs

示例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
                    };
                }
            }
        }
开发者ID:virmitio,项目名称:clrplus,代码行数:35,代码来源:CopyItemExCmdlet.cs

示例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;
 }
开发者ID:akrem1st,项目名称:Assignment2c-git,代码行数:7,代码来源:MarkedLocation.cs


注:本文中的ILocation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。