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


C# IStorage类代码示例

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


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


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