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


C# Tag.ToString方法代码示例

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

示例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();
 }
开发者ID:TAPeri,项目名称:WordsMatter,代码行数:10,代码来源:UserLog.cs

示例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);
 }
开发者ID:rs-services,项目名称:RightScaleNetAPI,代码行数:11,代码来源:TagTest.cs

示例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);
 }
开发者ID:rs-services,项目名称:RightScaleNetAPI,代码行数:11,代码来源:TagTest.cs

示例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;
        }
开发者ID:WeeWorld,项目名称:Swiffotron,代码行数:40,代码来源:ShapeParser.cs

示例6: TagCurrent

 private static void TagCurrent(SelfCleaningDirectory repoDirectory, Tag tag)
 {
     var hgArguments = HgArguments
         .Tag(tag.ToString())
         .AddRepository(repoDirectory.Path);
     AssertResultNotFailed(DefaultProcessExecutor.Execute(hgArguments));
 }
开发者ID:davidsidlinger,项目名称:ccnet-hg-nosuck,代码行数:7,代码来源:HgIntegrationFixture.cs

示例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)
                {
//.........这里部分代码省略.........
开发者ID:nuodb,项目名称:nuodb-dotnet,代码行数:101,代码来源:NuoDbConnectionInternal.cs

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

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

示例10: GetTag

 public static GameObject GetTag( Tag tag )
 {
     return GameObject.FindWithTag( tag.ToString() );
 }
开发者ID:cyanpunk,项目名称:muonline,代码行数:4,代码来源:GO.cs

示例11: LogTag

 private void LogTag(Tag t, string logdata)
 {
     this.LogMessage("Write " + t.ToString() + "(" + logdata + ")");
 }
开发者ID:WeeWorld,项目名称:Swiffotron,代码行数:4,代码来源:SWFWriter.cs

示例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;
 }
开发者ID:gogorrr,项目名称:mdcm,代码行数:22,代码来源:HL7v2.cs

示例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;
 }
开发者ID:gogorrr,项目名称:mdcm,代码行数:13,代码来源:HL7v2.cs

示例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
            };
        }
开发者ID:WeeWorld,项目名称:Swiffotron,代码行数:36,代码来源:ShapeParser.cs

示例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;
        }
开发者ID:WeeWorld,项目名称:Swiffotron,代码行数:21,代码来源:ShapeParser.cs


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