コード例 #1
0
ファイル: ControllerMeta.cs プロジェクト: zuhuizou/wojilu
        private static void loadActionObserver(Dictionary <String, List <ActionObserver> > dic, ActionObserver obj)
        {
            Dictionary <Type, String> actions = obj.GetRelatedActions();

            foreach (KeyValuePair <Type, String> kv in actions)
            {
                String[] arrActions = kv.Value.Split('/');
                foreach (String action in arrActions)
                {
                    String key = kv.Key.FullName + "_" + action;

                    List <ActionObserver> clist = dic.ContainsKey(key) ? dic[key] : new List <ActionObserver>();
                    if (clist.Contains(obj) == false)
                    {
                        clist.Add(obj);
                    }

                    dic[key] = clist;
                }
            }
        }
コード例 #2
0
        private static void loadActionObserver( Dictionary<String, List<ActionObserver>> dic, ActionObserver obj )
        {
            Dictionary<Type, String> actions = obj.GetRelatedActions();

            foreach (KeyValuePair<Type, String> kv in actions) {

                String[] arrActions = kv.Value.Split( '/' );
                foreach (String action in arrActions) {

                    String key = kv.Key.FullName + "_" + action;

                    List<ActionObserver> clist = dic.ContainsKey( key ) ? dic[key] : new List<ActionObserver>();
                    if (clist.Contains( obj ) == false) {
                        clist.Add( obj );
                    }

                    dic[key] = clist;
                }
            }
        }