本文整理汇总了C#中Tag.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Tag.ToString方法的具体用法?C# Tag.ToString怎么用?C# Tag.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tag
的用法示例。
在下文中一共展示了Tag.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: deveRetirarHashTagsAdicionaisNoComeco
public void deveRetirarHashTagsAdicionaisNoComeco()
{
var assuntoDigitado = "##tecnologia";
var assuntoEsperado = "#tecnologia";
var tag = new Tag(assuntoDigitado);
Assert.AreEqual(assuntoEsperado, tag.ToString());
}
示例2: UserLog
public UserLog(string _username, ApplicationID _applicationID, Tag _tag)
{
username = _username;
applicationId = _applicationID.ToString();
tag =_tag.ToString();
timestamp = (long)UnityEngine.Time.realtimeSinceStartup;//System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss.fff");
// timeServer = System.DateTime.Now.ToString("yyyy-MM-ddTHH:mm:sszzz");
//timestamp = System.BitConverter.GetBytes(System.DateTime.Now.ToBinary());
//timestamp = System.DateTime.Now.ToBinary();
}
示例3: ByTagTestTagByFieldMCI
public void ByTagTestTagByFieldMCI()
{
Tag searchTag = new Tag("provides", "rs_agent_type", "right_link");
Assert.IsTrue(searchTag.scope == "provides");
Assert.IsTrue(searchTag.tagName == "rs_agent_type");
Assert.IsTrue(searchTag.tagValue == "right_link");
Assert.IsTrue(searchTag.ToString() == "provides:rs_agent_type=right_link");
List<Resource> resources = Tag.byTag(string.Empty, false, "multi_cloud_images", new List<Tag>() { searchTag });
Assert.IsNotNull(resources);
Assert.IsTrue(resources.Count > 0);
}
示例4: ByTagTestTagByFieldInstance
public void ByTagTestTagByFieldInstance()
{
Tag searchTag = new Tag("rs_monitoring", "state", "active");
Assert.IsTrue(searchTag.scope == "rs_monitoring");
Assert.IsTrue(searchTag.tagName == "state");
Assert.IsTrue(searchTag.tagValue == "active");
Assert.IsTrue(searchTag.ToString() == "rs_monitoring:state=active");
List<Resource> resources = Tag.byTag(string.Empty, false, "instances", new List<Tag>() { searchTag });
Assert.IsNotNull(resources);
Assert.IsTrue(resources.Count > 0);
}
示例5: Parse
internal IShape Parse(Tag tag, byte[] data, IImageFinder imageFinder)
{
this.ImageFinder = imageFinder;
SWFDataTypeReader shapeReader = new SWFDataTypeReader(new MemoryStream(data));
IShape newShape = null;
switch (tag)
{
case Tag.DefineShape:
case Tag.DefineShape2:
case Tag.DefineShape3:
newShape = this.ParseDefineShapeN(shapeReader, tag);
break;
case Tag.DefineFont3:
/* We do some hackery magic here. Because we happen to know that the only reason
* we parse shapes is to get bitmap references out of them, we skip the actual parsing
* of glyphs because they can't ever have bitmaps in them. We do this by creating
* a fundamentally broken shape which contains nothing but the original shape bytes.
* Oh, for shame. */
return new Shape() { OriginalBytes = data, OriginalFormat = tag };
case Tag.DefineShape4:
newShape = this.ParseDefineShape4(shapeReader);
break;
case Tag.DefineMorphShape:
case Tag.DefineMorphShape2:
newShape = this.ParseDefineMorphShape(shapeReader, tag);
break;
default:
throw new SWFModellerException(SWFModellerError.Internal, "Can't parse shapes with tag " + tag.ToString());
}
newShape.SetOriginalBytes(data, tag);
return newShape;
}
示例6: TagCurrent
private static void TagCurrent(SelfCleaningDirectory repoDirectory, Tag tag)
{
var hgArguments = HgArguments
.Tag(tag.ToString())
.AddRepository(repoDirectory.Path);
AssertResultNotFailed(DefaultProcessExecutor.Execute(hgArguments));
}
示例7: doOpen
private void doOpen(string hostName)
{
networkErrorOccurred = false;
string databaseName = parsedConnectionString.Database;
int index = hostName.IndexOf(':');
int port = PORT;
if (index != -1)
{
try
{
port = Int32.Parse(hostName.Substring(index + 1));
}
catch (FormatException e)
{
throw new ArgumentException("Invalid port number in connection string", "ConnectionString", e);
}
hostName = hostName.Substring(0, index);
}
dataStream = new EncodedDataStream();
authenticating = false;
try
{
StringDictionary properties = new StringDictionary();
Tag tag = new Tag("Connection");
tag.addAttribute("Service", "SQL2");
tag.addAttribute("Database", databaseName);
if (parsedConnectionString.ContainsKey(NuoDbConnectionStringBuilder.ServerKey))
{
tag.addAttribute("Server", parsedConnectionString.Server);
properties["Server"] = parsedConnectionString.Server;
}
string userName = null;
if (parsedConnectionString.ContainsKey(NuoDbConnectionStringBuilder.UserKey))
{
properties["User"] = userName = parsedConnectionString.User;
tag.addAttribute("User", userName);
}
else
{
throw new ArgumentException("Username is missing in connection string", "ConnectionString");
}
string password = "";
if (parsedConnectionString.ContainsKey(NuoDbConnectionStringBuilder.PasswordKey))
{
password = parsedConnectionString.Password;
}
string cipher = DEFAULT_CIPHER;
if (parsedConnectionString.ContainsKey(NuoDbConnectionStringBuilder.CipherKey))
{
properties["Cipher"] = cipher = parsedConnectionString.Cipher;
}
if (parsedConnectionString.ContainsKey(NuoDbConnectionStringBuilder.SchemaKey))
{
tag.addAttribute("Schema", parsedConnectionString.Schema);
properties["Schema"] = parsedConnectionString.Schema;
}
if (parsedConnectionString.ContainsKey(NuoDbConnectionStringBuilder.LBTagKey))
{
properties["LBTag"] = parsedConnectionString.LBTag;
}
if (parsedConnectionString.ContainsKey(NuoDbConnectionStringBuilder.ClientInfoKey))
{
properties["clientInfo"] = parsedConnectionString.ClientInfo;
}
properties["clientProcessID"] = Process.GetCurrentProcess().Id.ToString();
// see comment below ... for now these are the only two types that
// we can support in the client code
if ((!cipher.Equals("RC4")) && (!cipher.Equals("None")))
throw new NuoDbSqlException("Unknown cipher: " + cipher);
tag.addAttribute("Cipher", cipher);
string xml = tag.ToString();
CryptoSocket brokerSocket = new CryptoSocket(hostName, port);
inputStream = brokerSocket.InputStream;
outputStream = brokerSocket.OutputStream;
dataStream.write(xml);
dataStream.send(outputStream);
dataStream.getMessage(inputStream);
string response = dataStream.readString();
brokerSocket.Close();
Tag responseTag = new Tag();
responseTag.parse(response);
if (responseTag.Name.Equals("Error"))
{
throw new NuoDbSqlException(responseTag.getAttribute("text", "error text not found"));
}
serverAddress = responseTag.getAttribute("Address", null);
serverPort = responseTag.getIntAttribute("Port", 0);
if (serverAddress == null || serverPort == 0)
{
//.........这里部分代码省略.........
示例8: WriteBodylessTag
/// <summary>
/// Note that if you're fixing this method, it shares functionality with
/// CloseTag, which may also need the same fix. Whatever it is you're fixing.
/// </summary>
private void WriteBodylessTag(Tag tag, string log = null)
{
#if DEBUG
this.LogTag(tag, log);
#endif
WriteBuffer tagWriter = this.writers.Peek();
int tagCode = (int)tag;
#if DEBUG
this.LogMessage("Bodyless tag " + tag.ToString(), true);
#endif
/* Short record header */
int hdr = (tagCode << 6);
tagWriter.WriteUI16((uint)hdr);
}
示例9: FindByGroupTag
/// <summary>
/// Finds the structure type corresponding to a group tag.
/// </summary>
/// <param name="groupTag">The group tag of the group to search for.</param>
/// <returns>The structure type if found, or <c>null</c> otherwise.</returns>
public static Type FindByGroupTag(Tag groupTag)
{
return FindByGroupTag(groupTag.ToString());
}
示例10: GetTag
public static GameObject GetTag( Tag tag )
{
return GameObject.FindWithTag( tag.ToString() );
}
示例11: LogTag
private void LogTag(Tag t, string logdata)
{
this.LogMessage("Write " + t.ToString() + "(" + logdata + ")");
}
示例12: Count
public int Count(Tag tag)
{
if (tag.SubComponent > 0) {
throw new ArgumentException("Invalid HL7 tag for Count() operation: " + tag.ToString(), "tag");
} else if (tag.Component > 0) {
// number of subcomponents
string component = GetComponent(tag);
if (!String.IsNullOrEmpty(component))
return component.Split(_subcomponent_delim).Length;
} else if (tag.Field > 0) {
// number of componenets
string field = GetField(tag);
if (!String.IsNullOrEmpty(field))
return field.Split(_component_delim).Length;
} else {
// number of fields
List<string> segment = GetSegment(tag);
if (segment != null)
return segment.Count - 1;
}
return 0;
}
示例13: Get
public string Get(Tag tag, string defaultValue)
{
string value = null;
if (tag.SubComponent > 0)
value = GetSubComponent(tag);
else if (tag.Component > 0)
value = GetComponent(tag);
else if (tag.Field > 0)
value = GetField(tag);
else
throw new ArgumentException("Invalid HL7 tag for Get() operation: " + tag.ToString(), "tag");
return (value != null) ? value : defaultValue;
}
示例14: ReadGradient
private Gradient ReadGradient(SWFDataTypeReader shapeReader, Tag format)
{
GradientSpread spread = (GradientSpread)shapeReader.ReadUBits(2);
GradientInterpolation interp = (GradientInterpolation)shapeReader.ReadUBits(2);
int numRecs = (int)shapeReader.ReadUBits(4);
GradientRecord[] recs = new GradientRecord[numRecs];
for (int i = 0; i < recs.Length; i++)
{
GradientRecord rec = new GradientRecord();
rec.Ratio = shapeReader.ReadUI8();
if (format == Tag.DefineShape || format == Tag.DefineShape2)
{
rec.Colour = shapeReader.ReadRGB();
}
else if (format == Tag.DefineShape3 || format == Tag.DefineShape4)
{
rec.Colour = shapeReader.ReadRGBA();
}
else
{
throw new SWFModellerException(SWFModellerError.Internal, "Can't read gradient in shape format " + format.ToString());
}
recs[i] = rec;
}
return new Gradient()
{
Records = recs,
Interpolation = interp,
Spread = spread
};
}
示例15: ReadLineStyle
private LineStyle ReadLineStyle(SWFDataTypeReader shapeReader, Tag format)
{
LineStyle ls = new LineStyle();
ls.Width = shapeReader.ReadUI16();
if (format == Tag.DefineShape || format == Tag.DefineShape2)
{
ls.Colour = shapeReader.ReadRGB();
}
else if (format == Tag.DefineShape3 || format == Tag.DefineShape4)
{
ls.Colour = shapeReader.ReadRGBA();
}
else
{
throw new SWFModellerException(SWFModellerError.Internal, "Can't line style in shape format " + format.ToString());
}
return ls;
}