Пример #1
0
        // Public Methods

        public override String ToString()
        {
            return(String.Format("{0} {1} {2} {3} {4}",
                                 Name,
                                 TTL.ToString(),
                                 RecordClass.ToString(),
                                 RecordType.ToString(),
                                 RecordData));
        }
Пример #2
0
 public string ToString(int namePadding)
 {
     return(String.Join(" ", new string[] {
         NAME.PadLeft(namePadding),
         TTL.ToString(),
         CLASS.ToString(),
         TypeString
     }));
 }
Пример #3
0
        public void SetString_ConvertToTtl_Ttl()
        {
            // Arrange
            RssTtl    rssTtl = new RssTtl();
            const int TTL    = 10;

            // Action
            rssTtl.TTL = TTL;

            // Assert
            Assert.AreEqual(TTL.ToString(), rssTtl.TTLString);
        }
Пример #4
0
        public void SetTtl_ConvertToString_String()
        {
            // Arrange
            RssTtl    rssTtl = new RssTtl();
            const int TTL    = 10;

            // Action
            rssTtl.TTLString = TTL.ToString();

            // Assert
            Assert.Equal(TTL, rssTtl.TTL);
        }
Пример #5
0
 public override IEnumerable <StateVariable> GetState()
 {
     return(new[] {
         new StateVariable
         {
             Name = "Key",
             Value = Key,
             Type = StateVariable.StateType.Input
         },
         new StateVariable
         {
             Name = "TTL",
             Value = TTL.ToString(),
             Type = StateVariable.StateType.Input
         },
         new StateVariable
         {
             Name = "Result",
             Value = Result,
             Type = StateVariable.StateType.Output
         }
         ,
         new StateVariable
         {
             Name = "Response",
             Value = Response,
             Type = StateVariable.StateType.Output
         },
         new StateVariable
         {
             Name = "SourceId",
             Value = SourceId.ToString(),
             Type = StateVariable.StateType.Input
         }
     });
 }
Пример #6
0
        protected override Dictionary <string, string> ExtQueryParameters()
        {
            var ret = new Dictionary <string, string>()
            {
                ["RecordId"] = RecordId,
                ["RR"]       = RR,
                ["Type"]     = Type,
                ["Value"]    = Value,
            };

            if (TTL > 0)
            {
                ret["TTL"] = TTL.ToString();
            }
            //if (Priority > 0 && Priority < 500)
            //{
            //    ret["Priority"] = Priority.ToString();
            //}
            if (!string.IsNullOrWhiteSpace(Line))
            {
                ret["Line"] = Line;
            }
            return(ret);
        }
Пример #7
0
        /// <summary>
        /// Converts the channel to a string
        /// </summary>
        /// <returns>The channel as a string</returns>
        public override string ToString()
        {
            StringBuilder ChannelString = new StringBuilder();

            ChannelString.Append("<channel>");
            ChannelString.Append("<title>").Append(Title).Append("</title>\r\n");
            ChannelString.Append("<link>").Append(Link).Append("</link>\r\n");
            ChannelString.Append("<atom:link xmlns:atom=\"http://www.w3.org/2005/Atom\" rel=\"self\" href=\"").Append(Link).Append("\" type=\"application/rss+xml\" />");

            ChannelString.Append("<description><![CDATA[").Append(Description).Append("]]></description>\r\n");
            ChannelString.Append("<language>").Append(Language).Append("</language>\r\n");
            ChannelString.Append("<copyright>").Append(Copyright).Append("</copyright>\r\n");
            ChannelString.Append("<webMaster>").Append(WebMaster).Append("</webMaster>\r\n");
            ChannelString.Append("<pubDate>").Append(PubDate.ToString("Ddd, dd MMM yyyy HH':'mm':'ss", CultureInfo.InvariantCulture)).Append("</pubDate>\r\n");
            ChannelString.Append("<itunes:explicit>").Append((Explicit ? "yes" : "no")).Append("</itunes:explicit>");
            ChannelString.Append("<itunes:subtitle>").Append(Title).Append("</itunes:subtitle>");
            ChannelString.Append("<itunes:summary><![CDATA[").Append(Description).Append("]]></itunes:summary>");

            foreach (string Category in Categories)
            {
                ChannelString.Append("<category>").Append(Category).Append("</category>\r\n");
                ChannelString.Append("<itunes:category text=\"").Append(Category).Append("\" />\r\n");
            }
            ChannelString.Append("<docs>").Append(Docs).Append("</docs>\r\n");
            ChannelString.Append("<ttl>").Append(TTL.ToString(CultureInfo.InvariantCulture)).Append("</ttl>\r\n");
            if (!string.IsNullOrEmpty(ImageUrl))
            {
                ChannelString.Append("<image><url>").Append(ImageUrl).Append("</url>\r\n<title>").Append(Title).Append("</title>\r\n<link>").Append(Link).Append("</link>\r\n</image>\r\n");
            }
            foreach (Item CurrentItem in Items)
            {
                ChannelString.Append(CurrentItem.ToString());
            }
            ChannelString.Append("</channel>\r\n");
            return(ChannelString.ToString());
        }
Пример #8
0
 /// <summary>
 /// for
 /// <see cref="BTRunTimeValueAttribute"/>
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     return(TTL.ToString());
 }
Пример #9
0
        public ColumnFamilySchema ToPbSchema()
        {
            var schema = new ColumnFamilySchema
            {
                Name = ByteString.CopyFrom(Name)
            };

            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("VERSIONS"),
                Second = ByteString.CopyFromUtf8(MaxVersions.ToString())
            });
            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("TTl"),
                Second = ByteString.CopyFromUtf8(TTL.ToString())
            });
            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("MIN_VERSIONS"),
                Second = ByteString.CopyFromUtf8(MinVersion.ToString())
            });
            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("KEEP_DELETED_CELLS"),
                Second = ByteString.CopyFromUtf8(KeepDeletedCells.ToString())
            });
            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("BLOCKSIZE"),
                Second = ByteString.CopyFromUtf8(BlockSize.ToString())
            });

            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("COMPRESSION"),
                Second = ByteString.CopyFromUtf8(Compression.ToString())
            });
            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("BLOCKCACHE"),
                Second = ByteString.CopyFromUtf8(IsBlockCache.ToString())
            });
            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("BLOOMFILTER"),
                Second = ByteString.CopyFromUtf8(BloomFilter.ToString())
            });
            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("REPLICATION_SCOPE"),
                Second = ByteString.CopyFromUtf8(ReplicationScope.ToString())
            });
            schema.Attributes.Add(new BytesBytesPair
            {
                First  = ByteString.CopyFromUtf8("DATA_BLOCK_ENCODING"),
                Second = ByteString.CopyFromUtf8(DataBlockEncoding.ToString())
            });

            return(schema);
        }