Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F856
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
stwalkerster
Jun 15 2016, 2:55 AM
2016-06-15 02:55:16 (UTC+0)
Size
648 B
Referenced Files
None
Subscribers
None
View Options
// Let's have a class. It's sealed for some reason so we can't extend it.
public sealed class Foo
{
// This class has two properties, but has nothing useful here.
public int Value1 {get;set;}
public int Value2 {get;set;}
}
// let's say I want to add the two numbers together. Because this is a Complicated Operation (tm), I'm gonna write an extension method to do it.
public static class HandyStuff
{
public static int SumThings(this Foo x)
{
return x.Value1 + x.Value2;
}
}
// let's get an instance...
var foo = new Foo { Value1 = 3, Value2 = 4 };
// Now, I can do stuff like this:
var result = foo.SumThings();
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
736
Default Alt Text
(648 B)
Attached To
Mode
P32 (An Untitled Masterwork)
Attached
Detach File
Event Timeline
Log In to Comment