Esempio n. 1
0
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            var inst = context.Instance;

            if (!(inst is FileConvertParameter))
            {
                var res = context.GetType().GetProperty("Parent");
                if (res != null)
                {
                    var con = res.GetValue(context) as System.ComponentModel.ITypeDescriptorContext;
                    inst = con.Instance;
                }
            }

            if (inst is FileConvertParameter)
            {
                var para = inst as FileConvertParameter;
                var fp   = new FormPlayer();
                if (fp.cropStart(para.fileName))
                {
                    return(JsonConvert.DeserializeObject(fp.getSelectedRectStr(), value.GetType()));
                }
            }

            return(value);
        }
Esempio n. 2
0
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, System.IServiceProvider provider, object value)
        {
            var inst = context.Instance;

            if (!(inst is FileConvertParameter))
            {
                var res = context.GetType().GetProperty("Parent");
                if (res != null)
                {
                    var con = res.GetValue(context) as System.ComponentModel.ITypeDescriptorContext;
                    inst = con.Instance;
                }
            }

            if (inst is FileConvertParameter)
            {
                var para = inst as FileConvertParameter;
                var fp   = new FormPlayer();
                if (fp.cropStart(para.fileName))
                {
                    return(JsonConvert.DeserializeObject(fp.getSelectedRectStr(), value.GetType()));
                }
            }


            var grid = context.getGrid();

            if (grid != null && grid.Tag is List <FFmpeg> )
            {
                var para = grid.Tag as List <FFmpeg>;
                if (para.Count < 1)
                {
                    throw new ExceptionFFmpeg(dfv.lang.dat.HaveToAddFile);
                }
                var fp = new FormPlayer();
                if (fp.cropStart(para[0].fileName))
                {
                    return(JsonConvert.DeserializeObject(fp.getSelectedRectStr(), value.GetType()));
                }
            }

            return(value);
        }