コード例 #1
0
ファイル: NpmWorker.cs プロジェクト: kevinnet37/nodejstools
        private static void AddAuthor(NodeModuleBuilder builder, JToken author)
        {
            var name = author?["name"];

            if (author != null)
            {
                builder.AddAuthor((string)name);
            }
        }
コード例 #2
0
        private static void AddAuthor(NodeModuleBuilder builder, JToken author)
        {
            JArray  authorArray;
            JObject authorObject;
            string  name;

            if ((authorArray = author as JArray) != null)
            {
                foreach (var subAuthor in authorArray)
                {
                    AddAuthor(builder, subAuthor);
                }
            }
            else if ((authorObject = author as JObject) != null)
            {
                AddAuthor(builder, authorObject["name"]);
            }
            else if (!string.IsNullOrEmpty(name = (string)author))
            {
                builder.AddAuthor(name);
            }
        }
コード例 #3
0
 private static void AddAuthor(NodeModuleBuilder builder, JToken author) {
     JArray authorArray;
     JObject authorObject;
     string name;
     if ((authorArray = author as JArray) != null) {
         foreach (var subAuthor in authorArray) {
             AddAuthor(builder, subAuthor);
         }
     } else if ((authorObject = author as JObject) != null) {
         AddAuthor(builder, authorObject["name"]);
     } else if (!string.IsNullOrEmpty(name = (string)author)) {
         builder.AddAuthor(name);
     }
 }