コード例 #1
0
ファイル: BaseManager.cs プロジェクト: wobushiren79/ThaumAge
    /// <summary>
    /// 根据位置获取图标
    /// </summary>
    /// <param name="positon"></param>
    /// <param name="listdata"></param>
    /// <returns></returns>
    public virtual Sprite GetSpriteByPosition(int position, List <IconBean> listdata)
    {
        IconBean iconData = BeanUtil.GetIconBeanByPosition(position, listdata);

        if (iconData == null)
        {
            return(null);
        }
        return(iconData.value);
    }
コード例 #2
0
ファイル: BaseManager.cs プロジェクト: wobushiren79/ThaumAge
    /// <summary>
    /// 根据名字获取图标
    /// </summary>
    /// <param name="name"></param>
    /// <param name="listdata"></param>
    /// <returns></returns>
    public virtual Sprite GetSpriteByName(string name, List <IconBean> listdata)
    {
        IconBean iconData = BeanUtil.GetIconBeanByName(name, listdata);

        if (iconData == null)
        {
            return(null);
        }
        return(iconData.value);
    }
コード例 #3
0
ファイル: ProductService.cs プロジェクト: dpbinh/trucksaleasp
        public IList <ProductResourceBean> GetAllResourceByProduct(long id)
        {
            IList <ProductResourceBean> result = new List <ProductResourceBean>();

            try
            {
                result = BeanUtil.ConvertToList <ProductResource, ProductResourceBean>(_resourceRepo.GetByProduct(id));
            } catch (Exception e)
            {
                throw new Exception("Error Get resource for product : " + id + ": " + e.Message);
            }
            return(result);
        }
コード例 #4
0
ファイル: ProductService.cs プロジェクト: dpbinh/trucksaleasp
        public IList <ProductGroupBean> GetAllProductGroup()
        {
            IList <ProductGroupBean> result = new List <ProductGroupBean>();

            try
            {
                result = BeanUtil.ConvertToList <ProductGroup, ProductGroupBean>(_productGroupRepo.FindAllProducts());
            } catch (Exception e)
            {
                throw new Exception("Error when get manufacture");
            }

            return(result);
        }
コード例 #5
0
ファイル: ProductService.cs プロジェクト: dpbinh/trucksaleasp
        public IList <ProductShortInfoBean> GetProductByManufacture(long id)
        {
            IList <ProductShortInfoBean> result = new List <ProductShortInfoBean>();

            try
            {
                result = BeanUtil.ConvertToList <Product, ProductShortInfoBean>(_productRepo.GetProductsByGroup(id));
            }catch (Exception e)
            {
                throw new Exception("Get Product by manufacture error : " + e.Message);
            }

            return(result);
        }
コード例 #6
0
ファイル: ProductService.cs プロジェクト: dpbinh/trucksaleasp
        public IList <ProductShortInfoBean> GetAllProducts()
        {
            IList <ProductShortInfoBean> result = new List <ProductShortInfoBean>();

            try
            {
                var products = _productRepo.GetAllProducts();
                result = BeanUtil.ConvertToList <Product, ProductShortInfoBean>(products);
            } catch (Exception e)
            {
                throw new Exception("Get all product get error: " + e.Message);
            }

            return(result);
        }
コード例 #7
0
        private void Menucategoryadd_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog
            {
                InitialDirectory = LibCommon.AppContext.GetInstance().Config.GetConfigParamValue("UISetting", "LastAccessDir"),
                Multiselect      = true
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                LibCommon.AppContext.GetInstance().Config.SetConfigParamValue("UISetting", "LastAccessDir", FileHelper.GetFileDir(dialog.FileNames[0]));
                RadTreeNode      selectedNode = navigateTree.SelectedNode;
                RadTreeNode      batchNode    = selectedNode.GetBatchNode();
                NBatchInfo       batchInfo    = batchNode.Tag as NBatchInfo;
                List <NFileInfo> fileInfos    = BeanUtil.FileDialog2FileInfo(dialog, batchInfo.BatchNO);
                AddNodeWithFileInfo(selectedNode, fileInfos, batchInfo);
                UpdateBatchNodeTitle(batchNode);
                batchNode.ExpandAll();
            }
        }
コード例 #8
0
ファイル: ResourcesCfg.cs プロジェクト: sunkening/warcraft
        public static void load(byte[] bytes)
        {
            dataList.Clear();
            dataMap.Clear();
            CSVReader r = new CSVReader( );

            r.load(bytes);
            List <string> attrList = new  List <string>();
            List <string> typeList = new List <string>();

            // 读取注释
            r.readRecord();
            r.readHeader();
            int count = r.getColumnCount();

            for (int i = 0; i < count; i++)
            {
                attrList.Add(r.get(i));
            }
            r.readRecord();
            for (int i = 0; i < count; i++)
            {
                typeList.Add(r.get(i));
            }
            while (r.readRecord())
            {
                ResourcesCfg item = new ResourcesCfg();
                for (int i = 0; i < count; i++)
                {
                    object value = StringUtil.convertValue(r.get(i), typeList[i]);
                    BeanUtil.setPublicProperty(item, attrList[i], value);
                }
                dataList.Add(item);
            }
            r.close();
            foreach (ResourcesCfg t in dataList)
            {
                dataMap[t.id] = t;
            }
        }
コード例 #9
0
ファイル: UITownMarket.cs プロジェクト: wobushiren79/IL
 public void CreateGoods(List <StoreInfoBean> listData)
 {
     if (objGoodsContent == null || objGoodsModel == null || listData == null)
     {
         return;
     }
     CptUtil.RemoveChildsByActive(objGoodsContent);
     GameCommonInfo.InitRandomSeed();
     for (int i = 0; i < listData.Count; i++)
     {
         StoreInfoBean          itemData = listData[i];
         GameObject             objGoods = Instantiate(objGoodsContent, objGoodsModel);
         ItemTownGoodsMarketCpt itemCpt  = objGoods.GetComponent <ItemTownGoodsMarketCpt>();
         if (itemCpt != null)
         {
             IconBean iconData = BeanUtil.GetIconBeanByName(itemData.icon_key, listGoodsIcon);
             itemCpt.SetData(itemData, iconData.value);
         }
         objGoods.transform.DOScale(new Vector3(0, 0, 0), 0.5f).SetEase(Ease.OutBack).SetDelay(i * 0.01f).From();
     }
     ;
 }
コード例 #10
0
        private void BatchNode_AddLocalF_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog
            {
                InitialDirectory = LibCommon.AppContext.GetInstance().Config.GetConfigParamValue("UISetting", "LastAccessDir"),
                Multiselect      = true
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                LibCommon.AppContext.GetInstance().Config.SetConfigParamValue("UISetting", "LastAccessDir", FileHelper.GetFileDir(dialog.FileNames[0]));
                RadTreeNode selectedNode = navigateTree.SelectedNode;
                //string str = selectedNode.FullPath.ToString().Substring(selectedNode.FullPath.ToString().LastIndexOf("]") + 1);
                NBatchInfo batchInfo = selectedNode.Tag as NBatchInfo;
                //新增文件转为NFileInfo对象
                List <NFileInfo> fileInfos = BeanUtil.FileDialog2FileInfo(dialog, batchInfo.BatchNO);
                //批次节点下增加文件节点
                AddNodeWithFileInfo(selectedNode, fileInfos, batchInfo);

                UpdateBatchNodeTitle(selectedNode);
                selectedNode.ExpandAll();
            }
        }