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


C# Custom类代码示例

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


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

示例1: AddItem

 public void AddItem(Custom.Item item)
 {
     Custom.Item itemToAdd = item;
     for(int i=0;i<items.Count;i++)
     {
         if(items[i].id == -1)
         {
             items [i] = itemToAdd;
             GameObject itemObj = Instantiate (inventoryItem);
             itemObj.GetComponent<ItemData> ().item = itemToAdd;
             itemObj.transform.SetParent (slots[i].transform);
             itemObj.transform.position = itemObj.transform.parent.position;
             itemObj.transform.localScale = new Vector2 (1, 1);
             itemObj.GetComponent<Image> ().sprite = itemToAdd.Sprite;
             itemObj.name = itemToAdd.name;
             itemObj.GetComponent<ItemData>().onClick += delegate(int p_int)
             {
                 //Debug.Log("CHamando método do inventoryManager: " + p_int);
                 idAtual = p_int;
                 Stats(idAtual);
             };
             break;
         }
     }
     DataManager.SaveItems (items);
     screenNavigationRef.Back ();
 }
开发者ID:GustavGMD,项目名称:LeituraGamificada,代码行数:27,代码来源:InventoryManager.cs

示例2: Keypad

        /// <summary>
        /// Prevents a default instance of the <see cref="Keypad" /> class from being created.
        /// </summary>
        private Keypad()
        {
            Log.Debug("Keypad is initializing");
            Chroma.Initialize();

            _custom = Custom.Create();
        }
开发者ID:DeadlyEmbrace,项目名称:Colore,代码行数:10,代码来源:Keypad.cs

示例3: ClonedStructShouldBeIdentical

        public void ClonedStructShouldBeIdentical()
        {
            var original = new Custom(Color.Red);
            var clone = original.Clone();

            Assert.That(clone, Is.EqualTo(original));
        }
开发者ID:WolfspiritM,项目名称:Colore,代码行数:7,代码来源:CustomTests.cs

示例4: Keypad

        /// <summary>
        /// Prevents a default instance of the <see cref="Keypad" /> class from being created.
        /// </summary>
        private Keypad()
        {
            Log.Debug("Keypad is initializing");
            Chroma.Initialize();

            _custom = new Custom(Color.Black);
        }
开发者ID:danpierce1,项目名称:Colore,代码行数:10,代码来源:Keypad.cs

示例5: ShouldClearToBlack

        public void ShouldClearToBlack()
        {
            var grid = new Custom(Color.Pink);
            grid.Clear();

            Assert.That(grid, Is.EqualTo(Custom.Create()));
        }
开发者ID:WolfspiritM,项目名称:Colore,代码行数:7,代码来源:CustomTests.cs

示例6: ShouldPass

 public void ShouldPass()
 {
     var customA = new Custom { Val = 1 };
     var customB = new Custom { Val = 1 };
     var comparer = new CustomComparer<Custom>();
     customA.ShouldBeGreaterThanOrEqualTo(customB, comparer);
 }
开发者ID:shouldly,项目名称:shouldly,代码行数:7,代码来源:CustomObjectScenario.cs

示例7: CustomObjectScenarioShouldFail

        public void CustomObjectScenarioShouldFail()
        {
            var customA = new Custom { Val = 1 };
            var customB = new Custom { Val = 2 };
            var comparer = new CustomComparer<Custom>();
            Verify.ShouldFail(() =>
            customA.ShouldBeGreaterThanOrEqualTo(customB, comparer, "Some additional context"),

            errorWithSource:
            @"customA
            should be greater than or equal to
            Shouldly.Tests.TestHelpers.Custom (000000)
            but was
            Shouldly.Tests.TestHelpers.Custom (000000)

            Additional Info:
            Some additional context",

            errorWithoutSource:
            @"Shouldly.Tests.TestHelpers.Custom (000000)
            should be greater than or equal to
            Shouldly.Tests.TestHelpers.Custom (000000)
            but was not

            Additional Info:
            Some additional context"
            );
        }
开发者ID:shouldly,项目名称:shouldly,代码行数:28,代码来源:CustomObjectScenario.cs

示例8: SendKeysTest1

		public void SendKeysTest1() {
			f = new Form();
			f.Activated +=new EventHandler(SendKeysTest1_activated);
			c = new Custom();
			f.Controls.Add(c);
			Application.Run(f);
			c.Dispose();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:SendKeysTest.cs

示例9: ClonedStructShouldBeIndependent

        public void ClonedStructShouldBeIndependent()
        {
            var original = new Custom(Color.Red);
            var clone = original.Clone();

            clone.Set(Color.Blue);

            Assert.That(clone, Is.Not.EqualTo(original));
        }
开发者ID:WolfspiritM,项目名称:Colore,代码行数:9,代码来源:CustomTests.cs

示例10: ShouldEqualIdenticalGrid

        public void ShouldEqualIdenticalGrid()
        {
            var a = new Custom(Color.Red, 42);
            var b = new Custom(Color.Red, 42);

            Assert.True(a == b);
            Assert.False(a != b);
            Assert.True(a.Equals(b));
            Assert.AreEqual(a, b);
        }
开发者ID:WolfspiritM,项目名称:Colore,代码行数:10,代码来源:CustomTests.cs

示例11: ShouldConstructFromList

        public void ShouldConstructFromList()
        {
            var colors = new Color[Constants.MaxLeds];
            colors[0] = Color.Red;
            colors[1] = Color.Blue;
            colors[2] = Color.Green;

            var effect = new Custom(colors);

            for (var i = 0; i < Constants.MaxLeds; i++)
                Assert.AreEqual(colors[i], effect[i]);
        }
开发者ID:WolfspiritM,项目名称:Colore,代码行数:12,代码来源:CustomTests.cs

示例12: files

        private void 打开ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            openFileDialog1.Filter = "txt files(*.txt)|*.txt";
            //string path = openFileDialog1.FileName;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                reader = new System.IO.StreamReader(openFileDialog1.FileName, Encoding.Default);
                while(!reader.EndOfStream)
                {
                    string line = reader.ReadLine() + "\n";
                    string[] S = line.Split(':');
                    Custom Cus = new Custom();
                    Cus.AccountName = S[0];
                    Cus.AccountBalance = double.Parse(S[1]);
                    Cus.AccountNumber = S[3];
                    Cus.AccountType = S[2];
                    list.Add(Cus);

                }
                reader.Close();

            }
        }
开发者ID:GZC201314,项目名称:C-,代码行数:23,代码来源:Form1.cs

示例13: Main

 public static void Main()
 {
     var custom = new Custom(Scheduler.Immediate);
     custom.OverloadedMethodHasOptionalScheduler(42, "42", 42.00).Subscribe();
 }
开发者ID:oriches,项目名称:Resharper.ReactivePlugin,代码行数:5,代码来源:file20.cs

示例14: ice_response

 public override void ice_response(Custom<CV> r, Custom<CV> o)
 {
     IEnumerator<CV> eo = (IEnumerator<CV>)o.GetEnumerator();
     IEnumerator<CV> er = (IEnumerator<CV>)r.GetEnumerator();
     foreach(CV obj in _i)
     {
         eo.MoveNext();
         er.MoveNext();
         if(obj == null)
         {
             test(eo.Current == null);
             test(er.Current == null);
         }
         else
         {
             test(obj.i == ((CV)eo.Current).i);
             test(obj.i == ((CV)er.Current).i);
         }
     }
     callback.called();
 }
开发者ID:2008hatake,项目名称:zeroc-ice,代码行数:21,代码来源:TwowaysAMI.cs

示例15: opCustomIntS_async

 public override void opCustomIntS_async(AMD_MyClass_opCustomIntS cb, Custom<int> i, Ice.Current current)
 {
     cb.ice_response(i, i);
 }
开发者ID:pedia,项目名称:zeroc-ice,代码行数:4,代码来源:MyClassAMDI.cs


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