private void ParseCollection(TagCollection tags, TemplateContext context, System.IO.TextWriter write) { for (Int32 i = 0; i < tags.Count; i++) { write.Write( tags[i].Parse(context)); } }
/// <summary> /// Gets all tags /// </summary> /// <returns></returns> public TagCollection GetAllTags() { TagCollection tc = ZCache.Get<TagCollection>("AllTags"); if (tc == null) { tc = new TagCollection(); TagCollection temp = TagCollection.FetchAll(); foreach (Tag t in temp) { Tag tag = tc.Find( delegate(Tag tempTag) { return tempTag.Name == t.Name; }); if (tag == null) tc.Add(t); } ZCache.InsertCache("AllTags", tc, 90); } return tc; }
public void Add(TagCollection other) { for (int i = 0; i < other.tags.Count; i++) { if (!tags.Contains(other.tags[i])) { tags.Add(other.tags[i]); } } }
public void Export3Error1() { var tag_base = new TagCollection(); tag_base.TrackNameEnglish = "foo"; tag_base.GameNameEnglish = "bar"; tag_base.Export(null, Encoding.UTF8); }
public Header( uint timerInfo, uint timerInfo2, int loopIndex, IReadOnlyList<DumpData> dump, TagCollection tag, IReadOnlyList<DeviceInfo> devices) { if (timerInfo == 0 || timerInfo > int.MaxValue) throw new ArgumentOutOfRangeException(nameof(timerInfo)); if (timerInfo2 == 0 || timerInfo2 > int.MaxValue) throw new ArgumentOutOfRangeException(nameof(timerInfo2)); if (dump == null) throw new ArgumentNullException(nameof(dump)); if (tag == null) throw new ArgumentNullException(nameof(tag)); if (devices == null) throw new ArgumentNullException(nameof(devices)); if (loopIndex < -1 || loopIndex >= dump.Count) throw new ArgumentNullException(nameof(loopIndex)); this.SampleTimeNumerator = (int)timerInfo; this.SampleTimeDenominator = (int)timerInfo2; this.LoopPointIndex = loopIndex; this.s98DumpData = dump; this.s98TagCollection = tag; this.s98Devices = devices; }
public Header( int loopIndex, IReadOnlyList<DumpData> dump, TagCollection tag, IReadOnlyList<DeviceInfo> devices, Version version) { if (dump == null) throw new ArgumentNullException(nameof(dump)); if (tag == null) throw new ArgumentNullException(nameof(tag)); if (devices == null) throw new ArgumentNullException(nameof(devices)); if (loopIndex < -1 || loopIndex >= dump.Count) throw new ArgumentNullException(nameof(loopIndex)); if (version == null) throw new ArgumentNullException(nameof(version)); this.LoopPointIndex = loopIndex; this.vgmDumpData = dump; this.vgmTagCollection = tag; this.vgmDevices = devices; this.version = version; }
public Project() { _notifyChange = false; _tagTypes.CollectionChanged += new NotifyCollectionChangedEventHandler(_tagTypes_CollectionChanged); _tags = new TagCollection(this); _tags.CollectionChanged += new NotifyCollectionChangedEventHandler(_tags_CollectionChanged); }
public InterlockStatus () { InitializeComponent(); CultureResources.registerDataProvider(this); CultureResources.getDataProvider().DataChanged += new EventHandler(CultureResources_DataChanged); _interlockTags = (TagCollection)FindResource("interlockCollection"); }
public bool ContainsAny(TagCollection collection) { for (int i = 0; i < collection.tags.Count; i++) { if (tags.Contains(collection.tags[i])) { return true; } } return false; }
public SummaryStatus() { InitializeComponent(); CultureResources.registerDataProvider(this); CultureResources.getDataProvider().DataChanged += new EventHandler(CultureResources_DataChanged); _summaryStatusTags = (TagCollection)FindResource("summaryCollection"); }
protected virtual void WriteValue(TagCollection value) { _writer.WriteAttributeString("limitType", value.LimitType.ToString()); foreach (ITag item in value) { this.WriteTag(item, WriteTagOptions.IgnoreName); } }
public DXSPrimitive(XmlNode node, ContentImporterContext context) { Id = node.Attributes["id"] != null ? int.Parse(node.Attributes["id"].Value) : 0; if (node.Attributes["name"] != null) Name = node.Attributes["name"].Value; if (node.Attributes["type"] != null) Type = node.Attributes["type"].Value; if (node.Attributes["visible"] != null) Visible = bool.Parse(node.Attributes["visible"].Value); if (node.Attributes["snap"] != null) Snap = node.Attributes["snap"].Value; if (node.Attributes["autoUV"] != null) AutoUV = bool.Parse(node.Attributes["autoUV"].Value); GroupId = node.Attributes["groupID"] != null ? int.Parse(node.Attributes["groupID"].Value) : -1; SkeletonId = node.Attributes["skeletonID"] != null ? int.Parse(node.Attributes["skeletonID"].Value) : -1; if (node["comments"] != null) Comments = node["comments"].Value; if (node["tag"] != null) { Tags = new TagCollection(node["tag"], context); } foreach (XmlNode v in node.SelectNodes("vertices/vertex")) { VertexContent vtx = new VertexContent(); vtx.Id = v.Attributes["id"] != null ? int.Parse(v.Attributes["id"].Value) : 0; vtx.JointId = v.Attributes["jointID"] != null ? int.Parse(v.Attributes["jointID"].Value) : -1; vtx.Vertex.X = v.Attributes["x"] != null ? float.Parse(v.Attributes["x"].Value, CultureInfo.InvariantCulture) : 0; vtx.Vertex.Y = v.Attributes["y"] != null ? float.Parse(v.Attributes["y"].Value, CultureInfo.InvariantCulture) : 0; vtx.Vertex.Z = v.Attributes["z"] != null ? float.Parse(v.Attributes["z"].Value, CultureInfo.InvariantCulture) : 0; Vertices.Add(vtx); } foreach (XmlNode p in node.SelectNodes("polygons/poly")) { PolygonContent poly = new PolygonContent(); poly.MaterialId = int.Parse(p.Attributes["mid"].Value); foreach (XmlNode pv in p.SelectNodes("vertex")) { VertexContent vtx = new VertexContent(); vtx.Id = pv.Attributes["vid"] != null ? int.Parse(pv.Attributes["vid"].Value) : 0; vtx.UV.X = pv.Attributes["u0"] != null ? float.Parse(pv.Attributes["u0"].Value) : 0; vtx.UV.Y = pv.Attributes["v0"] != null ? float.Parse(pv.Attributes["v0"].Value) : 0; vtx.UV1.X = pv.Attributes["u1"] != null ? float.Parse(pv.Attributes["u1"].Value) : 0; vtx.UV1.Y = pv.Attributes["v1"] != null ? float.Parse(pv.Attributes["v1"].Value) : 0; poly.Vertices.Add(vtx); } Polys.Add(poly); } }
public void Export3Error3() { using (var ms = new MemoryStream(new byte[256], false)) { var tag_base = new TagCollection(); tag_base.TrackNameEnglish = "foo"; tag_base.GameNameEnglish = "bar"; tag_base.Export(ms, Encoding.UTF8); } }
public EStopStatus () { InitializeComponent(); CultureResources.registerDataProvider(this); CultureResources.getDataProvider().DataChanged += new EventHandler(CultureResources_DataChanged); _estopTags = new TagCollection(); _estopTags = (TagCollection)FindResource("estopCollection"); }
protected virtual void WriteValue(TagCollection value) { _stream.WriteByte((byte)value.LimitType); this.WriteValue(value.Count); foreach (ITag item in value) { this.WriteTag(item, WriteTagOptions.IgnoreName); } }
public TagCollection Difference(TagCollection other) { var retn = new TagCollection(); List<Tag> shorter = (tags.Count < other.tags.Count) ? tags : other.tags; List<Tag> longer = (tags.Count < other.tags.Count) ? other.tags : tags; for (int i = 0; i < longer.Count; i++) { if (!shorter.Contains(longer[i])) { retn.Add(longer[i]); } } return retn; }
public void ConstructorTest2() { var tag_base = new TagCollection(); tag_base.TrackNameEnglish = "foo"; tag_base.GameNameEnglish = "bar"; var new_tag = new TagCollection(tag_base); Assert.AreEqual(11, new_tag.Count); Assert.AreEqual("foo", new_tag.TrackNameEnglish); Assert.AreEqual("bar", new_tag.GameNameEnglish); }
public void TestTagCollection() { var target = new TagCollection(new[] {"t1", "", ",", "t2"}); Assert.AreEqual("T1,T2", target.ToString()); var deserialized = TagCollection.FromString("T1,T2"); Assert.AreEqual(target.Count, deserialized.Count); Assert.AreEqual(target.First(), deserialized.First()); Assert.AreEqual(target.Last(), deserialized.Last()); Assert.IsNull(TagCollection.FromString(null)); }
public void SetUp() { Tags = new TagCollection(); Tags.Add(new Tag() { name = "v0.2.0" }); Tags.Add(new Tag() { name = "v0.1.0" }); }
/// <summary> /// Initializes a new instance of the <see cref="Asset"/> class. /// </summary> protected Asset() { Id = Guid.NewGuid(); Tags = new TagCollection(); // Initializse asset with default versions var defaultPackageVersion = AssetRegistry.GetCurrentFormatVersions(GetType()); if (defaultPackageVersion != null) { SerializedVersion = new Dictionary<string, PackageVersion>(defaultPackageVersion); } }
private Arguments Generate(TagCollection tags, string startTag = "", string endTag = "", string fileExtension = ".sql", string fileName = "updated-sql.csv") { var start = tags.FirstOrDefault(x => x.Name == startTag); var end = tags.FirstOrDefault(x => x.Name == endTag); return new Arguments { StartTag = start != null ? start.Target.Sha : tags.Last().Target.Sha, EndTag = end != null ? end.Target.Sha : tags.Reverse().Skip(1).First().Target.Sha, FileExtension = fileExtension, ExportFileName = fileName }; }
public Arguments ParseArguments(string[] args, TagCollection tags) { if (args.Length == 2) { return Generate(tags, args[0], args[1]); } else if (args.Length == 3) { return Generate(tags, args[0], args[1], args[2]); } else if (args.Length == 4) { return Generate(tags, args[0], args[1], args[2], args[3]); } return Generate(tags); }
public override TagCollection ReadCollection(TagList owner) { TagCollection value; TagType listType; string listTypeName; listTypeName = _reader.GetAttribute("limitType"); if (string.IsNullOrEmpty(listTypeName)) throw new InvalidDataException("Missing limitType attribute, unable to determine list contents type."); listType = (TagType)Enum.Parse(typeof(TagType), listTypeName, true); owner.ListType = listType; value = new TagCollection(owner, listType); this.LoadChildren(value, NbtOptions.None, listType); return value; }
/// <summary> /// Initializes a new instance of the <see cref = "Repository" /> class. /// <para>For a standard repository, <paramref name="path"/> should point to the ".git" folder. For a bare repository, <paramref name="path"/> should directly point to the repository folder.</para> /// </summary> /// <param name = "path">The path to the git repository to open.</param> public Repository(string path) { Ensure.ArgumentNotNullOrEmptyString(path, "path"); var res = NativeMethods.git_repository_open(out handle, PosixPathHelper.ToPosix(path)); Ensure.Success(res); isBare = NativeMethods.git_repository_is_bare(handle); if (!isBare) { index = new Index(this); } commits = new CommitCollection(this); refs = new ReferenceCollection(this); branches = new BranchCollection(this); tags = new TagCollection(this); }
/// <summary> /// Initializes a new instance of the <see cref = "Repository" /> class. /// <para>For a standard repository, <paramref name="path"/> should point to the ".git" folder. For a bare repository, <paramref name="path"/> should directly point to the repository folder.</para> /// </summary> /// <param name = "path">The path to the git repository to open.</param> public Repository(string path) { Ensure.ArgumentNotNullOrEmptyString(path, "path"); var res = NativeMethods.git_repository_open(out handle, PosixPathHelper.ToPosix(path)); Ensure.Success(res); string normalizedPath = NativeMethods.git_repository_path(handle).MarshallAsString(); string normalizedWorkDir = NativeMethods.git_repository_workdir(handle).MarshallAsString(); Info = new RepositoryInformation(this, normalizedPath, normalizedWorkDir, normalizedWorkDir == null); if (!Info.IsBare) index = new Index(this); commits = new CommitCollection(this); refs = new ReferenceCollection(this); branches = new BranchCollection(this); tags = new TagCollection(this); }
public override TagCollection ReadCollection(TagList owner) { TagCollection tags; int length; owner.ListType = (TagType)this.ReadByte(); tags = new TagCollection(owner, owner.ListType); length = this.ReadInt(); for (int i = 0; i < length; i++) { ITag tag; switch (owner.ListType) { case TagType.Byte: tag = TagFactory.CreateTag(TagType.Byte, this.ReadByte()); break; case TagType.ByteArray: tag = TagFactory.CreateTag(TagType.ByteArray, this.ReadByteArray()); break; case TagType.Compound: tag = TagFactory.CreateTag(TagType.Compound); tag.Value = this.ReadDictionary((TagCompound)tag); break; case TagType.Double: tag = TagFactory.CreateTag(TagType.Double, this.ReadDouble()); break; case TagType.End: tag = new TagEnd(); break; case TagType.Float: tag = TagFactory.CreateTag(TagType.Float, this.ReadFloat()); break; case TagType.Int: tag = TagFactory.CreateTag(TagType.Int, this.ReadInt()); break; case TagType.IntArray: tag = TagFactory.CreateTag(TagType.IntArray, this.ReadIntArray()); break; case TagType.List: tag = TagFactory.CreateTag(TagType.List); tag.Value = this.ReadCollection((TagList)tag); break; case TagType.Long: tag = TagFactory.CreateTag(TagType.Long, this.ReadLong()); break; case TagType.Short: tag = TagFactory.CreateTag(TagType.Short, this.ReadShort()); break; case TagType.String: tag = TagFactory.CreateTag(TagType.String, this.ReadString()); break; default: throw new InvalidDataException("Invalid list type."); } tags.Add(tag); } return tags; }
private void LoadTags() => this.AllTags = this.LoadTagsAsync().GetAwaiter().GetResult();
/// <summary> /// Initializes a new instance of the <see cref="Asset"/> class. /// </summary> protected Asset() { Id = Guid.NewGuid(); Tags = new TagCollection(); }
public static IApplicationInfoProperties SetEphemeralReplicaTags([NotNull] this IApplicationInfoProperties properties, [NotNull] string replicaName, TagCollection tags) => properties.SetReplicaTags(replicaName, ReplicaTagKind.Ephemeral, tags);
public TagRequest(TagCollection collection, Tag tag, VoteState vote) : this(collection, tag.ToString(), vote) { }
public static TagCollection Service(this TagCollection tagCollection, string service) { return(Set(tagCollection, Tags.Service, service)); }
/// <summary> /// <c>true</c> if and only if the application considers the operation represented by the Span to have failed. /// </summary> public static TagCollection Error(this TagCollection tagCollection, bool error) { return(Set(tagCollection, Tags.Error, error)); }
/// <summary> /// Remote "address", suitable for use in a networking client library. /// This may be a "ip:port", a bare "hostname", a FQDN, or even a sql connection substring like "mysql://prod-db:3306". /// </summary> public static TagCollection PeerAddress(this TagCollection tagCollection, string peerAddress) { return(Set(tagCollection, Tags.PeerAddress, peerAddress)); }
/// <summary> /// An address at which messages can be exchanged. E.g. A Kafka record has an associated "topic name" /// that can be extracted by the instrumented producer or consumer and stored using this tag. /// </summary> public static TagCollection MessageBusDestination(this TagCollection tagCollection, string messageBusDestination) { return(Set(tagCollection, Tags.MessageBusDestination, messageBusDestination)); }
/// <summary> /// Initializes a <see cref="ProfiledDbCommand"/>. /// </summary> /// <param name="command">The <see cref="IDbCommand"/> to be profiled.</param> /// <param name="dbProfiler">The <see cref="IDbProfiler"/>.</param> /// <param name="tags">The tags of the <see cref="DbTiming"/> which will be created internally.</param> public ProfiledDbCommand(IDbCommand command, IDbProfiler dbProfiler, TagCollection tags) : this(command, () => dbProfiler, tags) { }
public static TagCollection HttpHost(this TagCollection tagCollection, string host) { return(tagCollection.Set("http.host", host)); }
/// <summary> /// URL of the request being handled in this segment of the trace, in standard URI format. /// E.g., "https://domain.net/path/to?resource=here". /// </summary> public static TagCollection HttpUrl(this TagCollection tagCollection, string httpUrl) { return(Set(tagCollection, Tags.HttpUrl, httpUrl)); }
/// <summary> /// HTTP response status code for the associated Span. E.g., 200, 503, 404. /// </summary> public static TagCollection HttpStatusCode(this TagCollection tagCollection, int httpStatusCode) { return(Set(tagCollection, Tags.HttpStatusCode, httpStatusCode)); }
/// <summary> /// HTTP method of the request for the associated Span. E.g., "GET", "POST". /// </summary> public static TagCollection HttpMethod(this TagCollection tagCollection, string httpMethod) { return(Set(tagCollection, Tags.HttpMethod, httpMethod)); }
public override BlogArticle GetBlogArticle(int articleID) { using (SqlQuery query = new SqlQuery()) { query.CommandText = "bx_Blog_GetBlogArticle"; query.CommandType = CommandType.StoredProcedure; query.CreateParameter<int>("@ArticleID", articleID, SqlDbType.Int); using (XSqlDataReader reader = query.ExecuteReader()) { TagCollection tags = new TagCollection(reader); BlogArticleVisitorCollection visitors = null; if (reader.NextResult()) visitors = new BlogArticleVisitorCollection(reader); BlogArticle articles = null; if (reader.NextResult() && reader.Read()) { articles = new BlogArticle(reader); articles.Tags = tags; articles.LastVisitors = visitors; } return articles; } } }
/// <summary> /// Remote hostname. E.g., "opentracing.io", "internal.dns.name". /// </summary> public static TagCollection PeerHostName(this TagCollection tagCollection, string peerHostname) { return(Set(tagCollection, Tags.PeerHostname, peerHostname)); }
/// <summary> /// Remote IPv6 address as a string of colon-separated 4-char hex tuples. /// E.g., "2001:0db8:85a3:0000:0000:8a2e:0370:7334". /// </summary> public static TagCollection PeerIpV6(this TagCollection tagCollection, string peerIpV6) { return(Set(tagCollection, Tags.PeerIpV6, peerIpV6)); }
public static TagCollection Set(this TagCollection tagCollection, string key, double value) { return(Set(tagCollection, key, value.ToString())); }
/// <summary> /// Remote port. E.g., 80. /// </summary> public static TagCollection PeerPort(this TagCollection tagCollection, int peerPort) { return(Set(tagCollection, Tags.PeerPort, peerPort)); }
/// <summary> /// Initializes a new instance of the <see cref="TagSelector"/> class. /// </summary> public TagSelector() { Tags = new TagCollection(); }
/// <summary> /// Remote service name (for some unspecified definition of "service"). /// E.g., "elasticsearch", "a_custom_microservice", "memcache". /// </summary> public static TagCollection PeerService(this TagCollection tagCollection, string peerService) { return(Set(tagCollection, Tags.PeerService, peerService)); }
public TagRequest(TagCollection collection, IEnumerable <Tag> tags, VoteState vote) : this(collection, string.Join(",", tags), vote) { }
/// <summary> /// If greater than 0, a hint to the Tracer to do its best to capture the trace. /// If 0, a hint to the trace to not-capture the trace. /// If absent, the Tracer should use its default sampling mechanism. /// </summary> public static TagCollection SamplingPriority(this TagCollection tagCollection, string samplingPriority) { return(Set(tagCollection, Tags.SamplingPriority, samplingPriority)); }
public static IApplicationInfoProperties SetPersistentReplicaTags([NotNull] this IApplicationInfoProperties properties, [NotNull] string replicaName, TagCollection tags) => properties.SetReplicaTags(replicaName, ReplicaTagKind.Persistent, tags);
/// <summary> /// Either "client" or "server" for the appropriate roles in an RPC, /// and "producer" or "consumer" for the appropriate roles in a messaging scenario. /// </summary> public static TagCollection SpanKind(this TagCollection tagCollection, string spanKind) { return(Set(tagCollection, Tags.SpanKind, spanKind)); }
/// <summary> /// Creates an <see cref="IProfilingStep"/> that will time the code between its creation and disposal. /// </summary> /// <param name="name">The name of the step.</param> /// <param name="tags">The tags of the step.</param> /// <returns>Returns the created <see cref="IProfilingStep"/>.</returns> public virtual IProfilingStep Step(string name, TagCollection tags) { return(new ProfilingStep(this, name, tags)); }
/// <summary> /// A constant for setting the "span.kind" to indicate that it represents a "client" span. /// </summary> public static TagCollection Client(this TagCollection tagCollection) { return(Set(tagCollection, Tags.SpanKind, Tags.SpanKindClient)); }
public virtual void Write(TagCollection value) { if (value.LimitType == TagType.None || value.LimitType == TagType.End) throw new TagException("Limit type not set."); this.OutputStream.WriteByte((byte)value.LimitType); this.Write(value.Count); foreach (ITag item in value) this.Write(item, NbtOptions.None); }
/// <summary> /// A constant for setting the "span.kind" to indicate that it represents a "server" span. /// </summary> public static TagCollection Server(this TagCollection tagCollection) { return(Set(tagCollection, Tags.SpanKind, Tags.SpanKindServer)); }
public virtual void Write(TagCollection value) { _writer.WriteAttributeString("limitType", value.LimitType.ToString()); foreach (ITag item in value) { this.Write(item, NbtOptions.None); } }
/// <summary> /// A constant for setting the "span.kind" to indicate that it represents a "consumer" span, /// in a messaging scenario. /// </summary> public static TagCollection Consumer(this TagCollection tagCollection) { return(Set(tagCollection, Tags.SpanKind, Tags.SpanKindConsumer)); }
public Parser() { Tags = new TagCollection(); }
/// <summary> /// A constant for setting the "span.kind" to indicate that it represents a "producer" span, /// in a messaging scenario. /// </summary> public static TagCollection Producer(this TagCollection tagCollection) { return(Set(tagCollection, Tags.SpanKind, Tags.SpanKindProducer)); }
public static TagCollection HttpPath(this TagCollection tagCollection, string path) { return(tagCollection.Set("http.path", path)); }
/// <summary> /// Initializes a <see cref="ProfiledDbCommand"/>. /// </summary> /// <param name="command">The <see cref="IDbCommand"/> to be profiled.</param> /// <param name="getDbProfiler">Gets the <see cref="IDbProfiler"/>.</param> /// <param name="tags">The tags of the <see cref="DbTiming"/> which will be created internally.</param> public ProfiledDbCommand(IDbCommand command, Func <IDbProfiler> getDbProfiler, TagCollection tags) { if (command == null) { throw new ArgumentNullException("command"); } if (getDbProfiler == null) { throw new ArgumentNullException("getDbProfiler"); } _command = command; _dbCommand = command as DbCommand; _getDbProfiler = getDbProfiler; Tags = tags; }