public T GetUpdatedObject() { T output = (T)Activator.CreateInstance(typeof(T)); foreach (var node in Nodes) { var stringNode = node as NightlightStringNode; PropertyInfo prop = output.GetType().GetProperty(stringNode.PropertyName, BindingFlags.Public | BindingFlags.Instance); if (prop != null && prop.CanWrite) { Log.Debug("Found Prop: " + prop.Name, "Value: " + stringNode.GetValueString()); string readValue = prop.GetValue(output, null) as string; if (readValue == null) { readValue = String.Empty; } prop.SetValue(output, readValue, null); Log.Debug("PROP: ", readValue); } } StringClassForTestingValues testClass = output as StringClassForTestingValues; Log.Debug("First: ", testClass.RequiredStringWithNoPreviousValue); return(output); }
protected void RunForm(RecyclerView recyclerView, StringClassForTestingValues testClass) { formController = new NightlightFormController <StringClassForTestingValues>(ref testClass); NightlightRecyclerViewAdapter nightlightAdapter = new NightlightRecyclerViewAdapter(ref formController); recyclerView.SetAdapter(nightlightAdapter); }
private void BindNewValues() { StringClassForTestingValues newTestClass = new StringClassForTestingValues(); //foreach(var node in formController.Nodes) //{ //} }
private static void TestStringClasses() { StringClassForTestingValues stc = new StringClassForTestingValues { }; NightlightFormController <StringClassForTestingValues> controller = new NightlightFormController <StringClassForTestingValues>(ref stc); NightlightConsoleForm <StringClassForTestingValues> consoleForm = new NightlightConsoleForm <StringClassForTestingValues>(controller); consoleForm.Run(); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); testClass = new StringClassForTestingValues(); mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); mRecyclerView.SetLayoutManager(new LinearLayoutManager(this)); RunForm(mRecyclerView, testClass); }