Beispiel #1
0
        protected virtual void OnStatusChanged(CodecApiElement element, string[] propertyNamesWhichUpdated)
        {
#if DEBUG
            foreach (var name in propertyNamesWhichUpdated)
            {
                try
                {
                    var f = GetFieldWithAttributeName(name);
                    if (f != null)
                    {
                        Debug.WriteInfo(_apiNameSpace, "{0} = {1}", name, f.GetValue(this).ToString());
                    }
                }
                catch (Exception e)
                {
                    Debug.WriteWarn(_apiNameSpace, "Could not get value for debug on property: {0}, {1}", name, e.Message);
                }
            }
#endif
            if (StatusChange == null)
            {
                return;
            }
            try
            {
                StatusChange(this, propertyNamesWhichUpdated);
            }
            catch (Exception e)
            {
                CloudLog.Exception(e);
            }
        }
Beispiel #2
0
        protected CodecApiElement(CodecApiElement parent, string propertyName)
        {
            _codec = parent.Codec;

            _parent = parent;
            _parent.ChildElementChange += ParentOnChildElementChange;

            _apiNameSpace = string.Format("{0}{1}{2}",
                                          parent.ApiNameSpace, parent.ApiNameSpace.EndsWith("]") ? "" : ".",
                                          propertyName);
        }
Beispiel #3
0
        private void ParentOnChildElementChange(CodecApiElement childElement, StatusUpdateItem[] statusUpdate)
        {
            if (childElement != this)
            {
                return;
            }
            //Debug.WriteInfo(_apiNameSpace, "OnStatusReceived");
            var names = UpdateFromStatus(statusUpdate);

            if (names.Any())
            {
                OnStatusChanged(this, names);
            }
        }
Beispiel #4
0
        protected override void OnStatusChanged(CodecApiElement element, string[] propertyNamesWhichUpdated)
        {
            base.OnStatusChanged(element, propertyNamesWhichUpdated);

            try
            {
                if (StateChange != null)
                {
                    StateChange(Codec, State);
                }
            }
            catch (Exception e)
            {
                CloudLog.Exception(e);
            }
        }
Beispiel #5
0
        protected virtual void OnChildElementChange(CodecApiElement childelement, StatusUpdateItem[] statusupdate)
        {
            var handler = ChildElementChange;

            try
            {
                if (handler != null)
                {
                    handler(childelement, statusupdate);
                }
            }
            catch (Exception e)
            {
                CloudLog.Exception(e);
            }
        }
Beispiel #6
0
 protected override void OnStatusChanged(CodecApiElement element, string[] propertyNamesWhichUpdated)
 {
     base.OnStatusChanged(element, propertyNamesWhichUpdated);
     Codec.Calls.OnCallStatusChange(Codec, CallStatusEventType.StatusUpdated, this);
 }
Beispiel #7
0
 protected CodecApiElement(CodecApiElement parent, string propertyName, int indexer)
     : this(parent, propertyName)
 {
     _apiNameSpace = _apiNameSpace + "[" + indexer + "]";
 }