C# 클래스 ESRI.ArcGIS.Client.Toolkit.DataSources.Kml.Zip.SharedUtilities

Collects general purpose utility methods.
파일 보기 프로젝트 열기: Esri/arcgis-toolkit-sl-wpf

공개 메소드들

메소드 설명
GetTempFilename ( ) : string

Return a random filename, suitable for use as a temporary file.

The System.IO.Path.GetRandomFileName() method is not available on the Compact Framework, so this library provides its own substitute.

RoundToEvenSecond ( System.DateTime source ) : System.DateTime

Round the given DateTime value to an even second value.

Round up in the case of an odd second value. The rounding does not consider fractional seconds.

This is useful because the Zip spec allows storage of time only to the nearest even second. So if you want to compare the time of an entry in the archive with it's actual time in the filesystem, you need to round the actual filesystem time, or use a 2-second threshold for the comparison.

This is most nautrally an extension method for the DateTime class but this library is built for .NET 2.0, not for .NET 3.5; This means extension methods are a no-no.

StringToMemoryStream ( string s ) : System.IO.MemoryStream

Creates a MemoryStream for the given string. This is used internally by Library, specifically by the ZipFile.AddStringAsFile() method. But it may be useful in other scenarios.

TrimVolumeAndSwapSlashes ( string pathName ) : string

Utility routine for transforming path names.

보호된 메소드들

메소드 설명
FindSignature ( System stream, int SignatureToFind ) : long

Finds a signature in the zip stream. This is useful for finding the end of a zip entry, for example.

비공개 메소드들

메소드 설명
DateTimeToPacked ( System.DateTime time ) : Int32
GenerateRandomStringImpl ( int length, int delta ) : string
GetOneRandomChar ( int delta ) : char
PackedToDateTime ( Int32 packedDateTime ) : System.DateTime
ReadInt ( System s ) : int
ReadSignature ( System s ) : int
SharedUtilities ( ) : System
StringFromBuffer ( byte buf, int maxlength ) : string
StringFromBuffer ( byte buf, int maxlength, System encoding ) : string
StringToByteArray ( string value ) : byte[]
StringToByteArray ( string value, System encoding ) : byte[]
Utf8StringFromBuffer ( byte buf, int maxlength ) : string
Utf8StringToByteArray ( string value ) : byte[]
_ReadFourBytes ( System s, string message ) : int

메소드 상세

FindSignature() 보호된 정적인 메소드

Finds a signature in the zip stream. This is useful for finding the end of a zip entry, for example.
protected static FindSignature ( System stream, int SignatureToFind ) : long
stream System
SignatureToFind int
리턴 long

GetTempFilename() 공개 정적인 메소드

Return a random filename, suitable for use as a temporary file.
The System.IO.Path.GetRandomFileName() method is not available on the Compact Framework, so this library provides its own substitute.
public static GetTempFilename ( ) : string
리턴 string

RoundToEvenSecond() 공개 정적인 메소드

Round the given DateTime value to an even second value.

Round up in the case of an odd second value. The rounding does not consider fractional seconds.

This is useful because the Zip spec allows storage of time only to the nearest even second. So if you want to compare the time of an entry in the archive with it's actual time in the filesystem, you need to round the actual filesystem time, or use a 2-second threshold for the comparison.

This is most nautrally an extension method for the DateTime class but this library is built for .NET 2.0, not for .NET 3.5; This means extension methods are a no-no.

public static RoundToEvenSecond ( System.DateTime source ) : System.DateTime
source System.DateTime The DateTime value to round
리턴 System.DateTime

StringToMemoryStream() 공개 정적인 메소드

Creates a MemoryStream for the given string. This is used internally by Library, specifically by the ZipFile.AddStringAsFile() method. But it may be useful in other scenarios.
public static StringToMemoryStream ( string s ) : System.IO.MemoryStream
s string The string to use as input for the MemoryStream
리턴 System.IO.MemoryStream

TrimVolumeAndSwapSlashes() 공개 정적인 메소드

Utility routine for transforming path names.
public static TrimVolumeAndSwapSlashes ( string pathName ) : string
pathName string source path.
리턴 string