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

C# IStorage类代码示例

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

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



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

示例1: RecordingStorage

        public RecordingStorage(IStorage storage)
        {
            _innerStorage = storage;

            Loaded = new HashSet<Uri>();
            Saved = new HashSet<Uri>();
        }
开发者ID:NuGet,项目名称:NuGet.Services.Metadata,代码行数:7,代码来源:RecordingStorage.cs


示例2: CreateSaveOperationForItem

        protected override ResourceSaveOperation CreateSaveOperationForItem(IStorage storage, CatalogContext context, CatalogItem item, CancellationToken cancellationToken)
        {
            // This method decides what to do with the item.
            // If it's a RegistrationMakerCatalogItem and it already exists, then don't write content.
            var registrationMakerCatalogItem = item as RegistrationMakerCatalogItem;
            if (registrationMakerCatalogItem != null)
            {
                var content = item.CreateContent(Context); // note: always do this first
                var resourceUri = item.GetItemAddress();

                var saveOperation = new ResourceSaveOperation();
                saveOperation.ResourceUri = resourceUri;

                if (!registrationMakerCatalogItem.IsExistingItem && content != null)
                {
                    saveOperation.SaveTask = storage.Save(resourceUri, content, cancellationToken);
                }
                else
                {
                    Trace.WriteLine(string.Format("Resource {0} already exists. Skipping.", resourceUri), "Debug");
                }

                return saveOperation;
            }

            return base.CreateSaveOperationForItem(storage, context, item, cancellationToken);
        }
开发者ID:NuGet,项目名称:NuGet.Services.Metadata,代码行数:27,代码来源:RegistrationMakerCatalogWriter.cs


示例3: PlayersController

 public PlayersController(IStorage<Models.Player> playerStorage, IStorage<Models.BoardGame> boardGamesStorage,
     DistanceCalculator distanceCalculator)
 {
     _playerStorage = playerStorage;
     _boardGamesStorage = boardGamesStorage;
     _distanceCalculator = distanceCalculator;
 }
开发者ID:thomasdarimont,项目名称:boardz-cross-platform-sample,代码行数:7,代码来源:PlayersController.cs


示例4: Deserialize

 public object Deserialize(IStorage storage, Data.Node data, object result)
 {
     return data is Data.DateTime ? (data as Data.DateTime).Value :
         data is Data.Binary ? new System.DateTime(BitConverter.ToInt64((data as Data.Binary).Value, 0)) :
         data is Data.String ? System.DateTime.Parse((data as Data.String).Value) :
         new System.DateTime();
 }
开发者ID:imintsystems,项目名称:Kean,代码行数:7,代码来源:DateTime.cs


示例5: PObject

        internal PObject(IStorage repository, int id, Dictionary<int, IPObject> objectsIndex, bool deferredLoad)
        {
            if (repository == null)
                throw new Exception("Хранилище данных не задано");

            Id = id;
            _ownerCollection = null;

            this.storage = repository;
            this.objectsIndex = objectsIndex;
            this._deferredLoad = deferredLoad;

            // получение значений атрибутов
            _attrs = repository.ListAttributes(Id);

            if (objectsIndex != null)
                objectsIndex.Add(id, this);

            // загрузка коллекций
            _collections = new Dictionary<string, PCollection>();

            List<string> collectsNames = storage.ListCollections(Id);
            foreach (string name in collectsNames)
            {
                string lowName = name.ToLower();
                _collections.Add(lowName, new PCollection(this, lowName, deferredLoad));
            }
        }
开发者ID:kindprojects,项目名称:workstation,代码行数:28,代码来源:PObject.cs


示例6: PolymorphicEnumeration

        public void PolymorphicEnumeration()
        {
            var stgs = new IStorage[]
            {
                new MemoryStorage(),
                //new PersistedMemoryStorage(),
                new FileSystemStorage("fs"),
                //new EsentStorage("esent"),
                new SqlSeverStorage("server=.;database=overdb;integrated security=true"),
            };

            foreach (var stg in stgs)
            {
                using (var db = new Database(stg, null, new GuidIdFactory()))
                {
                    db.Delete(db.GetEnumerable());
                    db.SaveMany(new Animal[]
                    {
                        new Cat(), new Dog(), new Cow(),
                    }.AsEnumerable());

                    var animals = db.GetEnumerable<Animal>();
                    Assert.That(animals.Count(), Is.EqualTo(3), "{0} not polymorphic", stg.GetType().Name);
                }
            }
        }
开发者ID:ronnieoverby,项目名称:GetYoCastOn,代码行数:26,代码来源:PolyTests.cs


示例7: SerfidCore

 public SerfidCore(IListener listener, IFilter filter, IStorage storage, IUser user)
 {
     _listener = listener;
     _filter = filter;
     _storage = storage;
     _user = user;
 }
开发者ID:sonyas12,项目名称:GitHubVS2013,代码行数:7,代码来源:SerfidCore.cs


示例8: BarsTimeIntervalEnumerator

        public BarsTimeIntervalEnumerator(DataFeed dataFeed, IStorage storage, string symbol, PriceType priceType, BarPeriod period, DateTime startTime, DateTime endTime, int preferredBufferSize)
            : base(dataFeed, storage, symbol, priceType, period, startTime, preferredBufferSize)
        {
            this.endTime = endTime;

            this.Reset();
        }
开发者ID:ifzz,项目名称:FDK,代码行数:7,代码来源:BarsTimeIntervalEnumerator.cs


示例9: GetCodes

        IList<string> GetCodes(IStorage storage, IList<string> codes=null) {
            var items= storage.ListItems("");
            foreach (var item in items) {

            }
            return codes;
        }
开发者ID:yanyitec,项目名称:Yanyitec,代码行数:7,代码来源:Module.cs


示例10: Deserialize

 public object Deserialize(IStorage storage, Data.Node data, object result)
 {
     return data is Data.Byte ? (data as Data.Byte).Value :
         data is Data.Binary ? (data as Data.Binary).Value[0] :
         data is Data.String ? byte.Parse((data as Data.String).Value, System.Globalization.CultureInfo.InvariantCulture.NumberFormat) :
         (byte)0;
 }
开发者ID:imintsystems,项目名称:Kean,代码行数:7,代码来源:Byte.cs


示例11: AddStorage

        public static async Task AddStorage(this MockServerHttpClientHandler handler, IStorage storage)
        {
            var files = await storage.List(CancellationToken.None);
            foreach (var file in files)
            {
                var storageFileUrl = file;
                var relativeFileUrl = "/" + storageFileUrl.ToString().Replace(storage.BaseAddress.ToString(), string.Empty);

                handler.SetAction(relativeFileUrl, async message =>
                {
                    var content = await storage.Load(storageFileUrl, CancellationToken.None);

                    var response = new HttpResponseMessage(HttpStatusCode.OK);

                    if (!string.IsNullOrEmpty(content.CacheControl))
                    {
                        response.Headers.CacheControl = CacheControlHeaderValue.Parse(content.CacheControl);
                    }
                    response.Content = new StreamContent(content.GetContentStream());

                    if (!string.IsNullOrEmpty(content.ContentType))
                    {
                        response.Content.Headers.ContentType = new MediaTypeHeaderValue(content.ContentType);
                    }

                    return response;
                });
            }
        }
开发者ID:jinujoseph,项目名称:NuGet.Services.Metadata,代码行数:29,代码来源:MockServerHttpClientHandlerExtensions.cs


示例12: StorageRoot

 /***********************************************************************/
 private StorageRoot(IStorage root, bool readOnly )
     : base( root ) 
 {
     rootIStorage = root; 
     containerIsReadOnly = readOnly; 
     dataSpaceManagerInitializationInProgress = false;
 } 
开发者ID:sjyanxin,项目名称:WPFSource,代码行数:8,代码来源:StorageRoot.cs


示例13: Computer

 public Computer(ICpu cpu, IRam ram, IVideoCard gpu, IStorage storage)
 {
     Storage = storage;
     Gpu = gpu;
     Ram = ram;
     Cpu = cpu;
 }
开发者ID:didimitrov,项目名称:Algo,代码行数:7,代码来源:Computer.cs


示例14: CreateUser

 public Regulus.Project.Crystal.Game.Core CreateUser(Regulus.Remoting.ISoulBinder binder, IStorage storage, IMap zone , Battle.IZone battle)
 {
     var core = new Regulus.Project.Crystal.Game.Core(binder, storage, zone, battle);
     _Users.AddFramework(core);
     core.InactiveEvent += () => { _Users.RemoveFramework(core); };
     return core;
 }
开发者ID:jiowchern,项目名称:KeysCore,代码行数:7,代码来源:Hall.cs


示例15: CompoundFile

        internal CompoundFile(IStorage storage, System.Runtime.InteropServices.ComTypes.STATSTG statstg)
        {
            if (storage == null) { throw new ArgumentNullException("storage"); }

            _rootStorage = storage;
            _statstg = statstg;
        }
开发者ID:BigBadOwl,项目名称:SolidEdge.Community.Reader,代码行数:7,代码来源:CompoundFile.cs


示例16: JsonClient

 public JsonClient(IStorage storedCredentials, string url, string scopes)
 {
     _scopes = scopes;
     _url = new Uri(url);
     _storedCredentials = storedCredentials;
     _client = new WebClient { Encoding = Encoding.UTF8 };
 }
开发者ID:AQASchool,项目名称:versionone-oauth2-examples,代码行数:7,代码来源:Program.cs


示例17: Deserialize

        public object Deserialize(IStorage storage, Data.Node data, object result)
        {
            Kean.Collection.IList<Data.Node> nodes;
            Reflect.Type type;
            Reflect.Type elementType;
            type = data.Type;
            elementType = this.GetElementType(type);
            if (data is Data.Collection)
                nodes = (data as Data.Collection).Nodes;
            else
            { // only one element so it was impossible to know it was a collection
                nodes = new Kean.Collection.List<Data.Node>(data);
                data.Type = data.OriginalType ?? elementType;
                Uri.Locator locator = data.Locator.Copy();
                locator.Fragment += "0";
                data.Locator = locator;
            }

            if (result.IsNull())
                result = this.Create(type, elementType, nodes.Count);
            int i = 0;
            foreach (Data.Node child in nodes)
            {
                int c = i++; // ensure c is unique in every closure of lambda function below
                storage.Deserialize(child, elementType, d => this.Set(result, d, c));
            }
            return result;
        }
开发者ID:imintsystems,项目名称:Kean,代码行数:28,代码来源:Collection.cs


示例18: PaymentProcessor

 public PaymentProcessor(string pool, IDaemonClient daemonClient, IStorage storage , IWalletConfig walletConfig)
 {
     _daemonClient = daemonClient;
     _storage = storage;
     _walletConfig = walletConfig;
     _logger = Log.ForContext<PaymentProcessor>().ForContext("Component", pool);
 }
开发者ID:nuggetbram,项目名称:coinium-whrl,代码行数:7,代码来源:PaymentProcessor.cs


示例19: AdventureStage

 public AdventureStage(IMap map , IStorage storage , User user)
 {
     _User = user;
     _Observeds = new List<IObservedAbility>();
     _Stroage = storage;
     _Map = map;
 }
开发者ID:jiowchern,项目名称:Regulus,代码行数:7,代码来源:AdventureStage.cs


示例20: Deserialize

 public object Deserialize(IStorage storage, Data.Node data, object result)
 {
     return data is Data.String ? (data as Data.String).Value :
         data is Data.Binary ? System.Text.Encoding.UTF8.GetString((data as Data.Binary).Value) :
         data is Data.Null ? null :
         "";
 }
开发者ID:imintsystems,项目名称:Kean,代码行数:7,代码来源:String.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IStorageActionsAccessor类代码示例发布时间:2022-05-24
下一篇:
C# IStep类代码示例发布时间: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