Exemple #1
0
            private static IEnumerable <string> GetSrtSubTitleParts(TextReader reader)
            {
                MBStringBuilder sb = new MBStringBuilder();

                sb.Initialize(callerMemberName: nameof(GetSrtSubTitleParts));
                string str1;

                while ((str1 = reader.ReadLine()) != null)
                {
                    if (string.IsNullOrEmpty(str1.Trim()))
                    {
                        string str2 = sb.ToStringAndRelease().TrimEnd();
                        if (!string.IsNullOrEmpty(str2))
                        {
                            yield return(str2);
                        }
                        sb.Initialize(callerMemberName: nameof(GetSrtSubTitleParts));
                    }
                    else
                    {
                        sb.AppendLine <string>(str1);
                    }
                }
                if (sb.Length > 0)
                {
                    yield return(sb.ToStringAndRelease());
                }
                else
                {
                    sb.Release();
                }
            }
        private BindingPath(string[] firstNodes, string[] secondNodes)
        {
            this.Nodes = new string[firstNodes.Length + secondNodes.Length];
            this._path = "";
            MBStringBuilder mbStringBuilder = new MBStringBuilder();

            mbStringBuilder.Initialize(callerMemberName: ".ctor");
            for (int index = 0; index < firstNodes.Length; ++index)
            {
                this.Nodes[index] = firstNodes[index];
            }
            for (int index = 0; index < secondNodes.Length; ++index)
            {
                this.Nodes[index + firstNodes.Length] = secondNodes[index];
            }
            for (int index = 0; index < this.Nodes.Length; ++index)
            {
                string node = this.Nodes[index];
                mbStringBuilder.Append <string>(node);
                if (index + 1 != this.Nodes.Length)
                {
                    mbStringBuilder.Append('\\');
                }
            }
            this._path = mbStringBuilder.ToStringAndRelease();
        }
        public BindingPath(IEnumerable <string> nodes)
        {
            this.Nodes = nodes.ToArray <string>();
            this._path = "";
            MBStringBuilder mbStringBuilder = new MBStringBuilder();

            mbStringBuilder.Initialize(callerMemberName: ".ctor");
            for (int index = 0; index < this.Nodes.Length; ++index)
            {
                string node = this.Nodes[index];
                mbStringBuilder.Append <string>(node);
                if (index + 1 != this.Nodes.Length)
                {
                    mbStringBuilder.Append('\\');
                }
            }
            this._path = mbStringBuilder.ToStringAndRelease();
        }