• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# AssetRetrieved类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AssetRetrieved的典型用法代码示例。如果您正苦于以下问题:C# AssetRetrieved类的具体用法?C# AssetRetrieved怎么用?C# AssetRetrieved使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AssetRetrieved类属于命名空间,在下文中一共展示了AssetRetrieved类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Get

        public virtual bool Get(string id, Object sender, AssetRetrieved handler)
        {
            //m_log.DebugFormat("[AssetService]: Get asset async {0}", id);

            handler(id, sender, Get(id));

            return true;
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:8,代码来源:AssetService.cs


示例2: Get

 public void Get(string id, object sender, AssetRetrieved handler)
 {
     m_localService.Get(id, sender, delegate(string idd, object senderr, AssetBase asset)
     {
         if (asset == null)
             handler(id, sender, Get(id));
         else
             handler(id, sender, asset);
     });
 }
开发者ID:JAllard,项目名称:Aurora-Sim,代码行数:10,代码来源:IWCAssetConnector.cs


示例3: Get

        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
//            m_log.DebugFormat("[ASSET SERVICE CONNECTOR]: Potentially asynchronous get request for {0}", id);

            string uri = m_ServerURI + "/assets/" + id;

            AssetBase asset = null;
            if (m_Cache != null)
                asset = m_Cache.Get(id);

            if (asset == null)
            {
                lock (m_AssetHandlers)
                {
                    AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); });

                    AssetRetrievedEx handlers;
                    if (m_AssetHandlers.TryGetValue(id, out handlers))
                    {
                        // Someone else is already loading this asset. It will notify our handler when done.
                        handlers += handlerEx;
                        return true;
                    }

                    // Load the asset ourselves
                    handlers += handlerEx;
                    m_AssetHandlers.Add(id, handlers);
                }

                bool success = false;
                try
                {
                    AsynchronousRestObjectRequester.MakeRequest<int, AssetBase>("GET", uri, 0,
                        delegate(AssetBase a)
                        {
                            if (m_Cache != null)
                                m_Cache.Cache(a);

                            AssetRetrievedEx handlers;
                            lock (m_AssetHandlers)
                            {
                                handlers = m_AssetHandlers[id];
                                m_AssetHandlers.Remove(id);
                            }
                            handlers.Invoke(a);
                        }, 30);
                    
                    success = true;
                }
                finally
                {
                    if (!success)
                    {
                        lock (m_AssetHandlers)
                        {
                            m_AssetHandlers.Remove(id);
                        }
                    }
                }
            }
            else
            {
                handler(id, sender, asset);
            }

            return true;
        }
开发者ID:MAReantals,项目名称:opensim,代码行数:67,代码来源:AssetServicesConnector.cs


示例4: Get

        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
            string uri = m_ServerURI + "/assets/" + id;

            AssetBase asset = null;
            if (m_Cache != null)
                asset = m_Cache.Get(id);

            if (asset == null)
            {
                bool result = false;

                AsynchronousRestObjectRequester.
                        MakeRequest<int, AssetBase>("GET", uri, 0,
                        delegate(AssetBase a)
                        {
                            if (m_Cache != null)
                                m_Cache.Cache(a);
                            handler(id, sender, a);
                            result = true;
                        });

                return result;
            }
            else
            {
                //Util.FireAndForget(delegate { handler(id, sender, asset); });
                handler(id, sender, asset);
            }

            return true;
        }
开发者ID:AlexRa,项目名称:opensim-mods-Alex,代码行数:32,代码来源:AssetServiceConnector.cs


示例5: Get

 public override void Get(string id, object sender, AssetRetrieved handler)
 {
     base.Get(id, sender, handler);
 }
开发者ID:JAllard,项目名称:HyperGrid,代码行数:4,代码来源:HGAssetService.cs


示例6: Get

 public bool Get(string id, object sender, AssetRetrieved handler)
 {
     handler(id, sender, Get(id));
     
     return true;
 }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:6,代码来源:TestAssetService.cs


示例7: Get

        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
            AssetBase asset = null;
            
            if (m_Cache != null)
                m_Cache.Get(id);

            if (asset != null)
            {
                Util.FireAndForget(delegate { handler(id, sender, asset); });
                return true;
            }

            return m_AssetService.Get(id, sender, delegate (string assetID, Object s, AssetBase a)
            {
                if ((a != null) && (m_Cache != null))
                    m_Cache.Cache(a);

                Util.FireAndForget(delegate { handler(assetID, s, a); });
            });
        }
开发者ID:dirkhusemann,项目名称:opensim,代码行数:21,代码来源:LocalAssetServiceConnector.cs


示例8: Get

 public bool Get(string id, object sender, AssetRetrieved handler)
 {
     throw new NotImplementedException();
 }
开发者ID:ChrisD,项目名称:opensim,代码行数:4,代码来源:TestAssetService.cs


示例9: Get

        public override bool Get(string id, Object sender, AssetRetrieved handler)
        {
            AssetBase asset = null;

            if (m_Cache != null)
                asset = m_Cache.Get(id);

            if (asset != null)
            {
                Util.FireAndForget(delegate { handler(id, sender, asset); });
                return true;
            }

            if (IsHG(id))
            {
                string url = string.Empty;
                string assetID = string.Empty;

                if (StringToUrlAndAssetID(id, out url, out assetID))
                {
                    IAssetService connector = GetConnector(url);
                    return connector.Get(assetID, sender, delegate(string newAssetID, Object s, AssetBase a)
                    {
                        if (m_Cache != null)
                            m_Cache.Cache(a);
                        handler(assetID, s, a);
                    });
                }
                return false;
            }
            else
            {
                return base.Get(id, sender, delegate(string assetID, Object s, AssetBase a)
                {
                    if (m_Cache != null)
                        m_Cache.Cache(a);
                    handler(assetID, s, a);
                });
            }
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:40,代码来源:HGAssetServiceConnector.cs


示例10: Get

        public override bool Get(string id, object sender, AssetRetrieved handler)
        {
            string url = string.Empty;
            string assetID = string.Empty;

            if (StringToUrlAndAssetID (id, out url, out assetID))
            {
                IAssetService connector = GetConnector (url);
                return connector.Get (assetID, sender, handler);
            }
            return base.Get (id, sender, handler);
        }
开发者ID:EnricoNirvana,项目名称:Aurora-HG-Plugin,代码行数:12,代码来源:HGAssetService.cs


示例11: Get

        public virtual bool Get(String id, Object sender, AssetRetrieved handler)
        {
            //MainConsole.Instance.DebugFormat("[AssetService]: Get asset async {0}", id);

            AssetBase asset = m_database.GetAsset(UUID.Parse(id));
            IImprovedAssetCache cache = m_registry.RequestModuleInterface<IImprovedAssetCache>();
            if (cache != null && asset != null && asset.Data.Length != 0)
                cache.Cache(asset);

            //MainConsole.Instance.DebugFormat("[AssetService]: Got asset {0}", asset);

            handler(id, sender, asset);

            return true;
        }
开发者ID:satlanski2,项目名称:Aurora-Sim,代码行数:15,代码来源:AssetService.cs


示例12: Get

        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
            string uri = MapServer(id) + "/assets/" + id;

            AssetBase asset = null;
            if (m_Cache != null)
                asset = m_Cache.Get(id);

            if (asset == null || asset.Data == null || asset.Data.Length == 0)
            {
                lock (m_AssetHandlers)
                {
                    AssetRetrievedEx handlerEx = new AssetRetrievedEx(delegate(AssetBase _asset) { handler(id, sender, _asset); });

//                    AssetRetrievedEx handlers;
                    List<AssetRetrievedEx> handlers;
                    if (m_AssetHandlers.TryGetValue(id, out handlers))
                    {
                        // Someone else is already loading this asset. It will notify our handler when done.
//                        handlers += handlerEx;
                        handlers.Add(handlerEx);
                        return true;
                    }

                    // Load the asset ourselves
//                    handlers += handlerEx;
                    handlers = new List<AssetRetrievedEx>();
                    handlers.Add(handlerEx);

                    m_AssetHandlers.Add(id, handlers);
                }

                QueuedAssetRequest request = new QueuedAssetRequest();
                request.id = id;
                request.uri = uri;

                m_requestQueue.Enqueue(request);
            }
            else
            {
                handler(id, sender, asset);
            }

            return true;
        }
开发者ID:TomDataworks,项目名称:opensim,代码行数:45,代码来源:AssetServicesConnector.cs


示例13: Get

        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
            AssetBase asset = null;
            
            if (m_Cache != null)
                m_Cache.Get(id);

            if (asset != null)
            {
                handler.BeginInvoke(id, sender, asset, null, null);
                return true;
            }

            return m_AssetService.Get(id, sender, delegate (string assetID, Object s, AssetBase a)
            {
                if ((a != null) && (m_Cache != null))
                    m_Cache.Cache(a);
                
                handler.BeginInvoke(assetID, s, a, null, null);
            });
        }
开发者ID:ChrisD,项目名称:opensim,代码行数:21,代码来源:LocalAssetServiceConnector.cs


示例14: Get

 public virtual void Get (string id, object sender, AssetRetrieved handler)
 {
     var asset = Get (id);
     if (asset != null) {
         Util.FireAndForget ((o) => {handler (id, sender, asset);});
         //asset.Dispose ();
     }
 }
开发者ID:Virtual-Universe,项目名称:Virtual-Universe,代码行数:8,代码来源:FileBasedAssetService.cs


示例15: Get

        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
//            m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Asynchronously requesting asset {0}", id);
                                    
            if (m_Cache != null)
            {
                AssetBase asset = m_Cache.Get(id);

                if (asset != null)
                {
                    Util.FireAndForget(
                        o => handler(id, sender, asset), null, "LocalAssetServiceConnector.GotFromCacheCallback");
                    return true;
                }
            }

            return m_AssetService.Get(id, sender, delegate (string assetID, Object s, AssetBase a)
            {
                if ((a != null) && (m_Cache != null))
                    m_Cache.Cache(a);

//                if (null == a)
//                    m_log.WarnFormat("[LOCAL ASSET SERVICES CONNECTOR]: Could not asynchronously find asset with id {0}", id);

                Util.FireAndForget(
                    o => handler(assetID, s, a), null, "LocalAssetServiceConnector.GotFromServiceCallback");
            });
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:28,代码来源:LocalAssetServiceConnector.cs


示例16: Get

        public virtual bool Get(string id, Object sender, AssetRetrieved handler)
        {
            List<string> serverURIs = m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf("AssetServerURI");
            if (m_serverURL != string.Empty)
                serverURIs = new List<string>(new string[1] { m_serverURL });
            foreach (string m_ServerURI in serverURIs)
            {
                string uri = m_ServerURI + "/" + id;

                AssetBase asset = null;
                if (m_Cache != null)
                    asset = m_Cache.Get(id);

                if (asset == null)
                {
                    bool result = false;

                    AsynchronousRestObjectRequester.
                            MakeRequest<int, AssetBase>("GET", uri, 0,
                            delegate(AssetBase a)
                            {
                                if (m_Cache != null)
                                    m_Cache.Cache(a);
                                handler(id, sender, a);
                                result = true;
                            });

                    if (result)
                        return result;
                }
                else
                {
                    handler(id, sender, asset);
                    return true;
                }
            }

            return false;
        }
开发者ID:chazzmac,项目名称:Aurora-Sim,代码行数:39,代码来源:AssetServiceConnector.cs


示例17: Get

        /// <summary>
        /// Get an asset asynchronously
        /// </summary>
        /// <param name="id">The asset id</param>
        /// <param name="sender">Represents the requester.  Passed back via the handler</param>
        /// <param name="handler">The handler to call back once the asset has been retrieved</param>
        /// <returns>True if the id was parseable, false otherwise</returns>
        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
            Util.FireAndForget(
                delegate(object o)
                {
                    AssetBase asset = Get(id);
                    handler(id, sender, asset);
                }
            );

            return true;
        }
开发者ID:dreamerc,项目名称:diva-distribution,代码行数:19,代码来源:SimianAssetServiceConnector.cs


示例18: Get

        /// <summary>
        /// Get an asset asynchronously
        /// </summary>
        /// <param name="id">The asset id</param>
        /// <param name="sender">Represents the requester.  Passed back via the handler</param>
        /// <param name="handler">The handler to call back once the asset has been retrieved</param>
        /// <returns>True if the id was parseable, false otherwise</returns>
        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
            // Cache fetch
            if (m_cache != null)
            {
                AssetBase asset = m_cache.Get(id);
                if (asset != null)
                {
                    handler(id, sender, asset);
                    return true;
                }
            }

            Util.FireAndForget(
                delegate(object o)
                {
                    AssetBase asset = GetRemote(id);
                    handler(id, sender, asset);
                }
            );

            return true;
        }
开发者ID:AlexRa,项目名称:opensim-mods-Alex,代码行数:30,代码来源:SimianAssetServiceConnector.cs


示例19: Get

        public virtual bool Get(string id, Object sender, AssetRetrieved handler)
        {
            //m_log.DebugFormat("[XASSET SERVICE]: Get asset async {0}", id);
            
            UUID assetID;

            if (!UUID.TryParse(id, out assetID))
                return false;

            AssetBase asset = Get(id);

            //m_log.DebugFormat("[XASSET SERVICE]: Got asset {0}", asset);
            
            handler(id, sender, asset);

            return true;
        }
开发者ID:hippie-b,项目名称:opensim,代码行数:17,代码来源:XAssetService.cs


示例20: Get

        public bool Get(string id, Object sender, AssetRetrieved handler)
        {
            //m_log.DebugFormat("[AssetService]: Get asset async {0}", id);

            AssetBase asset = m_Database.GetAsset (id);
            IImprovedAssetCache cache = m_registry.RequestModuleInterface<IImprovedAssetCache> ();
            if (cache != null && asset != null)
                cache.Cache (asset);

            //m_log.DebugFormat("[AssetService]: Got asset {0}", asset);
            
            handler(id, sender, asset);

            return true;
        }
开发者ID:RevolutionSmythe,项目名称:Aurora-Sim,代码行数:15,代码来源:AssetService.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# AssetType类代码示例发布时间:2022-05-24
下一篇:
C# AssetManager类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap