Ejemplo n.º 1
0
        public static IEnumerable <IJSCSGlue> GetAllChildren(this IJSCSGlue @this, bool includeMySelf = false)
        {
            var res = new HashSet <IJSCSGlue>();

            @this.GetAllChildren(includeMySelf, res);
            return(res);
        }
Ejemplo n.º 2
0
        private ISet <IJSCSGlue> GetAllChildren()
        {
            var @glues = _Root.GetAllChildren(true);

            @glues.UnionWith(_UnrootedEntities.SelectMany(ent => ent.GetAllChildren(true)));
            return(@glues);
        }
Ejemplo n.º 3
0
        public void UpdateJavascriptValue()
        {
            var builders = _Root.GetAllChildren(true).Where(glue => glue.JSValue == null)
                           .Select(glue => new JSBuilderAdapter(glue, this)).ToList();

            builders.ForEach(builder => builder.GetBuildRequest());
            CreateObjects();
            UpdateDependencies();
        }
Ejemplo n.º 4
0
        public static ISet <IJSCSGlue> GetAllChildren(this IJSCSGlue @this, bool includeMySelf = false)
        {
            var res = new HashSet <IJSCSGlue>();

            if (includeMySelf)
            {
                res.Add(@this);
            }

            @this.GetAllChildren(res);
            return(res);
        }
Ejemplo n.º 5
0
        public static void ApplyOnListenable(this IJSCSGlue @this, IListenableObjectVisitor ivisitor)
        {
            foreach (var child in @this.GetAllChildren(true))
            {
                var childvalue = child.CValue;
                var notifyCollectionChanged = childvalue as INotifyCollectionChanged;
                if (notifyCollectionChanged != null)
                {
                    ivisitor.OnCollection(notifyCollectionChanged);
                    continue;
                }

                var notifyPropertyChanged = childvalue as INotifyPropertyChanged;
                if ((notifyPropertyChanged != null) && !(child is IEnumerable))
                {
                    ivisitor.OnObject(notifyPropertyChanged);
                }

                if (child.Type == JsCsGlueType.Command)
                {
                    ivisitor.OnCommand(child as JSCommand);
                }
            }
        }