public object Clone()
        {
            TypePointer tp = new TypePointer();

            tp.ObjectInstance = this.ObjectInstance;
            tp.Owner          = this.Owner;
            return(tp);
        }
        public bool IsSameObjectRef(IObjectIdentity objectPointer)
        {
            TypePointer tp = objectPointer as TypePointer;

            if (tp == null)
            {
                DataTypePointer dp = objectPointer as DataTypePointer;
                if (dp != null)
                {
                    tp = dp.LibTypePointer;
                }
            }
            if (tp != null)
            {
                Type t1 = this.ObjectInstance as Type;
                Type t2 = tp.ObjectInstance as Type;
                if (t1 != null && t2 != null)
                {
                    return(t1.Equals(t2));
                }
            }

            return(false);
        }
 public ListTypePointer(TypePointer type)
     : base(type)
 {
 }
 public CollectionTypePointer(TypePointer type, Type collectionType)
     : base(type)
 {
     _collectionType = collectionType;
 }
 public CollectionTypePointer(TypePointer type)
     : base(type)
 {
 }
Ejemplo n.º 6
0
 public static bool CheckAction(IAction act, Form caller)
 {
     if (act == null)
     {
         return(true);
     }
     if (!act.IsValid || act.ActionMethod == null)
     {
         MessageBox.Show(caller, string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                               "The action is invalid. [{0}]", act.ActionName), "Select action", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
         return(false);
     }
     if (IsWebPage)
     {
         DataTypePointer dtp = act.MethodOwner as DataTypePointer;
         if (dtp != null)
         {
             return(true);
         }
         TypePointer tp = act.MethodOwner as TypePointer;
         if (tp != null)
         {
             return(true);
         }
         MethodInfoPointer mip = act.ActionMethod as MethodInfoPointer;
         if (mip != null)
         {
             if (mip.MethodDef != null)
             {
                 object[] vs = mip.MethodDef.GetCustomAttributes(typeof(StandaloneOnlyActionAttribute), true);
                 if (vs != null && vs.Length > 0)
                 {
                     MessageBox.Show(caller, string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                           "Action [{0}] cannot be used inside a method. Consider assigning it directly to an event.", act.ActionName), "Select action", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                     return(false);
                 }
             }
         }
         if (UseClientExecuterOnly)
         {
             if (act.ActionMethod.RunAt == EnumWebRunAt.Server)
             {
                 MessageBox.Show(caller, string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                       "Cannot use action executed by server object. Action:[{0}]", act.ActionName), "Select action", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 return(false);
             }
         }
         if (UseServerExecuterOnly)
         {
             if (act.ActionMethod.RunAt == EnumWebRunAt.Client)
             {
                 MessageBox.Show(caller, string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                       "Cannot use an action executed by client object. [{0}]", act.ActionName), "Select action", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                 return(false);
             }
         }
         if (UseClientPropertyOnly)
         {
             IList <ISourceValuePointer> lst0 = act.GetServerProperties(0);
             if (lst0 != null && lst0.Count > 0)
             {
                 List <ISourceValuePointer> lst = new List <ISourceValuePointer>();
                 foreach (ISourceValuePointer v in lst0)
                 {
                     if (v.IsWebServerValue())
                     {
                         lst.Add(v);
                     }
                 }
                 if (lst.Count > 0)
                 {
                     StringBuilder sb = new StringBuilder(lst[0].ToString());
                     for (int i = 1; i < lst.Count; i++)
                     {
                         sb.Append(",");
                         sb.Append(lst[i].ToString());
                     }
                     MessageBox.Show(caller, string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                           "Cannot use an action involving server values. Action:[{0}] Server value(s):{1}", act.ActionName, sb.ToString()), "Select action", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                     return(false);
                 }
             }
         }
         if (UseServerPropertyOnly)
         {
             IList <ISourceValuePointer> lst0 = act.GetClientProperties(0);
             if (lst0 != null && lst0.Count > 0)
             {
                 List <ISourceValuePointer> lst = new List <ISourceValuePointer>();
                 foreach (ISourceValuePointer v in lst0)
                 {
                     if (v.IsWebClientValue())
                     {
                         lst.Add(v);
                     }
                 }
                 if (lst.Count > 0)
                 {
                     StringBuilder sb = new StringBuilder(lst[0].ToString());
                     for (int i = 1; i < lst.Count; i++)
                     {
                         sb.Append(",");
                         sb.Append(lst[i].ToString());
                     }
                     MessageBox.Show(caller, string.Format(System.Globalization.CultureInfo.InvariantCulture,
                                                           "Cannot use an action involving client values. Action:[{0}] Client value(s):{1}", act.ActionName, sb.ToString()), "Select action", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                     return(false);
                 }
             }
         }
     }
     return(true);
 }
 public WrapDataTypePointer(TypePointer type)
     : base(type)
 {
 }
Ejemplo n.º 8
0
 public TypeOfPointer(TypePointer t)
     : base(t)
 {
 }
Ejemplo n.º 9
0
 public NullObjectPointer(TypePointer type)
     : base(type)
 {
 }
 public ArrayPointer(TypePointer type)
     : base(type)
 {
 }
 public NamedDataType(TypePointer type, string name)
     : this(type)
 {
     _name = name;
 }
 public NamedDataType(TypePointer type)
     : base(type)
 {
 }
 public ParameterClass(TypePointer type, string name, IMethod method)
     : base(type, name)
 {
     _method      = method;
     TypeChanged += new EventHandler(ParameterDef_OnTypeChange);
 }