internal void JobFilterFromInt(Int64 val) { //System.Diagnostics.Debug.WriteLine("opening filter = " + val); List <int> indices = new List <int>(); for (int id = 1; id < 60; id++) { Int64 shifted = ((Int64)1) << (id - 1); if ((val & shifted) != 0) { int listidx = 0; foreach (object ob in chkFfxivClassFilter.Items) { ClassLink cl = (ClassLink)ob; if (cl.id == id) { //System.Diagnostics.Debug.WriteLine(shifted + " --> " + cl.id + " = " + cl.name); indices.Add(listidx); } listidx++; } } } foreach (int index in indices) { chkFfxivClassFilter.SetItemChecked(index, true); } }
internal void JobFilterFromInt(Int64 val) { List <int> indices = new List <int>(); for (int id = 1; id < 60; id++) { Int64 shifted = ((Int64)1) << (id - 1); if ((val & shifted) != 0) { int listidx = 0; foreach (object ob in chkFfxivClassFilter.Items) { ClassLink cl = (ClassLink)ob; if (cl.id == id) { indices.Add(listidx); } listidx++; } } } foreach (int index in indices) { chkFfxivClassFilter.SetItemChecked(index, true); } }
internal Int64 JobfilterToInt() { Int64 fifi = 0; foreach (int ci in chkFfxivClassFilter.CheckedIndices) { object ob = chkFfxivClassFilter.Items[ci]; ClassLink cl = (ClassLink)ob; fifi |= ((Int64)1) << (int)(cl.id - 1); } return(fifi); }
internal Int64 JobfilterToInt() { Int64 fifi = 0; foreach (int ci in chkFfxivClassFilter.CheckedIndices) { object ob = chkFfxivClassFilter.Items[ci]; ClassLink cl = (ClassLink)ob; Int64 num = ((Int64)1) << (int)(cl.id - 1); //System.Diagnostics.Debug.WriteLine(cl.name + " = " + cl.id + " --> " + num); fifi |= num; } //System.Diagnostics.Debug.WriteLine("final filter = " + fifi); return(fifi); }
public static void TestOptionalParamsForClasses() { var l1 = new ClassLink(url: "url", text: "test"); Assert.AreEqual("some", l1.name); var l2 = new ClassLink2(url: "url2", text: "test2"); Assert.NotNull(l2.name); var l3 = new ClassLink3(text: "test3", url: "url3"); Assert.AreEqual("url3", l3.Url); Assert.AreEqual("test3", l3.Text); Assert.NotNull(l3.Name); Assert.AreEqual(0, l3.Name.Value); }
private void AddClass(string name, Int64 id) { ClassLink cl = new ClassLink(name, id); chkFfxivClassFilter.Items.Add(cl); }