private static void magix_forms_set_value(object sender, ActiveEventArgs e) { Node ip = Ip(e.Params); if (ShouldInspect(ip)) { AppendInspectFromResource( ip["inspect"], "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.set-value-dox].value"); AppendCodeFromResource( ip, "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.set-value-sample]"); return; } Node dp = Dp(e.Params); IValueControl ctrl = FindControl <IValueControl>(e.Params); string value = Expressions.GetFormattedExpression("value", e.Params, null); ctrl.ControlValue = value; }
//------------------------------------------------------ public void ValueInDevice(IValueControl sameDevice) { Console.Write("Are you want Increase, Decrease or Set value for device? "); Message = (Console.ReadLine()).ToLower(); if (Message.Contains("increase")) { sameDevice.NextValue(); } else if (Message.Contains("decrease")) { sameDevice.PreviosValue(); } else if (Message.Contains("set")) { Console.WriteLine("Set value for device: "); try { sameDevice.SetValue(Int32.Parse(Console.ReadLine())); } catch (Exception ex) { Console.WriteLine(ex.Message); } } else { Console.WriteLine("Set clear instructions!"); } }
//------------------------------------------------------ public void ValueInDevice(IValueControl sameDevice) { Console.Write("Are you want Increase, Decrease or Set value for device? "); Message = (Console.ReadLine()).ToLower(); if (Message.Contains("increase")) { sameDevice.NextValue(); } else if (Message.Contains("decrease")) { sameDevice.PreviosValue(); } else if (Message.Contains("set")) { Console.WriteLine("Set value for device: "); try { sameDevice.SetValue(Int32.Parse(Console.ReadLine())); } catch (Exception ex) { Console.WriteLine(ex.Message); } } else Console.WriteLine("Set clear instructions!"); }
void CheckForValueControl() { MemberReference <Vector3> memberReference = GetComponent <MemberReference <Vector3> >(); if (memberReference) { m_ValueControl = memberReference.valueControl; m_FlipDirection = m_ValueControl.direction; } }
/* * helper for above */ private static void GetValues(Control ctrl, Node ip) { IValueControl valueCtrl = ctrl as IValueControl; if (valueCtrl != null && valueCtrl.IsTrueValue) { ip["values"][ctrl.ID].Value = valueCtrl.ControlValue; } foreach (Control idxChild in ctrl.Controls) { GetValues(idxChild, ip); } }
private static void ClearValues(Control ctrl, Node ip) { IValueControl valueCtrl = ctrl as IValueControl; if (valueCtrl != null && valueCtrl.IsTrueValue) { valueCtrl.ControlValue = null; } foreach (Control idxChild in ctrl.Controls) { ClearValues(idxChild, ip); } }
private static void magix_forms_get_value(object sender, ActiveEventArgs e) { Node ip = Ip(e.Params); if (ShouldInspect(ip)) { AppendInspectFromResource( ip["inspect"], "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.get-value-dox].value"); AppendCodeFromResource( ip, "Magix.forms", "Magix.forms.hyperlisp.inspect.hl", "[magix.forms.get-value-sample]"); return; } IValueControl ctrl = FindControl <IValueControl>(e.Params); ip["value"].Value = ctrl.ControlValue; }