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


C# StringList.ToArray方法代码示例

本文整理汇总了C#中StringList.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# StringList.ToArray方法的具体用法?C# StringList.ToArray怎么用?C# StringList.ToArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在StringList的用法示例。


在下文中一共展示了StringList.ToArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CustomViewEngine

        /// <summary>
        /// Constructor
        /// </summary>
        public CustomViewEngine(params string[] additionalLocations)
        {
            StringList viewLocations = new StringList();
            viewLocations.Add("~/Views/{1}/{0}.cshtml");
            viewLocations.Add("~/Views/Shared/{0}.cshtml");
            viewLocations.AddRange(additionalLocations);

            this.PartialViewLocationFormats = viewLocations.ToArray();
            this.ViewLocationFormats = viewLocations.ToArray();
        }
开发者ID:mnoreke,项目名称:MNorekePublic,代码行数:13,代码来源:CustomViewEngine.cs

示例2: ToString

        public override string ToString()
        {
            var list = new StringList();

            foreach (var entry in entries)
                list.Add(entry.ToString());

            return string.Join(" ", list.ToArray());
        }
开发者ID:fjgandrade,项目名称:sharpkit,代码行数:9,代码来源:lib.cs

示例3: ReflectionUtilConvertToListTest

 public void ReflectionUtilConvertToListTest()
 {
     StringList stringData = new StringList();
       stringData.AddRange("One", "Two", "Three");
       List<string> updatedList = ReflectionUtil<string>.ConvertToList(new List<string>(stringData.ToArray()));
       Assert.IsNotNull(updatedList);
       Assert.AreEqual(stringData[0], updatedList[0]);
       Assert.AreEqual(stringData[1], updatedList[1]);
       Assert.AreEqual(stringData[2], updatedList[2]);
 }
开发者ID:mnoreke,项目名称:MNorekePublic,代码行数:10,代码来源:ReflectionUtilTest.cs

示例4: FIELD

        void FIELD(StringList list)
        {
            ConfigField thisField; var tmpStartIndex = la.charPos;
            Expect(5);
            list.Add(t.val);
            thisField = this.MainField.GetKey(string.Join("/", list.ToArray()), ConfigField.KeyMode.CreateNew);
            if (thisField.IsClass)
            {
               thisField.ToField();
            }
            thisField.Name = t.val;
            KeysAdded.Add(string.Join("/", this.MainField.Key, string.Join("/", list.ToArray())).Replace("//", "/"));
            if(this.Range != null && string.Concat("/", string.Join("/", list.ToArray())).Equals(KeyToFind, StringComparison.InvariantCultureIgnoreCase))
            {
            this.Range.WholeStart = tmpStartIndex;
            this.Range.NameStart = t.charPos;
            this.Range.NameEnd = t.charPos + t.val.Length;
            };

            if (la.kind == 11) {
            Get();
            Expect(12);
            }
            Expect(13);
            object tmp; var beginIndex = la.charPos;
            if (la.kind == 8) {
            ARRAY(out tmp);
            thisField.Array = (object[])tmp;
            } else if (la.kind == 1 || la.kind == 2) {
            SCALAR(out tmp);
            thisField.Number = (double)tmp;
            } else if (la.kind == 3 || la.kind == 4) {
            STRING(out tmp);
            thisField.String = (string)tmp;
            } else if (la.kind == 14 || la.kind == 15) {
            BOOLEAN(out tmp);
            thisField.Boolean = (bool)tmp;
            } else if (StartOf(1)) {
            Get();
            tmp = new StringList(); (tmp as StringList).Add(t.val);
            } else SynErr(18);
            if (StartOf(2)) {
            Get();
            tmp = new StringList(); (tmp as StringList).Add(t.val);
            while (StartOf(2)) {
                Get();
                tmp = new StringList(); (tmp as StringList).Add(t.val);
            }
            thisField.String = string.Join(" ", (tmp as StringList).ToArray());
            }
            if(this.Range != null && string.Concat("/", string.Join("/", list.ToArray())).Equals(KeyToFind, StringComparison.InvariantCultureIgnoreCase))
            {
            this.Range.ValueStart = beginIndex;
            this.Range.ValueEnd = t.charPos + t.val.Length;
            this.Range.WholeEnd = la.charPos + la.val.Length;
            }

            Expect(10);
            list.Remove(list.Last());
        }
开发者ID:X39,项目名称:ArmA-UI-Editor,代码行数:60,代码来源:Parser.cs

示例5: CONFIG

        void CONFIG(StringList list)
        {
            ConfigField thisField; var tmpStartIndex = la.charPos;
            Expect(6);
            Expect(5);
            list.Add(t.val);
            thisField = this.MainField.GetKey(string.Join("/", list.ToArray()), ConfigField.KeyMode.CreateNew);
            if (!thisField.IsClass)
            {
               thisField.ToClass();
            }
            thisField.Name = t.val;
            if(this.Range != null && string.Concat("/", string.Join("/", list.ToArray())).Equals(KeyToFind, StringComparison.InvariantCultureIgnoreCase))
            {
            this.Range.WholeStart = tmpStartIndex;
            this.Range.NameStart = t.charPos;
            this.Range.NameEnd = t.charPos + t.val.Length;
            };

            if (la.kind == 7) {
            Get();
            Expect(5);
            thisField.ConfigParentName = t.val;
            }
            if (la.kind == 8) {
            Get();
            var beginIndex = la.charPos;
            while (la.kind == 5 || la.kind == 6) {
                if (la.kind == 5) {
                    FIELD(list);
                } else {
                    CONFIG(list);
                }
            }
            if(this.Range != null && string.Concat("/", string.Join("/", list.ToArray())).Equals(KeyToFind, StringComparison.InvariantCultureIgnoreCase))
            {
            this.Range.ValueStart = beginIndex;
            this.Range.ValueEnd = t.charPos + t.val.Length;
            }

            Expect(9);
            }
            Expect(10);
            if(this.Range != null && string.Concat("/", string.Join("/", list.ToArray())).Equals(KeyToFind, StringComparison.InvariantCultureIgnoreCase))
            {
            this.Range.WholeEnd = t.charPos + t.val.Length;
            }
            KeysAdded.Add(string.Join("/", this.MainField.Key, string.Join("/", list.ToArray())).Replace("//", "/"));
                   list.Remove(list.Last());
        }
开发者ID:X39,项目名称:ArmA-UI-Editor,代码行数:50,代码来源:Parser.cs

示例6: ParseTemplate

 private static void ParseTemplate(string template, out string adjustedTemplate, out string[] argNames)
 {
     // Double brace '{{' is 'escaped brace'. We start by replacing these doubles with \b symbol. At the end we'll replace it back with single brace
       template = template.Replace("{{", "\b");
       var argNameList = new StringList();
       //split by left brace {
       var segments = template.Split(new char[]{'{'}, StringSplitOptions.RemoveEmptyEntries);
       for (int i = 0; i < segments.Length; i++) {
     var segm = segments[i];
     if (string.IsNullOrEmpty(segm)) continue;
     //find closing brace, extract prop name, replace it with index
     var rPos = segm.IndexOf('}');
     if (rPos < 0) rPos = segm.Length; // catch error by including all
     var argName = segm.Substring(0, rPos);
     var tail = segm.Substring(rPos + 1);
     argNameList.Add(argName);
     segments[i] = "{" + i + "}" + tail; // replace 'propName} abcd'   with '{0} abcd'
       }
       // Merge modified segments
       adjustedTemplate = string.Join(string.Empty, segments);
       adjustedTemplate = adjustedTemplate.Replace('\b', '{');
       argNames = argNameList.ToArray();
 }
开发者ID:yuanfei05,项目名称:vita,代码行数:23,代码来源:EntityModelAttributesImpl.cs


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