Пример #1
0
        /// <summary>
        /// Tries to get the information required by a persistent object to bind to the given tracked PCFs using this landscape binding. Retrieved information includes a reference to the best tracked PCF
        /// and its binding information. Returns false if failed to find a valid PCF binding for the given tracked PCFs.
        /// </summary>
        public bool TryGetBindingInfo(IEnumerable <MLUTrackedPCF> trackedPCFs, out MLUPersistentObject.BindingInfo bindingInfo)
        {
            if (trackedPCFs != null)
            {
                foreach (MLUPCFBinding binding in bindings)
                {
                    foreach (MLUTrackedPCF trackedPCF in trackedPCFs)
                    {
                        if (trackedPCF.PCF.CurrentResult == MLResultCode.Ok && trackedPCF.PCF.CFUID.Equals(binding.CFUID))
                        {
                            bindingInfo = new MLUPersistentObject.BindingInfo(this, binding, trackedPCF);
                            return(true);
                        }
                    }
                }
            }

            bindingInfo = default(MLUPersistentObject.BindingInfo);
            return(false);
        }
Пример #2
0
 /// <summary>
 /// Tries to get the information required by a persistent object to bind to the current landscape using this landscape binding. Retrieved information includes a reference to the best tracked PCF
 /// and its binding information. Returns false if failed to find a valid PCF binding for the current landscape.
 /// </summary>
 public bool TryGetBindingInfo(out MLUPersistentObject.BindingInfo bindingInfo)
 {
     return(TryGetBindingInfo(MLULandscape.AllTrackedPCFs, out bindingInfo));
 }