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

C# AssetList类代码示例

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

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



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

示例1: DoOpen

 private void DoOpen(AssetList assets, bool alreadyOpen)
 {
   if (alreadyOpen)
   {
     using (List<Asset>.Enumerator enumerator = assets.GetEnumerator())
     {
       while (enumerator.MoveNext())
       {
         Asset current = enumerator.Current;
         bool flag = false;
         int count = this.assetList.Count;
         for (int index = 0; index < count; ++index)
         {
           if (this.assetList[index].path == current.path)
           {
             flag = true;
             this.assetList[index] = current;
             break;
           }
         }
         if (!flag)
           this.assetList.Add(current);
       }
     }
   }
   else
     this.assetList.AddRange((IEnumerable<Asset>) assets);
   this.RefreshList();
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:29,代码来源:WindowCheckoutFailure.cs


示例2: Open

		public static void Open(AssetList assets)
		{
			Task task = Provider.Status(assets);
			task.Wait();
			WindowResolve window = WindowResolve.GetWindow();
			window.DoOpen(task.assetList);
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:7,代码来源:WindowResolve.cs


示例3: DoOpen

 private void DoOpen(AssetList assets, bool alreadyOpen)
 {
     if (alreadyOpen)
     {
         foreach (Asset asset in assets)
         {
             bool flag = false;
             int count = this.assetList.Count;
             for (int i = 0; i < count; i++)
             {
                 if (this.assetList[i].path == asset.path)
                 {
                     flag = true;
                     this.assetList[i] = asset;
                     break;
                 }
             }
             if (!flag)
             {
                 this.assetList.Add(asset);
             }
         }
     }
     else
     {
         this.assetList.AddRange(assets);
     }
     this.RefreshList();
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:29,代码来源:WindowCheckoutFailure.cs


示例4: WriteAssetList

        public void WriteAssetList(AssetList assets, int total, int pagesize, int pagestart)
        {
            writer.WriteStartElement("Assets");

            if (total > -1)
            {
                writer.WriteAttributeString("total", total.ToString());
            }

            if (pagesize > -1)
            {
                writer.WriteAttributeString("pageSize", pagesize.ToString());
            }

            if (pagestart > -1)
            {
                writer.WriteAttributeString("pageStart", pagestart.ToString());
            }

            foreach (var asset in assets)
            {
                WriteAsset(asset);
            }

            writer.WriteEndElement();
        }
开发者ID:xtremeRacer,项目名称:VersionOne.SDK.NET.APIClient,代码行数:26,代码来源:XmlApiWriter.cs


示例5: Open

 public static void Open(AssetList assets)
 {
     Task task = Provider.Status(assets);
     task.Wait();
     AssetList revert = task.assetList.Filter(true, new Asset.States[] { Asset.States.CheckedOutLocal });
     GetWindow().DoOpen(revert);
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:7,代码来源:WindowRevert.cs


示例6: DoOpen

 private void DoOpen(AssetList resolve)
 {
     bool includeFolder = true;
     Asset.States[] states = new Asset.States[] { Asset.States.Conflicted };
     this.assetList = resolve.Filter(includeFolder, states);
     this.RefreshList();
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:7,代码来源:WindowResolve.cs


示例7: Open

 public static void Open(AssetList assets)
 {
     Task task = Provider.Status(assets);
     task.Wait();
     Asset.States[] states = new Asset.States[] { Asset.States.CheckedOutLocal, Asset.States.DeletedLocal, Asset.States.AddedLocal, Asset.States.Missing };
     AssetList revert = task.assetList.Filter(true, states);
     GetWindow().DoOpen(revert);
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:8,代码来源:WindowRevert.cs


示例8: UpdateFilesInVCIfNeeded

 private static void UpdateFilesInVCIfNeeded()
 {
     if (Provider.enabled)
     {
         string[] strArray = Directory.GetFiles("Temp/ScriptUpdater/", "*.*", SearchOption.AllDirectories);
         AssetList assets = new AssetList();
         foreach (string str in strArray)
         {
             assets.Add(Provider.GetAssetByPath(str.Replace("Temp/ScriptUpdater/", string.Empty)));
         }
         Task task = Provider.Checkout(assets, CheckoutMode.Exact);
         task.Wait();
         if (<>f__am$cache0 == null)
         {
开发者ID:randomize,项目名称:VimConfig,代码行数:14,代码来源:APIUpdaterHelper.cs


示例9: Export

        public override void Export(AssetList asset, string path)
        {
            var materials = (asset as MaterialList);
            var mat = new MAT();

            foreach (Material material in materials.Entries)
            {
                mat.Materials.Add(
                    new MATMaterial(
                        material.Name,
                        material.Texture.Name
                    )
                );
            }

            mat.Save(path);
        }
开发者ID:DevilboxGames,项目名称:Flummery,代码行数:17,代码来源:MATExporter.cs


示例10: DoOpen

 private void DoOpen(ChangeSet change, AssetList assets)
 {
     this.taskSubmit = null;
     this.submitResultCode = 0x100;
     this.submitErrorMessage = null;
     this.changeSet = change;
     this.description = (change != null) ? this.SanitizeDescription(change.description) : "";
     this.assetList = null;
     if (change == null)
     {
         this.taskStatus = Provider.Status(assets);
     }
     else
     {
         this.taskDesc = Provider.ChangeSetDescription(change);
         this.taskStat = Provider.ChangeSetStatus(change);
     }
 }
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:18,代码来源:WindowChange.cs


示例11: DoOpen

		private void DoOpen(ChangeSet change, AssetList assets)
		{
			this.taskSubmit = null;
			this.submitResultCode = 256;
			this.submitErrorMessage = null;
			this.changeSet = change;
			this.description = string.Empty;
			this.assetList = null;
			if (change == null)
			{
				this.taskStatus = Provider.Status(assets);
			}
			else
			{
				this.taskDesc = Provider.ChangeSetDescription(change);
				this.taskStat = Provider.ChangeSetStatus(change);
			}
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:18,代码来源:WindowChange.cs


示例12: LoadAssetsAsync

 public void LoadAssetsAsync(AssetList list, FloatRef progress)
 {
     List<Asset> assets = new List<Asset>();
     foreach (string path in datapaths)
     {
         try
         {
             if (!Directory.Exists(path))
             {
                 continue;
             }
             foreach (string s in Directory.GetFiles(path, "*.*", SearchOption.AllDirectories))
             {
                 try
                 {
                     FileInfo f = new FileInfo(s);
                     if (f.Name.Equals("thumbs.db", StringComparison.InvariantCultureIgnoreCase))
                     {
                         continue;
                     }
                     Asset a = new Asset();
                     a.data = File.ReadAllBytes(s);
                     a.dataLength = a.data.Length;
                     a.name = f.Name.ToLowerInvariant();
                     a.md5 = Md5(a.data);
                     assets.Add(a);
                 }
                 catch
                 {
                 }
             }
         }
         catch
         {
         }
     }
     progress.value = 1;
     list.count = assets.Count;
     list.items = new Asset[2048];
     for (int i = 0; i < assets.Count; i++)
     {
         list.items[i] = assets[i];
     }
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:44,代码来源:PlatformNative.cs


示例13: UpdateFilesInVCIfNeeded

		private static void UpdateFilesInVCIfNeeded()
		{
			if (!Provider.enabled)
			{
				return;
			}
			string[] files = Directory.GetFiles("Temp/ScriptUpdater/", "*.*", SearchOption.AllDirectories);
			AssetList assetList = new AssetList();
			string[] array = files;
			for (int i = 0; i < array.Length; i++)
			{
				string text = array[i];
				assetList.Add(Provider.GetAssetByPath(text.Replace("Temp/ScriptUpdater/", string.Empty)));
			}
			Task task = Provider.Checkout(assetList, CheckoutMode.Both);
			task.Wait();
			IEnumerable<Asset> source = 
				from a in task.assetList
				where (a.state & Asset.States.ReadOnly) == Asset.States.ReadOnly
				select a;
			if (!task.success || source.Any<Asset>())
			{
				string arg_103_0 = "[API Updater] Files cannot be updated (failed to checkout): {0}";
				object[] expr_BA = new object[1];
				expr_BA[0] = (
					from a in source
					select string.Concat(new object[]
					{
						a.fullName,
						" (",
						a.state,
						")"
					})).Aggregate((string acc, string curr) => acc + Environment.NewLine + "\t" + curr);
				Debug.LogErrorFormat(arg_103_0, expr_BA);
				ScriptUpdatingManager.ReportExpectedUpdateFailure();
				return;
			}
			FileUtil.CopyDirectoryRecursive("Temp/ScriptUpdater/", ".", true);
			FileUtil.DeleteFileOrDirectory("Temp/ScriptUpdater/");
		}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:40,代码来源:APIUpdaterHelper.cs


示例14: UpdateFilesInVCIfNeeded

 private static void UpdateFilesInVCIfNeeded()
 {
   if (!Provider.enabled)
     return;
   string[] files = Directory.GetFiles("Temp/ScriptUpdater/", "*.*", SearchOption.AllDirectories);
   AssetList assets = new AssetList();
   foreach (string str in files)
     assets.Add(Provider.GetAssetByPath(str.Replace("Temp/ScriptUpdater/", string.Empty)));
   Task task = Provider.Checkout(assets, CheckoutMode.Exact);
   task.Wait();
   IEnumerable<Asset> source = task.assetList.Where<Asset>((Func<Asset, bool>) (a => (a.state & Asset.States.ReadOnly) == Asset.States.ReadOnly));
   if (!task.success || source.Any<Asset>())
   {
     Debug.LogErrorFormat("[API Updater] Files cannot be updated (failed to check out): {0}", (object) source.Select<Asset, string>((Func<Asset, string>) (a => a.fullName + " (" + (object) a.state + ")")).Aggregate<string>((Func<string, string, string>) ((acc, curr) => acc + Environment.NewLine + "\t" + curr)));
     ScriptUpdatingManager.ReportExpectedUpdateFailure();
   }
   else
   {
     FileUtil.CopyDirectoryRecursive("Temp/ScriptUpdater/", ".", true);
     FileUtil.DeleteFileOrDirectory("Temp/ScriptUpdater/");
   }
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:22,代码来源:APIUpdaterHelper.cs


示例15: OpenIfCheckoutFailed

 public static void OpenIfCheckoutFailed(AssetList assets)
 {
   Object[] objectsOfTypeAll = Resources.FindObjectsOfTypeAll(typeof (WindowCheckoutFailure));
   bool alreadyOpen = (objectsOfTypeAll.Length <= 0 ? (Object) null : (Object) (objectsOfTypeAll[0] as WindowCheckoutFailure)) != (Object) null;
   bool flag = alreadyOpen;
   if (!flag)
   {
     using (List<Asset>.Enumerator enumerator = assets.GetEnumerator())
     {
       while (enumerator.MoveNext())
       {
         if (!enumerator.Current.IsState(Asset.States.CheckedOutLocal))
         {
           flag = true;
           break;
         }
       }
     }
   }
   if (!flag)
     return;
   WindowCheckoutFailure.GetWindow().DoOpen(assets, alreadyOpen);
 }
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:23,代码来源:WindowCheckoutFailure.cs


示例16: MainMenu

 public MainMenu()
 {
     one = 1;
     textures = new DictionaryStringInt1024();
     textTextures = new TextTexture[256];
     textTexturesCount = 0;
     screen = new ScreenMain();
     screen.menu = this;
     loginClient = new LoginClientCi();
     assets = new AssetList();
     assetsLoadProgress = new FloatRef();
 }
开发者ID:YoungGames,项目名称:manicdigger,代码行数:12,代码来源:MainMenu.ci.cs


示例17: CreateWorkitem

		public void CreateWorkitem()
		{
			const string type = "Story";
			const string title = "Story Name";
			const string description = "Story description";
			const string projectToken = "Scope:0";
			const string externalFieldName = "FieldName";
			const string externalId = "externalId";
			const string externalSystemName = "External System Name";
			const string priorityId = "Priority:12";
			const string owners = "Onwer_1,Owners_2";

			var memberAssetType = new TestAssetType("Member");
			var projectAssetType = new TestAssetType("Project");
			var priorityAssetType = new TestAssetType("Priority");

			var storyAttributes = new Dictionary<string, IAttributeDefinition> {
                {"Owners", new TestAttributeDefinition(memberAssetType, true, false, false)},
            };
			var storyAssetType = new TestAssetType("Story", storyAttributes);

			var source = TestValueId.Create(externalSystemName, "Source", 333);
			var sources = new PropertyValues(new List<ValueId> { source });
			var assetStory = new Asset(storyAssetType);
			var ownersAssets = new AssetList {
                new Asset(new TestOid(new TestAssetType("Member"), 1, null)),
                new Asset(new TestOid(new TestAssetType("Member"), 2, null)),
            };
			var queryResult = new QueryResult(ownersAssets, 2, null);

			Expect.Call(_mockMetaModel.GetAssetType("Scope")).Return(projectAssetType);
			Expect.Call(_mockQueryBuilder.QueryPropertyValues(VersionOneProcessor.WorkitemSourceType)).Return(sources);
			Expect.Call(_mockMetaModel.GetAssetType("Story")).Return(storyAssetType);
			Expect.Call(_mockServices.New(storyAssetType, Oid.Null)).Return(assetStory);
			Expect.Call(_mockMetaModel.GetAssetType("Member")).Return(memberAssetType);
			Expect.Call(_mockServices.Retrieve(null)).IgnoreArguments().Return(queryResult);
			Expect.Call(_mockMetaModel.GetAssetType("Priority")).Return(priorityAssetType);
			Expect.Call(() => _mockServices.Save(assetStory));

			Expect.Call(_mockMetaModel.GetAssetType("Story")).Return(storyAssetType);
			Expect.Call(_mockQueryBuilder.Query("Story", new FilterTerm(null))).IgnoreArguments().Return(new AssetList { assetStory });
			Expect.Call(_mockQueryBuilder.ListPropertyValues).Return(null);
			Expect.Call(_mockQueryBuilder.TypeResolver).Return(null);

			_repository.ReplayAll();

			_processor.CreateWorkitem(type, title, description, projectToken,
				externalFieldName, externalId, externalSystemName,
				priorityId, owners);
			_repository.VerifyAll();
		}
开发者ID:versionone,项目名称:VersionOne.Integration.TFS.ServerConnector,代码行数:51,代码来源:VersionOneProcessorTester.cs


示例18: WriteHistoricalAttribute

        public void WriteHistoricalAttribute(AssetList assets, IAttributeDefinition attribdef, int total, int pagesize, int pagestart) {
            writer.WriteStartElement("History");

            if(total > -1) {
                writer.WriteAttributeString("total", total.ToString());
            }

            if(pagesize > -1) {
                writer.WriteAttributeString("pageSize", pagesize.ToString());
            }

            if(pagestart > -1) {
                writer.WriteAttributeString("pageStart", pagestart.ToString());
            }

            foreach(var asset in assets) {
                WriteAttribute(asset.GetAttribute(attribdef));
            }

            writer.WriteEndElement();
        }
开发者ID:RedwardsiPipeline,项目名称:VersionOne.SDK.NET.APIClient,代码行数:21,代码来源:XmlApiWriter.cs


示例19: WriteHistoricalAsset

 public void WriteHistoricalAsset(AssetList assets, int total, int pagesize, int pagestart) {
     WriteHistoricalAssetList(assets, total, pagesize, pagestart);
 }
开发者ID:RedwardsiPipeline,项目名称:VersionOne.SDK.NET.APIClient,代码行数:3,代码来源:XmlApiWriter.cs


示例20: Save

 public void Save(AssetList assetList)
 {
     OnBeforeSave(assetList);
     _wrapped.Save(assetList);
 }
开发者ID:marcinczekaj,项目名称:v1-jira-integration,代码行数:5,代码来源:ServicesWrapper.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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