[NUI] Fix svace issue (#759)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Thu, 21 Mar 2019 05:54:56 +0000 (14:54 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 21 Mar 2019 05:54:56 +0000 (14:54 +0900)
* [NUI] Fix VD Svace issue (#696)

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
* [NUI] Fix Svace issue (#727)

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
* [NUI] Fix svace issue (#735)

Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
* Update XamlPropertyCondition.cs

src/Tizen.NUI/src/internal/Xaml/CreateValuesVisitor.cs
src/Tizen.NUI/src/internal/Xaml/MarkupExtensionParser.cs
src/Tizen.NUI/src/internal/XamlBinding/Interactivity/AttachedCollection.cs
src/Tizen.NUI/src/internal/XamlBinding/Interactivity/XamlPropertyCondition.cs
src/Tizen.NUI/src/internal/XamlBinding/ObservableWrapper.cs

index e3e40d8..a501ff2 100755 (executable)
@@ -315,7 +315,7 @@ namespace Tizen.NUI.Xaml
                         enode.SkipProperties.Add(name);
                     var value = Context.Values[node];
                     var serviceProvider = new XamlServiceProvider(enode, Context);
-                    var convertedValue = value.ConvertTo(parameter?.ParameterType, () => parameter, serviceProvider);
+                    var convertedValue = value?.ConvertTo(parameter.ParameterType, () => parameter, serviceProvider);
                     array[i] = convertedValue;
                 }
                 return array;
index ec76d26..e36449e 100755 (executable)
@@ -64,14 +64,14 @@ namespace Tizen.NUI.Xaml
                 prop = ApplyPropertiesVisitor.GetContentPropertyName(t.GetTypeInfo());
                 if (prop == null)
                     return;
-                setter = t.GetRuntimeProperty(prop).SetMethod;
+                setter = t.GetRuntimeProperty(prop)?.SetMethod;
             }
             else
-                setter = markupExtension.GetType().GetRuntimeProperty(prop).SetMethod;
+                setter = markupExtension.GetType().GetRuntimeProperty(prop)?.SetMethod;
 
             if (value == null && strValue != null)
             {
-                value = strValue.ConvertTo(markupExtension.GetType().GetRuntimeProperty(prop).PropertyType,
+                value = strValue.ConvertTo(markupExtension.GetType().GetRuntimeProperty(prop)?.PropertyType,
                     (Func<TypeConverter>)null, serviceProvider);
             }
 
index d5d1fc3..b1c5247 100755 (executable)
@@ -41,7 +41,7 @@ namespace Tizen.NUI.Binding
                     var bindable = weakbindable.Target as BindableObject;
                     if (bindable == null)
                         continue;
-                    item.DetachFrom(bindable);
+                    item?.DetachFrom(bindable);
                 }
             }
             base.ClearItems();
@@ -55,7 +55,7 @@ namespace Tizen.NUI.Binding
                 var bindable = weakbindable.Target as BindableObject;
                 if (bindable == null)
                     continue;
-                item.AttachTo(bindable);
+                item?.AttachTo(bindable);
             }
         }
 
@@ -66,13 +66,13 @@ namespace Tizen.NUI.Binding
                 _associatedObjects.Add(new WeakReference(bindable));
             }
             foreach (T item in this)
-                item.AttachTo(bindable);
+                item?.AttachTo(bindable);
         }
 
         protected virtual void OnDetachingFrom(BindableObject bindable)
         {
             foreach (T item in this)
-                item.DetachFrom(bindable);
+                item?.DetachFrom(bindable);
             lock (_associatedObjects)
             {
                 for (var i = 0; i < _associatedObjects.Count; i++)
@@ -96,7 +96,7 @@ namespace Tizen.NUI.Binding
                 var bindable = weakbindable.Target as BindableObject;
                 if (bindable == null)
                     continue;
-                item.DetachFrom(bindable);
+                item?.DetachFrom(bindable);
             }
 
             base.RemoveItem(index);
@@ -110,7 +110,7 @@ namespace Tizen.NUI.Binding
                 var bindable = weakbindable.Target as BindableObject;
                 if (bindable == null)
                     continue;
-                old.DetachFrom(bindable);
+                old?.DetachFrom(bindable);
             }
 
             base.SetItem(index, item);
@@ -120,7 +120,7 @@ namespace Tizen.NUI.Binding
                 var bindable = weakbindable.Target as BindableObject;
                 if (bindable == null)
                     continue;
-                item.AttachTo(bindable);
+                item?.AttachTo(bindable);
             }
         }
     }
index adcc068..1f83d18 100755 (executable)
@@ -28,13 +28,14 @@ namespace Tizen.NUI.Binding
                     return;
                 if (IsSealed)
                     throw new InvalidOperationException("Can not change Property once the Trigger has been applied.");
+
                 _property = value;
 
                 //convert the value
                 if (_property != null && s_valueConverter != null)
                 {
-                    Func<MemberInfo> minforetriever = () => Property.DeclaringType.GetRuntimeProperty(Property.PropertyName);
-                    Value = s_valueConverter.Convert(Value, Property.ReturnType, minforetriever, null);
+                    Func<MemberInfo> minforetriever = () => _property.DeclaringType.GetRuntimeProperty(_property.PropertyName);
+                    Value = s_valueConverter.Convert(Value, _property.ReturnType, minforetriever, null);
                 }
             }
         }
@@ -52,10 +53,14 @@ namespace Tizen.NUI.Binding
                 //convert the value
                 if (_property != null && s_valueConverter != null)
                 {
-                    Func<MemberInfo> minforetriever = () => Property.DeclaringType.GetRuntimeProperty(Property.PropertyName);
-                    value = s_valueConverter.Convert(value, Property.ReturnType, minforetriever, null);
+                    Func<MemberInfo> minforetriever = () => _property.DeclaringType.GetRuntimeProperty(_property.PropertyName);
+                    _triggerValue = s_valueConverter.Convert(value, _property.ReturnType, minforetriever, null);
+                }
+                else
+                {
+                    _triggerValue = value;
                 }
-                _triggerValue = value;
+                
             }
         }
 
index b897657..2a220ea 100755 (executable)
@@ -139,7 +139,7 @@ namespace Tizen.NUI.Binding
                 throw new NotSupportedException("The collection is read-only");
             int innerIndex = ToInnerIndex(index);
             TTrack item = _list[innerIndex];
-            if (item.Owned)
+            if (item != null && item.Owned)
             {
                 _list.RemoveAt(innerIndex);
                 item.Owned = false;