public ResultViewerViewModel(IEzSbytServiceFunctionViewModel parent, ServiceResult data, FormatTypes formatType) : this()
        {
            if (parent == null)
            {
                throw new ArgumentNullException("Parent must be not null!");
            }
            _parent = parent;

            SelectedFormatType = formatType;
            _data = data;
            InitSource();
        }
예제 #2
0
        public virtual void Execute(object param)
        {
            IEzSbytServiceFunctionViewModel parent = param as IEzSbytServiceFunctionViewModel;

            if (parent == null)
            {
                throw new ArgumentException("Param is not IResultViewerViewModel");
            }

            EzSbyt.FormatTypes format;
            Enum.TryParse <EzSbyt.FormatTypes>(_Формат.Value, out format);

            var result = EzSbyt.EzSbytService.Instance.FuncRequest(this.FuncName, this.GetUrlParams(), this.GetEscapedBody());

            parent.Result = new ResultViewerViewModel(parent, result, format);
        }
        public override void Execute(object param)
        {
            IEzSbytServiceFunctionViewModel parent = param as IEzSbytServiceFunctionViewModel;

            if (parent == null)
            {
                throw new ArgumentException("Param is not IResultViewerViewModel");
            }

            TMP.Common.NetHelper.ServiceResult result = EzSbyt.EzSbytService.Instance.FuncRequest(this.FuncName, this.GetUrlParams(), this.GetEscapedBody());

            using (System.IO.MemoryStream stream = new System.IO.MemoryStream(result.ResultBytes))
            {
                Схема = BitmapFrame.Create(stream, BitmapCreateOptions.None, BitmapCacheOption.OnLoad);
            }
        }