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

C# Custom类代码示例

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

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



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


示例16: opCustomIntSS

 public override Custom<Custom<int>> opCustomIntSS(Custom<Custom<int>> i, out Custom<Custom<int>> o,
                                                   Ice.Current current)
 {
     o = i;
     return i;
 }
开发者ID:externl,项目名称:ice,代码行数:6,代码来源:MyClassI.cs


示例17: Main

 private void Main()
 {
     var custom = new Custom(Scheduler.Immediate);
     custom.SimpleMethod();
 }
开发者ID:oriches,项目名称:Resharper.ReactivePlugin,代码行数:5,代码来源:file12.cs


示例18: Main

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


示例19: opCustomIntSSAsync

 public override Task<MyClass_OpCustomIntSSResult> opCustomIntSSAsync(Custom<Custom<int>> i, Ice.Current current)
 {
     return Task.FromResult<MyClass_OpCustomIntSSResult>(new MyClass_OpCustomIntSSResult(i, i));
 }
开发者ID:zhangwei5095,项目名称:ice,代码行数:4,代码来源:MyClassAMDI.cs


示例20: twoways


//.........这里部分代码省略.........
        }

        {
            Stack<CVPrx> i = new Stack<CVPrx>();
            for(int c = 0; c < _length; ++c)
            {
                i.Push(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }
            Stack<CVPrx> o;
            Stack<CVPrx> r;

            r = p.opSCVPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            CCVPrxS i = new CCVPrxS(_length);
            for(int c = 0; c < _length; ++c)
            {
                i.Add(CVPrxHelper.uncheckedCast(communicator.stringToProxy(c.ToString())));
            }
            CCVPrxS o;
            CCVPrxS r;

            r = p.opCCVPrxS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Custom<int> i = new Custom<int>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(c);
            }
            Custom<int> o;
            Custom<int> r;

            r = p.opCustomIntS(i, out o);

            test(Ice.CollectionComparer.Equals(i, o));
            test(Ice.CollectionComparer.Equals(i, r));
        }

        {
            Custom<CV> i = new Custom<CV>();
            for(int c = 0; c < _length; ++c)
            {
                i.Add(new CV(c));
            }
            i.Add(null);
            Custom<CV> o;
            Custom<CV> r;

            r = p.opCustomCVS(i, out 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)
开发者ID:joshmoore,项目名称:ice,代码行数:67,代码来源:Twoways.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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