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


C# DirectionType类代码示例

本文整理汇总了C#中DirectionType的典型用法代码示例。如果您正苦于以下问题:C# DirectionType类的具体用法?C# DirectionType怎么用?C# DirectionType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DirectionType类属于命名空间,在下文中一共展示了DirectionType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Convert

 static public string Convert(double bytes, double reference, DirectionType direction, string format)
 {
     ConversionType conversionType;
     conversionType = GetConversionType(reference);
     conversionType = MoveDirection(conversionType, direction);
     return Convert(bytes, conversionType, format);
 }
开发者ID:jltrem,项目名称:DDay.Update,代码行数:7,代码来源:DownloadedBytesStringConverter.cs

示例2: PacketLogEntry

 public PacketLogEntry(DateTime time, DirectionType direction, string address, byte[] data)
 {
     Time = time;
     Direction = direction;
     Address   = address;
     Data      = data;
 }
开发者ID:swax,项目名称:CodePerspective,代码行数:7,代码来源:G2Header.cs

示例3: changeDirectionRandom

    // ------------------------------------------------------------------------------------ //
    private void changeDirectionRandom()
    {
        float angle = 0;

        if (currentDirectionType == DirectionType.Forward)
        {
            if (Probability.getProbability(50)) {
                currentDirectionType = DirectionType.Left;
                angle = rotateAngle;
            }
            else {
                currentDirectionType = DirectionType.Right;
                angle = -rotateAngle;
            }
        }
        else if (currentDirectionType == DirectionType.Left)
        {
            currentDirectionType = DirectionType.Forward;
            angle = -rotateAngle;
        }
        else if (currentDirectionType == DirectionType.Right)
        {
            currentDirectionType = DirectionType.Forward;
            angle = rotateAngle;
        }

        rotateUnit(angle);
    }
开发者ID:YuriyKokosha,项目名称:ZombieSmash,代码行数:29,代码来源:UnitStateRunDrunk.cs

示例4: SortNode

        public SortNode(XmlNode xmlNode, InternalScriptSettings settings)
            : base(xmlNode, settings)
        {
            // Load attributes
            foreach (XmlAttribute attr in xmlNode.Attributes) {
                switch (attr.Name) {
                    case "direction":
                        string dirStr = attr.Value.ToLower().Trim();
                        if (dirStr == "desc" || dirStr == "descending")
                            direction = DirectionType.DESCENDING;
                        else if (dirStr == "asc" || dirStr == "ascending")
                            direction = DirectionType.ASCENDING;
                        else {
                            logger.Error("Invalid sort direction on: " + xmlNode.OuterXml);
                        }
                        break;
                    case "by":
                        sortBy = attr.Value;
                        break;

                }
            }

             // Validate BY attribute
            if (sortBy == null) {
                logger.Error("Missing BY attribute on: " + xmlNode.OuterXml);
                loadSuccess = false;
                return;
            }
        }
开发者ID:MichelZ,项目名称:moving-pictures-michelz,代码行数:30,代码来源:SortNode.cs

示例5: Thermometer

        UnitsType m_Units = UnitsType.Celsius; // this defines the units of the new input temperatures, but our calculations will be in Celcius

        #endregion Fields

        #region Constructors

        // constructor
        public Thermometer(UnitsType units, DirectionType direction, double threshold, double hysterisis)
        {
            Units = units;
            Direction = direction;
            Threshold = threshold;
            HysterisisThreshold = hysterisis;
        }
开发者ID:dennex,项目名称:TemperatureDetector,代码行数:14,代码来源:Thermometer.cs

示例6: PacketLogEntry

 public PacketLogEntry(DateTime time, TransportProtocol protocol, DirectionType direction, DhtAddress address, byte[] data)
 {
     Time = time;
     Protocol  = protocol;
     Direction = direction;
     Address   = address;
     Data      = data;
 }
开发者ID:RoelofSol,项目名称:DeOps,代码行数:8,代码来源:G2Header.cs

示例7: Tree

        public Tree(int x, int y)
        {
            base.Initialize(x, y, 1, 1, Texture);

            direction = DirectionType.South;

            Name = "Tree";
        }
开发者ID:johnfn,项目名称:Illumination,代码行数:8,代码来源:Tree.cs

示例8: HttpNetworkStream

 public HttpNetworkStream(DirectionType direction, Socket socket,
     System.IO.FileAccess fileAccess, bool ownsSocket)
 {
     Direction = direction;
     _socket = socket;
     _stream = new PrependableNetworkStream(socket, fileAccess, ownsSocket);
     _unknownContentLength = true;
 }
开发者ID:274706834,项目名称:opendms-dot-net,代码行数:8,代码来源:HttpNetworkStream.cs

示例9: ResetCounter

        public void ResetCounter(StateType state, DirectionType direction)
        {
            if (direction != Direction) {
                _counter = 1000;
                _animationIndex = 0;
            }

            State = state;
            Direction = direction;
        }
开发者ID:wmccullough,项目名称:Windfish,代码行数:10,代码来源:Animation.cs

示例10: TransitDescription

        public TransitDescription(Route route, DirectionType transitType)
        {
            if (route == null)
            {
                throw new ArgumentNullException("route");
            }

            this.TransitType = transitType;
            this.StartLocation = route.RouteLegs[0].ActualStart.AsGeoCoordinate();
            this.EndLocation = route.RouteLegs[0].ActualEnd.AsGeoCoordinate();
            this.TravelDuration = route.TravelDuration;
            this.ArrivalTime = route.RouteLegs[0].EndTime.ToShortTimeString();
            this.DepartureTime = route.RouteLegs[0].StartTime.ToShortTimeString();

            // TODO: need to add endpoint to the step list?
            this.ItinerarySteps = new ObservableCollection<ItineraryStep>();
            var stepNumber = 0;
            foreach (var topLeg in route.RouteLegs[0].ItineraryItems)
            {
                this.ItinerarySteps.Add(new ItineraryStep(topLeg, ++stepNumber));

                // calculate the walking start and end times
                if (this.ItinerarySteps[stepNumber - 1].IconType == "Walk")
                {
                    if (stepNumber == 1)
                    {
                        // WalkOnly directions needs to be set a default time. Using current time
                        this.ItinerarySteps[stepNumber - 1].StartTime = this.TransitType == DirectionType.WalkOnly ? DateTime.Now : route.RouteLegs[0].StartTime;
                    }
                    else
                    {
                        this.ItinerarySteps[stepNumber - 1].StartTime = this.ItinerarySteps[stepNumber - 2].EndTime;
                    }

                    this.ItinerarySteps[stepNumber - 1].EndTime = this.ItinerarySteps[stepNumber - 1].StartTime + TimeSpan.FromSeconds(topLeg.TravelDuration);
                }
            }

            this.ItinerarySteps[0].StepType = ItineraryStep.ItineraryStepType.FirstStep;
            this.ItinerarySteps[this.ItinerarySteps.Count - 1].StepType = ItineraryStep.ItineraryStepType.LastStep;

            // check the first and last step for generic strings to replace
            // TODO: need a better place to put this
            this.ItinerarySteps[0].Instruction = this.ItinerarySteps[0].Instruction.Replace(SR.SourceLocation, ViewModelLocator.MainMapViewModelStatic.StartLocationText);
            this.ItinerarySteps[this.ItinerarySteps.Count - 1].Instruction = this.ItinerarySteps[this.ItinerarySteps.Count - 1].Instruction.Replace(SR.DestinationLocation, ViewModelLocator.MainMapViewModelStatic.EndLocationText);

            this.PathPoints = route.RoutePaths[0].Line;

            this.MapView = route.BoundingBox.AsLocationRect();
        }
开发者ID:kyvok,项目名称:TransitWP7,代码行数:50,代码来源:TransitDescription.cs

示例11: getRight

 public static DirectionType getRight(DirectionType d)
 {
     switch (d) {
     case DirectionType.NORTH: return DirectionType.NORTHEAST;
     case DirectionType.NORTHEAST: return DirectionType.EAST;
     case DirectionType.EAST : return DirectionType.SOUTHEAST;
     case DirectionType.SOUTHEAST : return DirectionType.SOUTH;
     case DirectionType.SOUTH : return DirectionType.SOUTHWEST;
     case DirectionType.SOUTHWEST : return DirectionType.WEST;
     case DirectionType.WEST : return DirectionType.NORTHWEST;
     case DirectionType.NORTHWEST : return DirectionType.NORTH;
     default : return DirectionType.NORTH;
     }
 }
开发者ID:MarjieVolk,项目名称:BeautyAndTheBeast,代码行数:14,代码来源:DirectionType.cs

示例12: Person

        public Person(int x, int y)
            : base(x, y, 1, 1, texturesMap[ProfessionType.Worker])
        {
            age = 0;
            education = 0;
            gender = GenderType.Male;
            health = HEALTH_MAX;
            profession = ProfessionType.Worker;
            Random random = new Random();
            direction = (DirectionType)(random.Next() % (int)DirectionType.SIZE);
            remainingMovement = movementRange = 36;
            BlocksMovement = false;

            Name = "Person";
        }
开发者ID:johnfn,项目名称:Illumination,代码行数:15,代码来源:Person.cs

示例13: GetDirectionalImageManager

			private IImageManager GetDirectionalImageManager(IImageManager imageManager, DirectionType directionType)
			{
				//TODO: Compressed and PDF files need to be able to find each other for the case of a folder containing both .pdf and .cbr

				IImageManager nextImageManager = null;
				var path = imageManager.Location;
				int directionOffset = directionType == DirectionType.Next ? 1 : -1;

				//TODO: code for CompressedFileImageManager and FolderImageManager is virtually identical. Consolidate!
				if ((imageManager is CompressedFileImageManager) || (imageManager is PDFImageManager))
				{
					var fileName = Path.GetFileName(path).ToLower();
					var fileInfo = new FileInfo(path);
					var supportFileTypes = imageManager is CompressedFileImageManager
						? CompressedFileImageManager.SUPPORTED_FILETYPES
						: PDFImageManager.SUPPORTED_FILETYPES;

					var fileInfos = fileInfo.Directory.GetFiles()
						.Where(x => supportFileTypes.Contains(x.Extension.ToLower()))
						.OrderBy(x => x.Name, Utility.NaturalStringComparer)
						.ToList();

					var foundFileIndex = fileInfos.FindIndex(x => x.Name.ToLower() == fileName) + directionOffset;
					if ((foundFileIndex < fileInfos.Count) && (foundFileIndex > -1))
					{
						imageManager.Dispose();
						nextImageManager = this.Load(fileInfos[foundFileIndex].FullName);
					}
				}
				else if (imageManager is FolderImageManager)
				{
					DirectoryInfo directoryInfo = new DirectoryInfo(path);
					var directoryName = directoryInfo.Name.ToLower();
					var directoryInfos = directoryInfo.Parent.GetDirectories()
						.OrderBy(x => x.Name, Utility.NaturalStringComparer)
						.ToList();

					var foundDirectoryIndex = directoryInfos.FindIndex(x => x.Name.ToLower() == directoryName) + directionOffset;
					if ((foundDirectoryIndex < directoryInfos.Count) && (foundDirectoryIndex > -1))
					{
						imageManager.Dispose();
						nextImageManager = this.Load(directoryInfos[foundDirectoryIndex].FullName);
					}
				}

				return nextImageManager;
			}
开发者ID:theahuramazda,项目名称:Saluse-ComicReader,代码行数:47,代码来源:Engine.cs

示例14: Initialize

        public void Initialize(string[] parameters)
        {
            if (parameters.Contains("Origin"))
                hasOrigin = true;

            if (parameters.Contains("Direction"))
                direction = DirectionType.Direction;
            else if (parameters.Contains("Angle"))
                direction = DirectionType.Angle;

            if (parameters.Contains("Speed"))
                hasSpeed = true;

            foreach (string param in parameters)
                if (param == "Param")
                    paramCount++;
        }
开发者ID:roflwaffl,项目名称:Phosphaze,代码行数:17,代码来源:Spawn.cs

示例15: InputOrder

 public InputOrder(
     string brokerID,
     string investorID,
     DirectionType direction,
     OffsetFlag offsetFlag,
     string instrumentID,
     double price,
     int volume,
     string groupID)
 {
     this.BrokerID = brokerID;
     this.InvestorID = investorID;
     this.Direction = direction;
     this.OffsetFlag = offsetFlag;
     this.InstrumentID = instrumentID;
     this.Price = price;
     this.Volume = volume;
     this.GroupID = groupID;
 }
开发者ID:botvs,项目名称:QTS,代码行数:19,代码来源:InputOrder.cs


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