如何创建方法 [英] How to create a Method

查看:63
本文介绍了如何创建方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个静态的收藏夹列表,我需要创建一个方法来返回我的收藏夹列表中的所有值.有关此操作的任何想法,请包括示例代码. h2_lin>解决方案

尝试:

 public  返回 myPrivateStaticList;
   } 


Hi guys i have a static collection list, i need to create a method the returns all the values in my collection list.. Any idea on how to go about that, Please include example code.. Thanks

解决方案

Try:

public static List<MyCollectionObjectType> GetAllItems()
   {
   return myPrivateStaticList;
   }


这篇关于如何创建方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆