当前位置: 首页>>代码示例>>C#>>正文


C# ScriptObject.ConvertTo方法代码示例

本文整理汇总了C#中ScriptObject.ConvertTo方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptObject.ConvertTo方法的具体用法?C# ScriptObject.ConvertTo怎么用?C# ScriptObject.ConvertTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ScriptObject的用法示例。


在下文中一共展示了ScriptObject.ConvertTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NavigateTo

 public void NavigateTo(string controlName, ScriptObject parameterList)
 {
     var paramList = parameterList.ConvertTo<List<object>>();
     var launcher = pageLaunchers[controlName];
     LayoutRoot.Children.Clear();
     var form = launcher(paramList);
     LayoutRoot.Children.Add(form);
 }
开发者ID:rbanks54,项目名称:RichardsSamples,代码行数:8,代码来源:NavigationControl.xaml.cs

示例2: ProcessPhotosCallback

 public void ProcessPhotosCallback(ScriptObject json)
 {
     OnPhotoCollectionCompleted(new PhotoCollectionEventArgs(json.ConvertTo<PhotoCollection>()));
 }
开发者ID:rmarinho,项目名称:ForestFindr,代码行数:4,代码来源:Panoramio.cs

示例3: readAsArrayBufferSync

        internal void readAsArrayBufferSync(ScriptObject scriptBlob)
        {
            Blob blob = scriptBlob.ConvertTo<Blob>();

            if (readyState == LOADING) {
                throw new OperationNotAllowedException();
            }
            try
            {
                ConstrainedStreamWrapper s = blob.GetStream();

                this.readyState = LOADING;
                if(this.onloadstart != null){
                    this.onloadstart(this,new ProgressEvent(0,s.Length));
                }

                byte[] buf = new byte[(int)s.Length];
                int bytesRead = 0;
                int offset = 0;
                s.Seek(0, SeekOrigin.Begin); //rewinding stream to read from the start
                while ((bytesRead = s.Read(buf, offset, 1024)) > 0)
                {
                    offset += bytesRead;
                    this.onprogress.FireAsync(this, new ProgressEvent(offset, s.Length));
                    //TODO: 6.4.5.2 violation! A .result should be populated with partial blob data while it's being read
                    //prolly methods, using this impl shoud subscribe to onprogress and modify result as we go
                }

                this.readyState = DONE;
                if (this.onloadend != null)
                {
                    this.onloadend.FireAsync(this, new ProgressEvent(offset, s.Length));
                }
                this.result = buf;
            }
            catch (Exception e) {
                this.readyState = DONE;
                this.result = null;
                switch (e.GetType().Name){
                    default:
                    case "IOException":
                        this.error = FileError.NOT_READABLE_ERR;
                    break;
                    case "FileNotFoundException":
                        this.error = FileError.NOT_FOUND_ERR;
                    break;
                    case "SecurityException":
                        this.error = FileError.SECURITY_ERR;
                    break;
                }
                if (this.onerror != null) {
                    this.onerror.FireAsync(this, null);
                }
                if (this.onloadend != null)
                {
                    this.onloadend.FireAsync(this, new ProgressEvent(0));
                }
                return;
            }
        }
开发者ID:synchrone,项目名称:NFileAPI,代码行数:60,代码来源:FileReader.cs


注:本文中的ScriptObject.ConvertTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。