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

C# StorageType类代码示例

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

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



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

示例1: Storage

 public Storage(StorageType type) : base()
 {
     localFolder = ApplicationData.Current.LocalFolder;
     
     path = type == StorageType.SECURE ? MPIN_STORAGE : USER_STORAGE;
     this.Data = string.Empty;
 }
开发者ID:miracl,项目名称:milagro-mfa-sdk-wp,代码行数:7,代码来源:Storage.cs


示例2: LoadStorage

        public Storage LoadStorage(Player player, StorageType type)
        {
            string SQL = "SELECT * FROM `inventory` WHERE "
                + "`playerid` = ?pid AND `storagetype` = ?type";
            MySqlCommand cmd = new MySqlCommand(SQL, InventoryDAOConnection);
            cmd.Parameters.AddWithValue("?pid", player.Id);
            cmd.Parameters.AddWithValue("?type", type.ToString());
            MySqlDataReader LoadStorageReader = cmd.ExecuteReader();

            var storage = new Storage { StorageType = StorageType.Inventory };
            if (LoadStorageReader.HasRows)
            {
                while (LoadStorageReader.Read())
                {
                    if (LoadStorageReader.GetInt32(2) != 20000000)
                    {
                        StorageItem item = new StorageItem()
                        {
                            ItemId = LoadStorageReader.GetInt32(2),
                            Amount = LoadStorageReader.GetInt32(3),
                            Color = LoadStorageReader.GetInt32(4),
                        };

                        storage.Items.Add(LoadStorageReader.GetInt32(5), item);
                    }
                    else
                    {
                        storage.Money = LoadStorageReader.GetInt32(3);
                    }
                }
            }
            LoadStorageReader.Close();

            return storage;
        }
开发者ID:arkanoid1,项目名称:Temu,代码行数:35,代码来源:InventoryDAO.cs


示例3: CreateOrUpdateAccount

        public async Task<AccountConfiguration> CreateOrUpdateAccount(StorageType type)
        {
            var newAccount = await _storageService.CreateAccount(type);
            if (newAccount == null) return null;

            var existingAccount = _configService.Accounts.SingleOrDefault(_ => _.Type == newAccount.Type && _.Id == newAccount.Id);
            if (existingAccount == null) // New Account
            {
                // ensure account's name is unique
                var i = 1;
                var name = newAccount.Name;
                while (
                    _configService.Accounts.Any(
                        _ => _.Type == newAccount.Type && _.Name.Equals(newAccount.Name, StringComparison.InvariantCultureIgnoreCase)))
                {
                    i++;
                    newAccount.Name = string.Format("{0} ({1})", name, i);
                }

                _configService.Accounts.Add(newAccount);
                return newAccount;
            }

            MessageService.ShowInfo("This account already exists.\r\nUpdating account data only.");

            //existingAccount.Name = newAccount.Name;
            existingAccount.Secret = newAccount.Secret;

            return existingAccount;
        }
开发者ID:lluchs,项目名称:KeeAnywhere,代码行数:30,代码来源:UIService.cs


示例4: GetImageCount

        /// <summary>
        /// Gets total number of images in a presentation from a 3rd party storage
        /// </summary>
        /// <param name="storageType"></param>
        /// <param name="storageName">Name of the storage</param>
        /// <param name="folderName">In case of Amazon S3 storage the folder's path starts with Amazon S3 Bucket name.</param>
        /// <returns>Total number of images</returns>
        public int GetImageCount(StorageType storageType, string storageName, string folderName)
        {
            //build URI to get image count
            StringBuilder strURI = new StringBuilder(Product.BaseProductUri + "/slides/" + FileName
                + "/images" + (string.IsNullOrEmpty(folderName) ? "" : "?folder=" + folderName));

            switch (storageType)
            {
                case StorageType.AmazonS3:
                    strURI.Append("&storage=" + storageName);
                    break;
            }
            string signedURI = Utils.Sign(strURI.ToString());

            Stream responseStream = Utils.ProcessCommand(signedURI, "GET");

            StreamReader reader = new StreamReader(responseStream);
            string strJSON = reader.ReadToEnd();


            //Parse the json string to JObject
            JObject parsedJSON = JObject.Parse(strJSON);


            //Deserializes the JSON to a object. 
            ImagesResponse imagesResponse = JsonConvert.DeserializeObject<ImagesResponse>(parsedJSON.ToString());

            return imagesResponse.Images.List.Count;

        }
开发者ID:peters,项目名称:Aspose_Cloud_SDK_For_.NET,代码行数:37,代码来源:Extractor.cs


示例5: AddItem

        public bool AddItem(Player player, StorageType type, KeyValuePair<int, StorageItem> KeyVP)
        {
            string SQL = "INSERT INTO `inventory` "
                    + "(`accountname`, `playerid`, `itemid`, `amount`, `color`, `slot`, `storagetype`) "
                    + "VALUES(?accountname, ?pid, ?itemid, ?count, ?color, ?slot, ?type);";
            MySqlCommand cmd = new MySqlCommand(SQL, InventoryDAOConnection);
            cmd.Parameters.AddWithValue("?accountname", player.AccountName);
            cmd.Parameters.AddWithValue("?pid", player.pid);
            cmd.Parameters.AddWithValue("?itemid", KeyVP.Value.ItemId);
            cmd.Parameters.AddWithValue("?count", KeyVP.Value.Count);
            cmd.Parameters.AddWithValue("?color", KeyVP.Value.Color);
            cmd.Parameters.AddWithValue("?slot", KeyVP.Key);
            cmd.Parameters.AddWithValue("?type", type.ToString());

            try
            {
                cmd.ExecuteNonQuery();
                return true;
            }
            catch (Exception e)
            {
                Log.ErrorException("DAO: ADD ITEM ERROR!", e);
            }

            return false;
        }
开发者ID:uebari,项目名称:TeraEmulatorDev,代码行数:26,代码来源:InventoryDAO.cs


示例6: IsSigned

 internal static bool IsSigned(StorageType type) {
     return(type == StorageType.Int16 ||
         type == StorageType.Int32 ||
         type == StorageType.Int64 ||
         type == StorageType.SByte ||
         IsFloat(type));
 }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:7,代码来源:ExpressionNode.cs


示例7: DataExpression

        internal DataExpression(DataTable table, string expression, Type type)
        {
            ExpressionParser parser = new ExpressionParser(table);
            parser.LoadExpression(expression);

            _originalExpression = expression;
            _expr = null;

            if (expression != null)
            {
                _storageType = DataStorage.GetStorageType(type);
                if (_storageType == StorageType.BigInteger)
                {
                    throw ExprException.UnsupportedDataType(type);
                }

                _dataType = type;
                _expr = parser.Parse();
                _parsed = true;
                if (_expr != null && table != null)
                {
                    Bind(table);
                }
                else
                {
                    _bound = false;
                }
            }
        }
开发者ID:dotnet,项目名称:corefx,代码行数:29,代码来源:DataExpression.cs


示例8: SetBytes

 internal int SetBytes(long fieldOffset, byte[] buffer, int bufferOffset, int length)
 {
     int dstOffset = (int) fieldOffset;
     if (this.IsNull || (StorageType.ByteArray != this._type))
     {
         if (dstOffset != 0)
         {
             throw ADP.ArgumentOutOfRange("fieldOffset");
         }
         this._object = new byte[length];
         this._type = StorageType.ByteArray;
         this._isNull = false;
         this.BytesLength = length;
     }
     else
     {
         if (dstOffset > this.BytesLength)
         {
             throw ADP.ArgumentOutOfRange("fieldOffset");
         }
         if ((dstOffset + length) > this.BytesLength)
         {
             int num2 = ((byte[]) this._object).Length;
             if ((dstOffset + length) > num2)
             {
                 byte[] dst = new byte[Math.Max((int) (dstOffset + length), (int) (2 * num2))];
                 Buffer.BlockCopy((byte[]) this._object, 0, dst, 0, (int) this.BytesLength);
                 this._object = dst;
             }
             this.BytesLength = dstOffset + length;
         }
     }
     Buffer.BlockCopy(buffer, bufferOffset, (byte[]) this._object, dstOffset, length);
     return length;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:35,代码来源:SqlRecordBuffer.cs


示例9: ClientStorageMoveSlotPacket

 public ClientStorageMoveSlotPacket(long sourceSlot, long destSlot, StorageType storageType)
     : this()
 {
     SourceSlot = sourceSlot;
     DestSlot = destSlot;
     StorageType = storageType;
 }
开发者ID:Erikai,项目名称:OpenORPG,代码行数:7,代码来源:ClientStorageMoveSlot.cs


示例10: DataExpression

 internal DataExpression(DataTable table, string expression, Type type)
 {
     this.dependency = DataTable.zeroColumns;
     ExpressionParser parser = new ExpressionParser(table);
     parser.LoadExpression(expression);
     this.originalExpression = expression;
     this.expr = null;
     if (expression != null)
     {
         this._storageType = DataStorage.GetStorageType(type);
         if (this._storageType == StorageType.BigInteger)
         {
             throw ExprException.UnsupportedDataType(type);
         }
         this._dataType = type;
         this.expr = parser.Parse();
         this.parsed = true;
         if ((this.expr != null) && (table != null))
         {
             this.Bind(table);
         }
         else
         {
             this.bound = false;
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:DataExpression.cs


示例11: StorageTypeInfo

        public StorageTypeInfo (StorageType storage_type, string name, string description)
        {
            Type = storage_type;

            Name = name;
            Description = description;
        }
开发者ID:Rud5G,项目名称:SparkleShare,代码行数:7,代码来源:BaseRepository.cs


示例12: InventoryPage

 internal InventoryPage(InventoryType type, StorageType storage, byte size, Item bag = null)
 {
     _type = type;
                 _storage = storage;
                 Size = size;
                 Bag = bag;
 }
开发者ID:ephe-meral,项目名称:gw-interface,代码行数:7,代码来源:InventoryPage.cs


示例13: IsIntegerSql

 internal static bool IsIntegerSql(StorageType type)
 {
     if (((((type != StorageType.Int16) && (type != StorageType.Int32)) && ((type != StorageType.Int64) && (type != StorageType.UInt16))) && (((type != StorageType.UInt32) && (type != StorageType.UInt64)) && ((type != StorageType.SByte) && (type != StorageType.Byte)))) && (((type != StorageType.SqlInt64) && (type != StorageType.SqlInt32)) && (type != StorageType.SqlInt16)))
     {
         return (type == StorageType.SqlByte);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ExpressionNode.cs


示例14: IsFloatSql

 internal static bool IsFloatSql(StorageType type)
 {
     if ((((type != StorageType.Single) && (type != StorageType.Double)) && ((type != StorageType.Decimal) && (type != StorageType.SqlDouble))) && ((type != StorageType.SqlDecimal) && (type != StorageType.SqlMoney)))
     {
         return (type == StorageType.SqlSingle);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ExpressionNode.cs


示例15: IsFloat

 internal static bool IsFloat(StorageType type)
 {
     if ((type != StorageType.Single) && (type != StorageType.Double))
     {
         return (type == StorageType.Decimal);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ExpressionNode.cs


示例16: IsNumericSql

 internal static bool IsNumericSql(StorageType type)
 {
     if (!IsFloatSql(type))
     {
         return IsIntegerSql(type);
     }
     return true;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:ExpressionNode.cs


示例17: CreateStorage

 /// <summary>
 /// Creates a storage of specified type using metadata information of enumeration value.
 /// </summary>
 /// <param name="st">Type of storage to create.</param>
 /// <param name="storageStr">Connection string or file path for data storage.</param>
 /// <returns>Newly created storage.</returns>
 public static AbstractResultStorage CreateStorage(StorageType st, string storageStr)
 {
     Type[] patametersType = { typeof(String) };
     object[] invokeParameters = { storageStr };
     StorageTypeInfo[] info = (StorageTypeInfo[])st.GetType().GetField(st.ToString()).GetCustomAttributes(typeof(StorageTypeInfo), false);
     Type t = Type.GetType(info[0].Implementation, true);
     return (AbstractResultStorage)t.GetConstructor(patametersType).Invoke(invokeParameters);
 }
开发者ID:kocharyan-ani,项目名称:random_networks_explorer,代码行数:14,代码来源:AbstractResultStorage.cs


示例18: ExistsImpl

    // Checks if a data set exists at the given path.
    // Storage type is used to correctly interpret the given path.
    public static bool ExistsImpl(String path, StorageType storageType)
    {
        if (storageType==StorageType.STORAGE_APPRESOURCE && QCARRuntimeUtilities.IsPlayMode())
        {
            path = "Assets/StreamingAssets/" + path;
        }

        return (QCARWrapper.Instance.DataSetExists(path, (int)storageType) == 1);
    }
开发者ID:JSungMin,项目名称:AugmentedRealityExample,代码行数:11,代码来源:DataSetImpl.cs


示例19: StorageEntry

        public StorageEntry(List<PetBrokerEntry> list, int funds)
        {
            m_Funds = funds;
            m_StorageType = StorageType.Pet;
            m_Expires = DateTime.UtcNow + TimeSpan.FromDays(7);

            foreach (PetBrokerEntry entry in list)
                m_Creatures.Add(entry.Pet);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:9,代码来源:StorageEntry.cs


示例20: BuildUriString

        public static string BuildUriString(StorageType type, string accountName, string path)
        {
            if (accountName == null) throw new ArgumentNullException("accountName");
            if (path == null) throw new ArgumentNullException("path");

            var scheme = StorageRegistry.Descriptors.First(_ => _.Type == type).Scheme;

            return string.Format("{0}:///{1}/{2}", scheme, accountName, path);
        }
开发者ID:lluchs,项目名称:KeeAnywhere,代码行数:9,代码来源:StorageUri.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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