コード例 #1
0
ファイル: MarginView.xaml.cs プロジェクト: wonrst/TizenFX
        public void SetView(IObjectView view)
        {
            if (!(view is View))
            {
                return;
            }

            if (controlView == view as ObjectView)
            {
                return;
            }

            controlView = view as ObjectView;

            // Margin
            marginStart.Text  = controlView.Margin.Start.ToString();
            marginEnd.Text    = controlView.Margin.End.ToString();
            marginTop.Text    = controlView.Margin.Top.ToString();
            marginBottom.Text = controlView.Margin.Bottom.ToString();

            controlView.MarginChanged += (object sender, MarginChangedEventArgs args) =>
            {
                marginStart.Text  = args.Margin.Start.ToString();
                marginEnd.Text    = args.Margin.End.ToString();
                marginTop.Text    = args.Margin.Top.ToString();
                marginBottom.Text = args.Margin.Bottom.ToString();

                controlView.Layout?.RequestLayout();
            };

            controlView.Layout?.RequestLayout();
        }
コード例 #2
0
        public void SetView(IObjectView view)
        {
            if (!(view is View))
            {
                return;
            }

            if (controlView == view as ObjectView)
            {
                return;
            }

            controlView = view as ObjectView;

            // Padding
            paddingStart.Text  = controlView.Padding.Start.ToString();
            paddingEnd.Text    = controlView.Padding.End.ToString();
            paddingTop.Text    = controlView.Padding.Top.ToString();
            paddingBottom.Text = controlView.Padding.Bottom.ToString();

            controlView.PaddingChanged += (object sender, PaddingChangedEventArgs args) =>
            {
                paddingStart.Text  = args.Padding.Start.ToString();
                paddingEnd.Text    = args.Padding.End.ToString();
                paddingTop.Text    = args.Padding.Top.ToString();
                paddingBottom.Text = args.Padding.Bottom.ToString();

                controlView.Layout?.RequestLayout();
            };

            controlView.Layout?.RequestLayout();
        }
コード例 #3
0
        public void SetView(IObjectView view)
        {
            if (!(view is View))
            {
                return;
            }

            if (objectView == view as ObjectView)
            {
                return;
            }

            objectView = view as ObjectView;

            linearLayoutControlView.SetLayout(objectView.Layout as IObjectLayout);

            objectControlView.SetView(objectView);

            var parent = objectView.GetParent() as ObjectView;

            if (parent == null)
            {
                removeViewButton.IsEnabled = false;
            }
            else
            {
                removeViewButton.IsEnabled = true;
            }
        }
コード例 #4
0
        public void SetView(IObjectView view)
        {
            if (!(view is View))
            {
                return;
            }

            if (controlView == view as ObjectView)
            {
                return;
            }

            controlView = view as ObjectView;

            // WidthSpecification
            widthSpec.SetView(controlView);

            // HeightSpecification
            heightSpec.SetView(controlView);

            // Margin
            margin.SetView(controlView);

            // Padding
            padding.SetView(controlView);
        }
コード例 #5
0
 internal ObjectViewListener(IObjectView view, IList list, object dataSource)
 {
     this._viewWeak   = new WeakReference((object)view);
     this._dataSource = dataSource;
     this._list       = list;
     this.RegisterCollectionEvents();
     this.RegisterEntityEvents();
 }
コード例 #6
0
        internal ObjectViewListener(IObjectView view, IList list, object dataSource)
        {
            _viewWeak = new WeakReference(view);
            _dataSource = dataSource;
            _list = list;

            RegisterCollectionEvents();
            RegisterEntityEvents();
        }
コード例 #7
0
        internal ObjectViewListener(IObjectView view, IList list, object dataSource)
        {
            _viewWeak   = new WeakReference(view);
            _dataSource = dataSource;
            _list       = list;

            RegisterCollectionEvents();
            RegisterEntityEvents();
        }
コード例 #8
0
    public override string GetObject(IObjectView o)
    {
        if (o == null)
        {
            return(base.GetObject(o));
        }

        var url = string.Format("http://localhost:8080/object/{0}", o.GetObjectNo());

        return(string.Format("<a href=\"{0}\">{1}</a>", url, o.GetObjectNo()));
    }
コード例 #9
0
        private void CollectionChanged(object sender, CollectionChangeEventArgs e)
        {
            IObjectView target = (IObjectView)this._viewWeak.Target;

            if (target != null)
            {
                target.CollectionChanged(sender, e);
            }
            else
            {
                this.CleanUpListener();
            }
        }
コード例 #10
0
        private void EntityPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            IObjectView target = (IObjectView)this._viewWeak.Target;

            if (target != null)
            {
                target.EntityPropertyChanged(sender, e);
            }
            else
            {
                this.CleanUpListener();
            }
        }
コード例 #11
0
        private void EntityPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            IObjectView view = (IObjectView)_viewWeak.Target;

            if (view != null)
            {
                view.EntityPropertyChanged(sender, e);
            }
            else
            {
                CleanUpListener();
            }
        }
コード例 #12
0
        private void CollectionChanged(object sender, CollectionChangeEventArgs e)
        {
            IObjectView view = (IObjectView)_viewWeak.Target;

            if (view != null)
            {
                view.CollectionChanged(sender, e);
            }
            else
            {
                CleanUpListener();
            }
        }
コード例 #13
0
        public void SetView(IObjectView view)
        {
            if (!(view is View))
            {
                return;
            }

            if (controlView == view as ObjectView)
            {
                return;
            }

            controlView = view as ObjectView;

            // WidthSpecification
            if (controlView.WidthSpecification == LayoutParamPolicies.MatchParent)
            {
                widthSpecMatchParent.IsSelected = true;
            }
            else if (controlView.WidthSpecification == LayoutParamPolicies.WrapContent)
            {
                widthSpecWrapContent.IsSelected = true;
            }
            else
            {
                widthSpecValueField.Text  = controlView.WidthSpecification.ToString();
                widthSpecValue.IsSelected = true;
            }

            controlView.WidthSpecificationChanged += (object sender, WidthSpecificationChangedEventArgs args) =>
            {
                if (args.WidthSpecification == LayoutParamPolicies.MatchParent)
                {
                    widthSpecMatchParent.IsSelected = true;
                }
                else if (args.WidthSpecification == LayoutParamPolicies.WrapContent)
                {
                    widthSpecWrapContent.IsSelected = true;
                }
                else
                {
                    widthSpecValueField.Text  = controlView.WidthSpecification.ToString();
                    widthSpecValue.IsSelected = true;
                }

                (controlView.Layout)?.RequestLayout();
            };

            (controlView.Layout)?.RequestLayout();
        }
コード例 #14
0
    public void BindView(IObjectView view)
    {
        objView = view;
        var type = view.GetType();
        //if (type == typeof(EffectView))
        //{
        //    viewType = ViewType.Effect;
        //}
        //else if (type == typeof(BulletView))
        //{
        //    viewType = ViewType.Bullet;
        //}
        var _objView = objView as ObjectView;

        _objView.viewObject = this;
        _objView.gameObject = gameObject;
    }
コード例 #15
0
        public void BindView(IObjectView view)
        {
            objView = view;
            var type = view.GetType();

            if (type == typeof(EffectView))
            {
                viewType = ViewType.Effect;
            }
            else if (type == typeof(BulletView))
            {
                viewType = ViewType.Bullet;
            }
            var _objView = objView as ObjectView;

            _objView.viewObject = this;
            _objView.transform  = transform;
            _objView.gameObject = gameObject;
        }
コード例 #16
0
ファイル: TypeAccessor.cs プロジェクト: epdumitru/mysqlib
        public PropertyDescriptorCollection CreateExtendedPropertyDescriptors(
            Type objectViewType,
            IsNullHandler isNull)
        {
            // This is definitely wrong.
            //
            //if (isNull == null)
            //	isNull = _isNull;

            PropertyDescriptorCollection pdc;

            pdc = CreatePropertyDescriptors();

            if (objectViewType != null)
            {
                TypeAccessor viewAccessor      = GetAccessor(objectViewType);
                IObjectView  objectView        = (IObjectView)viewAccessor.CreateInstanceEx();
                List <PropertyDescriptor> list = new List <PropertyDescriptor>();

                PropertyDescriptorCollection viewpdc = viewAccessor.PropertyDescriptors;

                foreach (PropertyDescriptor pd in viewpdc)
                {
                    list.Add(new ObjectViewPropertyDescriptor(pd, objectView));
                }

                foreach (PropertyDescriptor pd in pdc)
                {
                    if (viewpdc.Find(pd.Name, false) == null)
                    {
                        list.Add(pd);
                    }
                }

                pdc = new PropertyDescriptorCollection(list.ToArray());
            }

            pdc = pdc.Sort(new PropertyDescriptorComparer());

            pdc = GetExtendedProperties(pdc, OriginalType, String.Empty, Type.EmptyTypes, new PropertyDescriptor[0], isNull);

            return(pdc);
        }
コード例 #17
0
ファイル: TypeAccessor.cs プロジェクト: epdumitru/mysqlib
 public ObjectViewPropertyDescriptor(PropertyDescriptor pd, IObjectView objectView)
     : base(pd)
 {
     _objectView = objectView;
 }
コード例 #18
0
ファイル: ObjectModel.cs プロジェクト: Seth-W/EcoTile
 /**
  *<summary>
  * Uses UnityEngine.GetComponent to assign this gameObject's View and Controller components
  * to the <see cref="control"/> and <see cref="view"/> fields in an ObjectModel
  *</summary>
  */
 protected void assign_MVC_components()
 {
     control = GetComponent <IObjectControl>();
     view    = GetComponent <IObjectView>();
 }
コード例 #19
0
ファイル: Utilities.cs プロジェクト: k-rus/ScSqlTestFramework
 internal static String GetObjectIdString(IObjectView obj)
 {
     UInt64 uintObjectId = DbHelper.GetObjectNo(obj);
     return uintObjectId.ToString();
 }
コード例 #20
0
ファイル: Utilities.cs プロジェクト: k-rus/ScSqlTestFramework
        // From class Starcounter.Db. Added CultureInfo.InvariantCulture and NumberFormatInfo.InvariantInfo.
        internal static String CreateObjectString(ITypeBinding typeBind, IObjectView currentObj)
        {
            IPropertyBinding propBind = null;
            String result = FieldSeparator;
            for (Int32 i = 0; i < typeBind.PropertyCount; i++)
            {
                propBind = typeBind.GetPropertyBinding(i);
                switch (propBind.TypeCode)
                {
                    case DbTypeCode.Binary:
                        Nullable<Binary> binValue = currentObj.GetBinary(i);
                        if (binValue == null)
                            result += Db.NullString;
                        else
                            result += BinaryToHex(binValue.Value);
                        break;

                    case DbTypeCode.Boolean:
                        Nullable<Boolean> blnValue = currentObj.GetBoolean(i);
                        if (blnValue == null)
                            result += Db.NullString;
                        else
                            result += blnValue.Value.ToString();
                        break;

                    case DbTypeCode.Byte:
                        Nullable<Byte> byteValue = currentObj.GetByte(i);
                        if (byteValue == null)
                            result += Db.NullString;
                        else
                            result += byteValue.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.DateTime:
                        Nullable<DateTime> dtmValue = currentObj.GetDateTime(i);
                        if (dtmValue == null)
                            result += Db.NullString;
                        else
                            result += dtmValue.Value.ToString("u", DateTimeFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.Decimal:
                        Nullable<Decimal> decValue = currentObj.GetDecimal(i);
                        if (decValue == null)
                            result += Db.NullString;
                        else
                            result += decValue.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.Double:
                        Nullable<Double> dblValue = currentObj.GetDouble(i);
                        if (dblValue == null)
                            result += Db.NullString;
                        else
                            result += dblValue.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.Int16:
                        Nullable<Int16> int16Value = currentObj.GetInt16(i);
                        if (int16Value == null)
                            result += Db.NullString;
                        else
                            result += int16Value.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.Int32:
                        Nullable<Int32> int32Value = currentObj.GetInt32(i);
                        if (int32Value == null)
                            result += Db.NullString;
                        else
                            result += int32Value.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.Int64:
                        Nullable<Int64> int64Value = currentObj.GetInt64(i);
                        if (int64Value == null)
                            result += Db.NullString;
                        else
                            result += int64Value.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.Object:
                        IObjectView objValue = currentObj.GetObject(i);
                        if (objValue == null)
                            result += Db.NullString;
                        else
                        {
                            if (objValue is IObjectProxy)
                                //result += DbHelper.GetObjectID(objValue as Entity).ToString();
                                result += Utilities.GetObjectIdString(objValue);
                            else
                                result += objValue.ToString();
                        }
                        break;

                    case DbTypeCode.SByte:
                        Nullable<SByte> sbyteValue = currentObj.GetSByte(i);
                        if (sbyteValue == null)
                            result += Db.NullString;
                        else
                            result += sbyteValue.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.Single:
                        Nullable<Single> sngValue = currentObj.GetSingle(i);
                        if (sngValue == null)
                            result += Db.NullString;
                        else
                            result += sngValue.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.String:
                        String strValue = currentObj.GetString(i);
                        if (strValue == null)
                            result += Db.NullString;
                        else
                            result += strValue;
                        break;

                    case DbTypeCode.UInt16:
                        Nullable<UInt16> uint16Value = currentObj.GetUInt16(i);
                        if (uint16Value == null)
                            result += Db.NullString;
                        else
                            result += uint16Value.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.UInt32:
                        Nullable<UInt32> uint32Value = currentObj.GetUInt32(i);
                        if (uint32Value == null)
                            result += Db.NullString;
                        else
                            result += uint32Value.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    case DbTypeCode.UInt64:
                        Nullable<UInt64> uint64Value = currentObj.GetUInt64(i);
                        if (uint64Value == null)
                            result += Db.NullString.ToString(NumberFormatInfo.InvariantInfo);
                        else
                            result += uint64Value.Value.ToString(NumberFormatInfo.InvariantInfo);
                        break;

                    default:
                        throw new Exception("Incorrect TypeCode: " + propBind.TypeCode);
                }
                result += FieldSeparator;
            }
            return result;
        }