public static int GetFoo(this YourType yt)
    {
        int value;

        fooValues.TryGetValue(yt, out value);
        return(value);
    }
Esempio n. 2
0
    public int Compare(object x, object y)
    {
        YourType a = (YourType)((ListViewItem)x).Tag;
        YourType b = (YourType)((ListViewItem)y).Tag;

        // compare tags
        return(a.CompareTo(b));
    }
Esempio n. 3
0
    public static void Assert(YourType sd)
    {
        HttpWebResponse response = (HttpWebResponse)sd.GetDataType();

        Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
        statusNumber = (int)response.StatusCode;
        Assert.AreEqual(200, statusNumber);
    }
Esempio n. 4
0
 public static void ShouldEqual(this YourType subject, YourType other)
 {
     // Check parameters for null here if needed
     if (!subject.Equals(other))
     {
         // custom logging here
         Assert.Fail("Objects are not equal"); // test fails
     }
 }
 public bool RunTest(YourType o)
 {
     foreach (var test in Children)
     {
         if (test.RunTest(o))
         {
             return(true);
         }
     }
     return(false);
 }
 public YourClass()
 {
     _context = HttpContext.Current;
     if (_context == null)
     {
         throw new InvalidOperationException("Boom!");
     }
     _itemKey = "Key Goes Here";
     // set a default value here if you like...
     if (NonPersistentStatic == null)
     {
         NonPersistentStatic = new YourType("Default Value");
     }
 }
 public static void SetFoo(this YourType yt, int value)
 {
     fooValues[yt] = value;
 }
Esempio n. 8
0
 public void Update(YourType yt)
 {
     yuc.YourUpdatemethod(yt);
 }
 public Foo(YourType tail)
 {
     this.tail = tail;
 }
Esempio n. 10
0
 static public void AddingNewMethodToTables(this ITableBase table, string some_string,
                                            int some_int, YourType any_other_parameter /* etc... */)
 {
     // implement the method you want add to all Table classes
 }
 public abstract bool RunTest(YourType o);
 public bool RunTest(YourType o)
 {
     return(o.Type.Contains(Match));
 }