本文整理汇总了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 ();
}
示例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();
}
示例3: ClonedStructShouldBeIdentical
public void ClonedStructShouldBeIdentical()
{
var original = new Custom(Color.Red);
var clone = original.Clone();
Assert.That(clone, Is.EqualTo(original));
}
示例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);
}
示例5: ShouldClearToBlack
public void ShouldClearToBlack()
{
var grid = new Custom(Color.Pink);
grid.Clear();
Assert.That(grid, Is.EqualTo(Custom.Create()));
}
示例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);
}
示例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"
);
}
示例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();
}
示例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));
}
示例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);
}
示例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]);
}
示例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();
}
}
示例13: Main
public static void Main()
{
var custom = new Custom(Scheduler.Immediate);
custom.OverloadedMethodHasOptionalScheduler(42, "42", 42.00).Subscribe();
}
示例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();
}
示例15: opCustomIntS_async
public override void opCustomIntS_async(AMD_MyClass_opCustomIntS cb, Custom<int> i, Ice.Current current)
{
cb.ice_response(i, i);
}