public GridViewTemplate_Boolean(string fieldName, DisplayValue dv, bool useColors, bool isExcel) { _useColors = useColors; this.FieldName = fieldName; this.dv = dv; _isExcel = isExcel; }
/// <summary> /// Use the Monitor.Log static function to attach information to a transform. /// </summary> /// <returns>The log.</returns> /// <param name="key">The name of the information you wish to Log.</param> /// <param name="value">The array of float you want to display.</param> /// <param name="displayType">The type of display.</param> /// <param name="target">The transform you want to attach the information to. /// </param> /// <param name="camera">Camera used to calculate GUI position relative to /// the target. If null, `Camera.main` will be used.</param> public static void Log(string key, float[] value, Transform target = null, DisplayType displayType = DisplayType.INDEPENDENT, Camera camera = null) { if (!isInstantiated) { InstantiateCanvas(); isInstantiated = true; } if (target == null) { target = canvas.transform; } transformCamera[target] = camera; if (!displayTransformValues.Keys.Contains(target)) { displayTransformValues[target] = new Dictionary <string, DisplayValue>(); } Dictionary <string, DisplayValue> displayValues = displayTransformValues[target]; if (!displayValues.ContainsKey(key)) { var dv = new DisplayValue(); dv.time = Time.timeSinceLevelLoad; dv.floatArrayValues = value; if (displayType == DisplayType.INDEPENDENT) { dv.valueType = DisplayValue.ValueType.FLOATARRAY_INDEPENDENT; } else { dv.valueType = DisplayValue.ValueType.FLOATARRAY_PROPORTION; } displayValues[key] = dv; while (displayValues.Count > 20) { string max = ( displayValues.Aggregate((l, r) => l.Value.time < r.Value.time ? l : r).Key); RemoveValue(target, max); } } else { DisplayValue dv = displayValues[key]; dv.floatArrayValues = value; if (displayType == DisplayType.INDEPENDENT) { dv.valueType = DisplayValue.ValueType.FLOATARRAY_INDEPENDENT; } else { dv.valueType = DisplayValue.ValueType.FLOATARRAY_PROPORTION; } displayValues[key] = dv; } }
/// <summary> /// 속성들을 Xml Attribute로 생성합니다. /// </summary> /// <param name="writer">Attribute를 쓸 Writer</param> public override void GenerateXmlAttributes(XmlWriter writer) { base.GenerateXmlAttributes(writer); if (DisplayValue.IsNotWhiteSpace()) { writer.WriteAttributeString("displayValue", DisplayValue); } if (IsTrendZone.HasValue) { writer.WriteAttributeString("isTrendZone", IsTrendZone.GetHashCode().ToString()); } if (IsDashed.HasValue) { writer.WriteAttributeString("isDashed", IsDashed.GetHashCode().ToString()); } if (DashLen.HasValue) { writer.WriteAttributeString("dashLen", DashLen.Value.ToString()); } if (DashGap.HasValue) { writer.WriteAttributeString("dashGap", DashGap.Value.ToString()); } if (ToolText.IsNotWhiteSpace()) { writer.WriteAttributeString("toolText", ToolText); } }
/// <summary> /// Affiche le "display name" pour un élément d'énumération /// </summary> /// <param name="item">Elément d'énumaration courant</param> /// <param name="value">Valeur souhaitée</param> /// <returns>Valeur de l'annotation Display name de l'élément d'énumération courant</returns> public static HtmlString EnumDisplayNameFor(this Enum item, DisplayValue value) { var type = item.GetType(); var member = type.GetMember(item.ToString()); DisplayAttribute displayAttribute = (DisplayAttribute)member[0].GetCustomAttributes(typeof(DisplayAttribute), false).FirstOrDefault(); if (displayAttribute != null) { switch (value) { case DisplayValue.Name: return(new HtmlString(displayAttribute.Name)); case DisplayValue.Prompt: return(new HtmlString(displayAttribute.Prompt)); case DisplayValue.Description: return(new HtmlString(displayAttribute.Description)); default: return(new HtmlString(item.ToString())); } } return(new HtmlString(item.ToString())); }
private void AddDirectiveMiddlewareAndCommonCommandHandlers() { Pipeline.AddMiddleware( (command, context, next) => command switch { SubmitCode submitCode => HandleDirectivesAndSubmitCode( submitCode, context, next), LoadExtension loadExtension => HandleLoadExtension( loadExtension, context, next), DisplayValue displayValue => HandleDisplayValue( displayValue, context, next), UpdateDisplayedValue updateDisplayValue => HandleUpdateDisplayValue( updateDisplayValue, context, next), _ => next(command, context) });
public override bool Read(GH_IO.Serialization.GH_IReader reader) { _mode = (FoldMode)reader.GetInt32("Mode"); _disp = (DisplayValue)reader.GetInt32("Display"); slider = reader.GetBoolean("slider"); noDigits = reader.GetInt32("noDec"); MaxValue = reader.GetDouble("valMax"); MinValue = reader.GetDouble("valMin"); Value = reader.GetDouble("val"); dropdowncontents = new List <List <string> >(); dropdowncontents.Add(dropdownitems); if (_mode == FoldMode.Displacement) { dropdowncontents.Add(dropdowndisplacement); } if (_mode == FoldMode.Stress) { dropdowncontents.Add(dropdownstress); } selections = new List <string>(); selections.Add(dropdowncontents[0][(int)_mode]); selections.Add(dropdowncontents[1][(int)_disp]); first = false; this.CreateAttributes(); return(base.Read(reader)); }
/// <summary> Called whenever the xNode editor window is updated </summary> public override void OnBodyGUI() { // Attempt to draw a texture as the base color if (tex == null) { tex = new Texture2D(1, 1, TextureFormat.RGBA32, false); } tex.SetPixel(0, 0, customNodeColor); tex.Apply(); if (drawCustomTexture) { GUI.DrawTexture(new Rect(0, 0, GetWidth(), GetWidth() * 0.5f), tex, ScaleMode.ScaleAndCrop); } // Draw the default GUI first, so we don't have to do all of that manually. base.OnBodyGUI(); // `target` points to the node, but it is of type `Node`, so cast it. DisplayValue displayValueNode = target as DisplayValue; // Get the value from the node, and display it object obj = displayValueNode.GetValue(); if (obj != null) { EditorGUILayout.LabelField(obj.ToString()); } //// CODE TO CHANGE NODE COLOR //customNodeColor = EditorGUILayout.ColorField(customNodeColor); // Checkbox to allow the drawing of custom texture drawCustomTexture = EditorGUILayout.Toggle("Custom node texture", drawCustomTexture); }
// private static void Main(string[] args) // { // IObservable<string> obj = Observable.Generate( // 0, //Sets the initial value like for loop // _ => true, //Don't stop till i say so, infinite loop // i => i + 1, //Increment the counter by 1 everytime // i => new string('#', i), //Append # // i => TimeSelector(i)); //delegated this to private method which just calculates time // //Subscribe here // using (obj.Materialize().Subscribe(Console.WriteLine)) // { // Console.WriteLine("Press any key to exit!!!"); // Console.ReadLine(); // } // } public static void trace(IObservable <string> observable, string mimeType = HtmlFormatter.MimeType) { var kernel = KernelInvocationContext.Current.HandlingKernel; Task.Run(() => kernel.SendAsync(new SubmitCode(@"var d = display(""starting"");"))); var source = Observable.Interval(TimeSpan.FromSeconds(1), CurrentThreadScheduler.Instance); var displayId = Guid.NewGuid().ToString(); Task.Run(() => { var value = "displaying observable"; var formatted = new FormattedValue( mimeType, value.ToDisplayString(mimeType)); DisplayValue d = new DisplayValue(value, formatted, displayId); return(kernel.SendAsync(d)); }).Wait(); observable.Materialize().Take(10).Subscribe(e => { var formatted = new FormattedValue( mimeType, e.ToDisplayString(mimeType)); Task.Run(() => kernel.SendAsync(new UpdateDisplayedValue(e, formatted, displayId))); }); }
/// <summary> /// Use the Monitor.Log static function to attach information to a transform. /// </summary> /// <returns>The log.</returns> /// <param name="key">The name of the information you wish to Log.</param> /// <param name="value">The string value you want to display.</param> /// <param name="target">The transform you want to attach the information to. /// </param> /// <param name="camera">Camera used to calculate GUI position relative to /// the target. If null, `Camera.main` will be used.</param> public static void Log( string key, string value, Transform target = null, Camera camera = null) { if (!s_IsInstantiated) { InstantiateCanvas(); s_IsInstantiated = true; } if (target == null) { target = s_Canvas.transform; } s_TransformCamera[target] = camera; if (!s_DisplayTransformValues.Keys.Contains(target)) { s_DisplayTransformValues[target] = new Dictionary <string, DisplayValue>(); } var displayValues = s_DisplayTransformValues[target]; if (value == null) { RemoveValue(target, key); return; } if (!displayValues.ContainsKey(key)) { var dv = new DisplayValue(); dv.time = Time.timeSinceLevelLoad; dv.stringValue = value; dv.valueType = DisplayValue.ValueType.String; displayValues[key] = dv; while (displayValues.Count > 20) { var max = ( displayValues .Aggregate((l, r) => l.Value.time < r.Value.time ? l : r) .Key ); RemoveValue(target, max); } } else { var dv = displayValues[key]; dv.stringValue = value; dv.valueType = DisplayValue.ValueType.String; displayValues[key] = dv; } }
public int CompareTo(object obj) { if (!(obj is CBinome)) { return(-1); } return(DisplayValue.CompareTo(((CBinome)obj).DisplayValue)); }
protected override void InternalUpdateValue(object newvalue) { base.InternalUpdateValue(newvalue); if (Text) { Text.text = DisplayValue.ToString(); } }
public override void SingleClick() { int temp = (int)this.displayValue; this.displayValue = (DisplayValue)temp + 1; if (this.displayValue >= DisplayValue.Undefined) { this.displayValue = DisplayValue.Average; } }
void ResolveVariable(object var) { Variable v = (Variable)var; DisplayValue dispVal = new DisplayValue(mConnection, mRegisters, v); lock (mDisplaySet) { mDisplaySet[dispVal.Name] = dispVal; } Invoke(Delegate.CreateDelegate(typeof(NoParamsDelegate), this, "UpdateGrid")); }
private void DoTheSingletonThing() { if (!staticRef) { staticRef = this; } else { Destroy(this.gameObject); } }
public void AddIndicators(List <IndicatorInfo> indicators) { indicators_ = indicators; var indicatorsString = string.Join("; ", indicators_.Select(x => x.ToString()).ToArray()); _connectedMonitorsLogger.LogMessage("Monitor: {0} | Number: {1} | Color: {2} | Indicators: {4} | Display color: {3}", Index + 1, DisplayValue.ToString(), MonitorColor.ToString(), DisplayColor.ToString(), indicatorsString.Length > 0 ? indicatorsString : "None"); }
private void DeleteCommandExecute() { if (_hasOperation) { return; } if (!String.IsNullOrWhiteSpace(DisplayValue)) { DisplayValue = DisplayValue.Remove(DisplayValue.Length - 1); } }
void Update() { DisplayValue displayValue = node as DisplayValue; object obj = displayValue.GetInputValue <object>("input"); if (obj != null) { label.text = obj.ToString(); } else { label.text = "n/a"; } }
/** Use the Monitor.Log static function to attach information to a transform. * If displayType is <text>, value can be any object. * If sidplayType is <slider>, value must be a float. * If sidplayType is <hist>, value must be a List or Array of floats. * If sidplayType is <bar>, value must be a list or Array of positive floats. * Note that <slider> and <hist> caps values between -1 and 1. * @param key The name of the information you wish to Log. * @param value The value you want to display. * @param displayType The type of display. * @param target The transform you want to attach the information to. */ public static void Log( string key, object value, MonitorType displayType = MonitorType.text, Transform target = null) { if (!isInstanciated) { InstanciateCanvas(); isInstanciated = true; } if (target == null) { target = canvas.transform; } if (!displayTransformValues.Keys.Contains(target)) { displayTransformValues[target] = new Dictionary <string, DisplayValue>(); } Dictionary <string, DisplayValue> displayValues = displayTransformValues[target]; if (value == null) { RemoveValue(target, key); return; } if (!displayValues.ContainsKey(key)) { DisplayValue dv = new DisplayValue(); dv.time = Time.timeSinceLevelLoad; dv.value = value; dv.monitorDisplayType = displayType; displayValues[key] = dv; while (displayValues.Count > 20) { string max = displayValues.Aggregate((l, r) => l.Value.time < r.Value.time ? l : r).Key; RemoveValue(target, max); } } else { DisplayValue dv = displayValues[key]; dv.value = value; displayValues[key] = dv; } }
private void DeleteCommandExecute(object obj) { if (DisplayValue != string.Empty) { int txtLength = DisplayValue.Length; if (txtLength != 1) { string newDisplay = DisplayValue.Remove(txtLength - 1); } else { string newDisplay = 0.ToString(); } } }
/// <summary> Called whenever the xNode editor window is updated </summary> public override void OnBodyGUI() { // Draw the default GUI first, so we don't have to do all of that manually. base.OnBodyGUI(); // `target` points to the node, but it is of type `Node`, so cast it. DisplayValue displayValueNode = target as DisplayValue; // Get the value from the node, and display it object obj = displayValueNode.GetValue(); if (obj != null) { EditorGUILayout.LabelField(obj.ToString()); } }
void AddDisplayValues() { Resistance = new DisplayValue ( () => Voltmeter.Readings.Resistance, Units.Resistance.Ohm, Units.Resistance.All ); Voltage = new DisplayValue ( () => Voltmeter.Readings.Voltage, Units.Voltage.Volts, Units.Voltage.All ); Current = new DisplayValue ( () => Voltmeter.Readings.Current, Units.Current.Ampers, Units.Current.All ); Power = new DisplayValue ( () => Voltmeter.Readings.Power, Units.Power.Watts, Units.Power.All ); Energy = new DisplayValue ( () => Voltmeter.Readings.Energy, Units.Energy.WattSecond, Units.Energy.All ); NoiseThreshold = new DisplayValue ( () => Voltmeter.Readings.NoiseThreshold, Units.Voltage.Volts, Units.Voltage.All.ToArray(), // use list copy to avoid side-effects with Voltage (while DataBinding) minSourceValue: 0.0, maxSourceValue: DeviceConstants.MaxMeasuredVoltage ); }
/// <summary> /// Use the Monitor.Log static function to attach information to a transform. /// </summary> /// <returns>The log.</returns> /// <param name="key">The name of the information you wish to Log.</param> /// <param name="value">The float value you want to display.</param> /// <param name="target">The transform you want to attach the information to. /// </param> public static void Log( string key, float value, Transform target = null) { if (!isInstantiated) { InstantiateCanvas(); isInstantiated = true; } if (target == null) { target = canvas.transform; } if (!displayTransformValues.Keys.Contains(target)) { displayTransformValues[target] = new Dictionary <string, DisplayValue>(); } Dictionary <string, DisplayValue> displayValues = displayTransformValues[target]; if (!displayValues.ContainsKey(key)) { var dv = new DisplayValue(); dv.time = Time.timeSinceLevelLoad; dv.floatValue = value; dv.valueType = DisplayValue.ValueType.FLOAT; displayValues[key] = dv; while (displayValues.Count > 20) { string max = ( displayValues.Aggregate((l, r) => l.Value.time < r.Value.time ? l : r).Key); RemoveValue(target, max); } } else { DisplayValue dv = displayValues[key]; dv.floatValue = value; dv.valueType = DisplayValue.ValueType.FLOAT; displayValues[key] = dv; } }
/// <summary> /// 속성들을 Xml Attribute로 생성합니다. /// </summary> /// <param name="writer">Attribute를 쓸 Writer</param> public override void GenerateXmlAttributes(XmlWriter writer) { base.GenerateXmlAttributes(writer); if (Label.IsNotWhiteSpace()) { writer.WriteAttributeString("label", Label); } if (DisplayValue.IsNotWhiteSpace()) { writer.WriteAttributeString("displayValue", DisplayValue); } if (Color.HasValue) { writer.WriteAttributeString("color", Color.Value.ToHexString()); } if (Alpha.HasValue) { writer.WriteAttributeString("alpha", Alpha.ToString()); } if (_link != null) { _link.GenerateXmlAttributes(writer); } if (ToolText.IsNotWhiteSpace()) { writer.WriteAttributeString("toolText", ToolText); } if (ShowLabel.HasValue) { writer.WriteAttributeString("showLabel", ShowLabel.GetHashCode().ToString()); } if (Dashed.HasValue) { writer.WriteAttributeString("dashed", Dashed.GetHashCode().ToString()); } if (_anchor != null) { _anchor.GenerateXmlAttributes(writer); } }
/// <summary> /// Convert the string DisplayValue as byte array, based on conversion dictionary. /// </summary> /// <returns></returns> internal byte[] GetDisplayValueAsByteArray() { var filteredDisplayValue = DisplayValue.PadLeft(6); //var buffer = new List<byte>(); //foreach (var x in filteredDisplayValue) //{ // var (found, result) = Dict.GetValue(x); // // if (found) // buffer.Add(result); //} //return buffer.ToArray(); var buffer = new byte[filteredDisplayValue.Length]; Str2Bin(filteredDisplayValue, ref buffer, 0); return(buffer); }
public override int GetHashCode() { int hash = 1; if (LangCode.Length != 0) { hash ^= LangCode.GetHashCode(); } if (DisplayValue.Length != 0) { hash ^= DisplayValue.GetHashCode(); } if (DisplayKey.Length != 0) { hash ^= DisplayKey.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
// Update is called once per frame void Update() { if (!addedToDisplayer && displayThisValue && DisplayValue.staticRef) { DisplayValue.Add(this); addedToDisplayer = true; } if (playerRelated && movementAndRotation == null) { movementAndRotation = PlayerMovementAndRotation.staticRef.GetComponent <PlayerMovementAndRotation>(); } if (movementAndRotation.GetIsMoving()) { ReduceStamina(movementCostPerSecond * Time.deltaTime); } if (Time.time - lastReductionTime > timeBeforeRegeneretionStarts) { AddStamina(regenerationPerSecond * Time.deltaTime); } }
protected override bool OnIsRecalculationNeeded(Size renderContentSize) { TraceWpf.Line(">>>>> LegendxDate.OnIsRecalculationNeeded()"); //check first if DisplayValue has changed, which most likely comes from LegendScroller bool hasDisplayDateChanged = false; if (displayValueTracked != DisplayValue) { displayValueTracked = DisplayValue; displayDateTracked = DisplayDate = DisplayValue.ToDateTime(); hasDisplayDateChanged = true; } if (displayValueRangeTracked != DisplayValueRange) { displayValueRangeTracked = DisplayValueRange; displayDateRangeTracked = DisplayDateRange = displayValueRangeTracked.ToTimeSpan(); hasDisplayDateChanged = true; } if (!hasDisplayDateChanged) { //if DisplayValue (LegendScroller) hasn't changed, check if DisplayDate has been directly changed if (displayDateTracked != DisplayDate) { displayDateTracked = DisplayDate; displayValueTracked = DisplayValue = displayDateTracked.ToDouble(); hasDisplayDateChanged = true; } if (displayDateRangeTracked != DisplayDateRange) { displayDateRangeTracked = DisplayDateRange; displayValueRangeTracked = DisplayValueRange = displayDateRangeTracked.ToDouble(); hasDisplayDateChanged = true; } } return(base.OnIsRecalculationNeeded(renderContentSize) || hasDisplayDateChanged);//OnIsRecalculationNeeded needs to come first to guarantee its execution }
protected override void Initialize(System.Web.Routing.RequestContext requestContext) { base.Initialize(requestContext); string applicationPath = requestContext.HttpContext.Request.ApplicationPath == "/" ? "" : Request.ApplicationPath; DataTable dt = SSoft.Data.SqlHelper.SelectTable(@"SELECT * From vw_System_Program", new SqlParameter[] { new SqlParameter("@UserInfo_NO", SSoft.Web.Security.User.Emp_ID) }); var programList = dt.AsEnumerable().Select(t => new YMIR.Models.Sys.MenuModel { SystemId = t.Field <Guid>("SYS_SYSTEMNO_Id"), SystemName = t.Field <string>("SYSNO_NAME"), SystemClass = t.Field <string>("SYS_CLASS"), ProgramType = t.Field <string>("PROGRAMNO_NAME"), ProgramId = t.Field <Guid>("ID"), ProgramNo = t.Field <string>("PRGNO"), ProgramName = t.Field <string>("PROGRAMNO_NAME"), ProgramPath = t.Field <string>("PROG_URL1"), ProgarmOrder = t.Field <int>("PROGRAMNO_ORDERID") }).ToList(); this.ProgramList = programList; List <DisplayValue> menu = new List <DisplayValue>(); var systemGroup = programList.OrderBy(t => t.SystemId).GroupBy(t => new { t.SystemId, t.SystemName, t.SystemClass }); int index = 0; foreach (var g1 in systemGroup) { DisplayValue sysDisplayValue = new DisplayValue(); sysDisplayValue.Value = g1.Key.SystemId.ToString(); sysDisplayValue.Display = g1.Key.SystemName.ToString(); sysDisplayValue.Display1 = "m_" + g1.Key.SystemId.ToString(); sysDisplayValue.Display2 = "m_" + g1.Key.SystemId.ToString(); sysDisplayValue.Display3 = "m_" + g1.Key.SystemId.ToString() + " onlink"; sysDisplayValue.Display4 = g1.Key.SystemClass.ToString(); sysDisplayValue.Int01 = index++; menu.Add(sysDisplayValue); sysDisplayValue.ChildDisplayValues = new List <DisplayValue>(); var programTypeGroup = programList.Where(t => t.SystemId == g1.Key.SystemId).OrderBy(t => t.ProgarmOrder).ThenBy(t => t.ProgramId); foreach (var g2 in programTypeGroup) { DisplayValue programDisplayValue = new DisplayValue(); programDisplayValue.Value = g2.ProgramId.ToString(); programDisplayValue.Display = g2.ProgramName; programDisplayValue.Display1 = g2.ProgramNo; programDisplayValue.Display2 = applicationPath + "\\" + g2.ProgramNo; sysDisplayValue.ChildDisplayValues.Add(programDisplayValue); } //var programTypeGroup = programList.Where(t => t.SystemId == g1.Key.SystemId).OrderBy(t => t.ProgarmOrder).ThenBy(t => t.ProgramId).GroupBy(t => new { t.ProgramType }); //foreach (var g2 in programTypeGroup) //{ // DisplayValue typeDisplayValue = new DisplayValue(); // typeDisplayValue.Value = g2.Key.ProgramType.ToString(); // typeDisplayValue.Display = g2.Key.ProgramType.ToString(); // sysDisplayValue.ChildDisplayValues.Add(typeDisplayValue); // typeDisplayValue.ChildDisplayValues = new List<DisplayValue>(); // var programGroup = programList.Where(t => t.SystemId == g1.Key.SystemId && t.ProgramType == g2.Key.ProgramType).OrderBy(t => t.ProgarmOrder).ThenBy(t => t.ProgramId); // foreach (var g3 in programGroup) // { // DisplayValue programDisplayValue = new DisplayValue(); // programDisplayValue.Value = g3.ProgramId.ToString(); // programDisplayValue.Display = g3.ProgramName; // programDisplayValue.Display1 = g3.ProgramNo; // programDisplayValue.Display2 = applicationPath + "\\" + g3.ProgramNo; // typeDisplayValue.ChildDisplayValues.Add(programDisplayValue); // } //} } this.ViewBag.MenuModel = menu; var findProgram = this.IRF_DB.vw_System_Program.Where(t => t.PRGNO == this.ProgramNo); if (findProgram.Count() > 0) { this.Title = findProgram.First().PROGRAMNO_NAME;// + "--" + SSoft.Web.Security.User.FriendPath; if ((this.ViewBag.MenuModel as List <DisplayValue>).Where(t => t.Display == findProgram.First().PROGRAMNO_NAME).Count() > 0) { this.MainMenuId = (this.ViewBag.MenuModel as List <DisplayValue>).Where(t => t.Display == findProgram.First().PROGRAMNO_NAME).First().Int01.ToString(); } //this.MainMenuId = (findProgram.First().WUPage_TabId-1).ToString(); if (this.IRF_DB.vw_System_Program.Where(t => t.PRGNO == this.ProgramNo).Count() > 0) { this.ProgramId = this.IRF_DB.vw_System_Program.Where(t => t.PRGNO == this.ProgramNo).First().PROGRAMNO_Id.ToString(); } } //here the routedata is available string controller_name = ControllerContext.RouteData.Values["Controller"].ToString(); if (string.IsNullOrWhiteSpace(this.ProgramNo)) { this.ProgramNo = controller_name; } this.MainMenuId = "0"; this.IsAllow = false; if (this.ProgramNo.ToUpper() == "HOME") { this.IsAllow = true; } else { if (this.ProgramList != null) { if (this.ProgramList.Where(t => t.ProgramNo.ToUpper() == this.ProgramNo.ToUpper()).Count() > 0) { this.IsAllow = true; } } } }
public override string ToString() { return("{ Pos=" + DisplayPosition.ToString() + "; Value=" + DisplayValue.ToString() + "}"); }
/// <summary> /// Use the Monitor.Log static function to attach information to a transform. /// </summary> /// <returns>The log.</returns> /// <param name="key">The name of the information you wish to Log.</param> /// <param name="value">The array of float you want to display.</param> /// <param name="displayType">The type of display.</param> /// <param name="target">The transform you want to attach the information to. /// </param> /// <param name="camera">Camera used to calculate GUI position relative to /// the target. If null, `Camera.main` will be used.</param> public static void Log( string key, float[] value, Transform target = null, DisplayType displayType = DisplayType.Independent, Camera camera = null ) { if (!s_IsInstantiated) { InstantiateCanvas(); s_IsInstantiated = true; } if (target == null) { target = s_Canvas.transform; } s_TransformCamera[target] = camera; if (!s_DisplayTransformValues.Keys.Contains(target)) { s_DisplayTransformValues[target] = new Dictionary <string, DisplayValue>(); } var displayValues = s_DisplayTransformValues[target]; if (!displayValues.ContainsKey(key)) { var dv = new DisplayValue(); dv.time = Time.timeSinceLevelLoad; dv.floatArrayValues = value; if (displayType == DisplayType.Independent) { dv.valueType = DisplayValue.ValueType.FloatarrayIndependent; } else { dv.valueType = DisplayValue.ValueType.FloatarrayProportion; } displayValues[key] = dv; while (displayValues.Count > 20) { var max = ( displayValues.Aggregate((l, r) => l.Value.time < r.Value.time ? l : r).Key); RemoveValue(target, max); } } else { var dv = displayValues[key]; dv.floatArrayValues = value; if (displayType == DisplayType.Independent) { dv.valueType = DisplayValue.ValueType.FloatarrayIndependent; } else { dv.valueType = DisplayValue.ValueType.FloatarrayProportion; } displayValues[key] = dv; } }
public PointPairListPlus Points(DisplayValue which) { return points[(int)which]; }