Exemplo n.º 1
0
        /// <summary>
        /// 속성들을 Xml Attribute로 생성합니다.
        /// </summary>
        /// <param name="writer">Attribute를 쓸 Writer</param>
        public override void GenerateXmlAttributes(XmlWriter writer)
        {
            base.GenerateXmlAttributes(writer);

            if (ToObject.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("ToObject", ToObject);
            }
            if (Styles.IsNotWhiteSpace())
            {
                writer.WriteAttributeString("Styles", Styles);
            }
        }
Exemplo n.º 2
0
 public override void Visit(ToObject node)
 {
     unfinishedClone = new ToObject(GetCloneOf(node.Expression));
     base.Visit(node);
 }
Exemplo n.º 3
0
 public override void Visit(ToObject node)
 {
     Visit((ConversionExpression)node);
 }
Exemplo n.º 4
0
 public override void Visit(ToObject node)
 {
     UpdateType(node, TypeCalculator.GetType(node));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToStringRow"/> class.
 /// </summary>
 /// <param name="toStr">use ScenePathToString when null</param>
 /// <param name="toObj">use default casting when null</param>
 public ObjToString(ToStr toStr, ToObject toObj, bool showAsTooltip)
 {
     this.toString      = toStr != null ? toStr : ScenePathToString;
     this.toObject      = toObj != null ? toObj : DefaultToObject;
     this.showAsTooltip = showAsTooltip;
 }
Exemplo n.º 6
0
        /// <summary>
        /// Assigns Value in given direction between Control and DataSource Target
        /// </summary>
        /// <param name="aDirection">
        /// Direction of data <see cref="EDataDirection"/>
        /// </param>
        /// <param name="aObject">
        /// Object which contains data <see cref="System.Object"/>
        /// </param>
        /// <param name="aControl">
        /// Control used to edit <see cref="System.Object"/>
        /// </param>
        /// <returns>
        /// Returns true if successful <see cref="System.Boolean"/>
        /// </returns>
        public bool AssignValueToObject(EDataDirection aDirection, object aObject, object aControl)
        {
            bool res = false;

            // Check if
            if (IsGlobal == true)
            {
                if (aDirection == EDataDirection.FromControlToDataSource)
                {
                    throw new ExceptionGlobalMappingAssignedFromControlToTarget();
                }

#if NEWCACHE
                if (dataCache == null)
                {
                    dataCache = new CachedProperty(Adaptor.FinalTarget, Name);
                }
                if (controlCache == null)
                {
                    controlCache = new CachedProperty(aControl, MappingTarget);
                }
                if (controlCache.IsCached == true)
                {
                    object val;
                    if (dataCache.IsCached == true)
                    {
                        if (dataCache.GetValue(out val) == true)
                        {
                            if (controlCache.SetValue(val) == true)
                            {
                                val = null;
                                return(true);
                            }
                        }
                    }
                }
                return(false);
#endif
#if OLDCACHE
                object FromObject   = aObject;
                object ToObject     = aControl;
                string FromProperty = Name;
                string ToProperty   = MappingTarget;

                // assign, direction is already correct
                res        = ConnectionProvider.CopyPropertyValue(FromObject, FromProperty, ToObject, ToProperty);
                FromObject = null;
                ToObject   = null;
                return(res);
#endif
            }
            else
            {
#if NEWCACHE
                CachedProperty FromObject;
                CachedProperty ToObject;
                bool           canbedone;
                if (aDirection == EDataDirection.FromControlToDataSource)
                {
                    FromObject = controlCache;
                    ToObject   = dataCache;
                    canbedone  = AllowedToWrite;
                    if (ToObject is IObserveable)
                    {
                        (ToObject as IObserveable).ResetChangeCallCheckup();
                    }
                }
                else
                {
                    FromObject = dataCache;
                    ToObject   = controlCache;
                    canbedone  = AllowedToRead;
                }

                if (controlCache == null)
                {
                    controlCache = new CachedProperty(aControl, MappingTarget);
                }

                object val = null;
                // assign in set direction
                if ((canbedone == true) && (FromObject != null) && (ToObject != null))
                {
                    if (FromObject.GetValue(out val) == true)
                    {
                        if (ToObject.SetValue(val) == true)
                        {
                            if (aDirection == EDataDirection.FromControlToDataSource)
                            {
                                if ((ToObject is IObserveable) == false)
                                {
                                    DataSourceController.CallChangedFor(ToObject);
                                }
                                else
                                if ((ToObject as IObserveable).HasCalledForChange == false)
                                {
                                    (ToObject as IObserveable).HasChanged = true;
                                }
                            }
                        }
                        res = true;
                    }
                }
                FromObject = null;
                ToObject   = null;
                return(res);
#endif
#if OLDCACHE
                object FromObject;
                object ToObject;
                string FromProperty;
                string ToProperty;
                bool   canbedone;
                // swap direction if needed
                if (aDirection == EDataDirection.FromControlToDataSource)
                {
                    FromObject   = aControl;
                    ToObject     = aObject;
                    FromProperty = MappingTarget;
                    ToProperty   = Name;
                    canbedone    = AllowedToWrite;
                    if (ToObject is IObserveable)
                    {
                        (ToObject as IObserveable).ResetChangeCallCheckup();
                    }
                }
                else
                {
                    FromObject   = aObject;
                    ToObject     = aControl;
                    FromProperty = Name;
                    ToProperty   = MappingTarget;
                    canbedone    = AllowedToRead;
                }

                // assign in set direction
                if (canbedone == true)
                {
                    if (ConnectionProvider.CopyPropertyValue(FromObject, FromProperty, ToObject, ToProperty) == true)
                    {
                        if (aDirection == EDataDirection.FromControlToDataSource)
                        {
                            if ((ToObject is IObserveable) == false)
                            {
                                DataSourceController.CallChangedFor(ToObject);
                            }
                            else
                            if ((ToObject as IObserveable).HasCalledForChange == false)
                            {
                                (ToObject as IObserveable).HasChanged = true;
                            }
                        }
                        res = true;
                    }
//					else
//						Debug.Warning ("MappedProperty.AssignValueToObject", "CopyPropertyValue not successful");
                }
                FromObject = null;
                ToObject   = null;
                return(res);
#endif
            }
        }
Exemplo n.º 7
0
 internal static void Create(object nombreStore, ToObject toObject, ToString toString)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 8
0
 public override void Visit(ToObject node)
 {
     AssignToImplicitReturn(node);
 }