Esempio n. 1
0
 public PropertyDescriptorNewDataTransfer(MethodDataTransfer dt)
     : base("NewDataTransfer", new Attribute[] { new EditorAttribute(typeof(TypeSelectorNewDataTrabsfer), typeof(UITypeEditor)),
                                                 new ParenthesizePropertyNameAttribute(true),
                                                 new RefreshPropertiesAttribute(RefreshProperties.All) })
 {
     _owner = dt;
 }
Esempio n. 2
0
        public bool IsSameMethod(IMethodPointer pointer)
        {
            MethodDataTransfer m = pointer as MethodDataTransfer;

            if (m != null)
            {
                return(m.ID == this.ID);
            }
            return(false);
        }
Esempio n. 3
0
        public bool IsSameObjectRef(IObjectIdentity objectIdentity)
        {
            MethodDataTransfer m = objectIdentity as MethodDataTransfer;

            if (m != null)
            {
                return(m.ID == this.ID);
            }
            return(false);
        }
Esempio n. 4
0
        public bool IsSameMethod(IMethod method)
        {
            MethodDataTransfer m = method as MethodDataTransfer;

            if (m != null)
            {
                return(m.ID == this.ID);
            }
            return(false);
        }
Esempio n. 5
0
 public void CreatePhpScript(StringCollection sb, StringCollection parameters, string returnReceiver)
 {
     if (_dataTransfers != null)
     {
         foreach (KeyValuePair <IProperty, ParameterValue> kv in _dataTransfers)
         {
             if (kv.Value != null && kv.Key != null)
             {
                 MethodDataTransfer.CreatePhpScript(kv.Key, kv.Value.GetPhpScriptReferenceCode(sb), sb, parameters);
             }
         }
     }
 }
Esempio n. 6
0
 public void Compile(ActionBranch currentAction, ActionBranch nextAction, ILimnorCodeCompiler compiler, IMethodCompile methodToCompile, CodeMemberMethod method, CodeStatementCollection statements, CodeExpressionCollection parameters, IObjectPointer returnReceiver, bool debug)
 {
     if (_dataTransfers != null)
     {
         foreach (KeyValuePair <IProperty, ParameterValue> kv in _dataTransfers)
         {
             if (kv.Value != null && kv.Key != null)
             {
                 MethodDataTransfer.Compile(kv.Key, kv.Value.GetReferenceCode(methodToCompile, statements, true), currentAction, nextAction, compiler, methodToCompile, method, statements, parameters, returnReceiver, debug);
             }
         }
     }
 }
Esempio n. 7
0
 public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context != null && context.Instance != null && provider != null)
     {
         IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
         if (edSvc != null)
         {
             MethodDataTransfer mdt = context.Instance as MethodDataTransfer;
             if (mdt == null)
             {
                 IAction act = context.Instance as IAction;
                 if (act != null)
                 {
                     mdt = act.ActionMethod as MethodDataTransfer;
                 }
             }
             if (mdt != null)
             {
                 FrmObjectExplorer dlg = DesignUtil.GetPropertySelector(null, mdt.Action.ScopeMethod, null);
                 dlg.SetMultipleSelection(true);
                 dlg.ObjectSubType = EnumObjectSelectSubType.Property;
                 if (edSvc.ShowDialog(dlg) == System.Windows.Forms.DialogResult.OK)
                 {
                     if (dlg.SelectedProperties != null)
                     {
                         foreach (IProperty p in dlg.SelectedProperties)
                         {
                             mdt.AddProperty(p);
                         }
                         PropertyGrid pg   = null;
                         Type         t    = edSvc.GetType();
                         PropertyInfo pif0 = t.GetProperty("OwnerGrid");
                         if (pif0 != null)
                         {
                             object g = pif0.GetValue(edSvc, null);
                             pg = g as PropertyGrid;
                         }
                         if (pg != null && pg.SelectedGridItem != null)
                         {
                             pg.SelectedGridItem.Expanded = true;
                         }
                         mdt.OnChanged();
                         return(true);
                     }
                 }
             }
         }
     }
     return(string.Empty);
 }
Esempio n. 8
0
        public object Clone()
        {
            MethodDataTransfer obj = new MethodDataTransfer(_rootClass);

            if (_dataTransfers != null)
            {
                Dictionary <IProperty, ParameterValue> ps = new Dictionary <IProperty, ParameterValue>();
                obj._dataTransfers = ps;
                foreach (KeyValuePair <IProperty, ParameterValue> kv in _dataTransfers)
                {
                    ps.Add(kv.Key, kv.Value);
                }
            }
            obj.ModuleProject = this.ModuleProject;
            obj.ClassId       = this.ClassId;
            obj.ID            = this.ID;
            obj.ActionId      = this.ActionId;
            obj.Action        = this.Action;
            return(obj);
        }
Esempio n. 9
0
 public PropertyDescriptorDataTransferMethod(MethodDataTransfer dataTransfer)
     : base("DataTransferList", new Attribute[] { new TypeConverterAttribute(typeof(ExpandableObjectConverter)), new EditorAttribute(typeof(TypeSelectorNewDataTrabsfer), typeof(UITypeEditor)) })
 {
     _owner = dataTransfer;
 }
Esempio n. 10
0
 public PropertyDescriptorDataTransfer(MethodDataTransfer dt, IProperty property)
     : base(property.ExpressionDisplay, new Attribute[] { new EditorAttribute(typeof(SelectorEnumValueType), typeof(UITypeEditor)) })
 {
     _owner    = dt;
     _property = property;
 }