This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private bool customPref_PreferenceClick(Preference preference) | |
| { | |
| IEnumerable<char>[] stockItemsDisplay = _stockItemsConfig.OrderBy(i => i.StockDataItem).Select(i => i.StockDataItem.GetStringValue()).ToArray(); | |
| bool[] allitemschecked = _stockItemsConfig.OrderBy(i => i.StockDataItem).Select(i => i.IsChecked).ToArray(); | |
| var dialog = new AlertDialog.Builder(this); | |
| dialog.SetMultiChoiceItems(stockItemsDisplay, allitemschecked, clickCallback); | |
| dialog.SetTitle("Select columns"); | |
| dialog.SetPositiveButton("Save", saveCallback); | |
| dialog.Create().Show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using Android.App; | |
| using Android.Content; | |
| using Android.Widget; | |
| using Android.OS; | |
| namespace MonoDroidMultiChoice | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public interface IMainView | |
| { | |
| void RefreshList(IList<string> portfolioNames); | |
| void StartAddPortfolioActivity(); | |
| void StartViewPortfolioActivity(long portfolioId); | |
| void StartEditPortfolioActivity(int itemId); | |
| void StartConfigActivity(); | |
| void ExitApplication(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Threading; | |
| using PostSharp.Aspects; | |
| namespace MonoStockPortfolio.Framework | |
| { | |
| public class OnWorkerThreadAttribute : MethodInterceptionAspect | |
| { | |
| public static IThreadingService ThreadingService; | |
| public override void OnInvoke(MethodInterceptionArgs args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| internal class DoNotThreadService : IThreadingService | |
| { | |
| public void QueueUserWorkItem(WaitCallback func) | |
| { | |
| func.Invoke(null); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [TestFixture] | |
| public class Class1 | |
| { | |
| [Test] | |
| public void test() | |
| { | |
| var result = Harbl(new { foo = "bar"}); | |
| Assert.That(result, Is.EqualTo("bar")); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [HttpPost] | |
| public ActionResult Edit(int id, MyNameEntity name) | |
| { | |
| if(!ModelState.IsValid) | |
| { | |
| return View(name); | |
| } | |
| return RedirectToAction("Index"); | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function assertEquals($var1, $var2) | |
| { | |
| if($var1 != $var2) { | |
| throw new Exception("Expected " . $var1 . " but was " . $var2); | |
| } | |
| } | |
| $funcs = get_defined_functions(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class TestRunner | |
| { | |
| public function Run() | |
| { | |
| $classes = get_declared_classes(); | |
| foreach($classes as $class) | |
| { | |
| if(substr($class,0,4) == "Test" && ($class != "TestRunner")) { | |
| $this->RunTests($class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Formatting | |
| { | |
| public static function BeginLine($color = null) | |
| { | |
| if(defined('STDIN') ) { | |
| return ""; | |
| } | |
| if($color == null) { | |
| return "<span>"; |