예제 #1
0
파일: IceProxy.cs 프로젝트: retahc/old-code
        bool IRemotingTypeInfo.CanCastTo(System.Type targetType, object o)
        {
            //      Console.WriteLine ("CanCastTo: " + targetType);

            // if this is a local servant, check it directly
            if (_realObject != null)
            {
                return(targetType.IsInstanceOfType(_realObject));
            }

            // check if the thing was created with a valid type
            if (targetType.IsInstanceOfType(o))
            {
                return(true);
            }

            // otherwise, perform the remote query if necessary
            string icename = IceUtil.TypeToIceName(targetType);

            if (_typeIds == null)
            {
                Ice.Object iob = o as Ice.Object;
                _typeIds = iob.ice_ids();
            }

            return(((IList)_typeIds).Contains(icename));
        }
예제 #2
0
        public string[] ice_ids()
        {
            ArrayList typenames = new ArrayList();
            Type      t         = this.GetType();

            while (t != typeof(Ice.Object))
            {
                typenames.Add(IceUtil.TypeToIceName(t));
                t = t.BaseType;
            }
            typenames.Add("::Ice::Object"); // blah.


            return((string[])typenames.ToArray(typeof(string)));
        }
예제 #3
0
 public string ice_id()
 {
     return(IceUtil.TypeToIceName(this.GetType()));
 }