Esempio n. 1
0
 public XMLPropItemModel(string type, string name,
                         string extraInfo = null, PropStorageStrategyEnum storageStrategy = PropStorageStrategyEnum.Internal,
                         bool typeIsSolid = true,
                         PropDoWhenChanged doWhenChanged = null, PropComparerField comparer = null)
 {
     Type               = type;
     Name               = name;
     ExtraInfo          = extraInfo;
     StorageStrategy    = storageStrategy;
     TypeIsSolid        = typeIsSolid;
     ComparerField      = comparer;
     DoWhenChangedField = doWhenChanged;
 }
Esempio n. 2
0
        public static DRM.PropBag.XMLModel.PropDoWhenChanged PrepareDoWhenChangedField(this XMLPropModel pm, XMLPropItemModel pi)
        {
            DRM.PropBag.XMLModel.PropDoWhenChanged dwcf = pi.DoWhenChangedField;
            if (dwcf == null)
            {
                return(new DRM.PropBag.XMLModel.PropDoWhenChanged("null"));
            }

            string doWhenChanged;

            if (pm.DeferMethodRefResolution)
            {
                // Wrap in a call to GetDelegate if non-null, otherwise return the string: "null"
                doWhenChanged = dwcf.DoWhenChanged == null ? "null" : WrapWithGetDelegate(dwcf.DoWhenChanged, pi.Type);
            }
            else
            {
                // Return the string: "null", if there is no doWhenChanged action provided.
                doWhenChanged = dwcf.DoWhenChanged ?? "null";
            }

            return(new PropDoWhenChanged(doWhenChanged, dwcf.DoAfterNotify));
        }