internal static _SetValue SetValue() { if (_SetValueFunc == null) { _SetValueFunc = (_SetValue)Marshal.GetDelegateForFunctionPointer( NativeLibrary.GetExport( Torque3D.Torque3DLibHandle, "fnGuiFilterCtrl_setValue"), typeof(_SetValue)); } return(_SetValueFunc); }
internal static _SetValue SetValue() { if (_SetValueFunc == null) { _SetValueFunc = (_SetValue)Marshal.GetDelegateForFunctionPointer( Torque3D.DllLoadUtils.GetProcAddress( Torque3D.Torque3DLibHandle, "fnGuiFilterCtrl_setValue"), typeof(_SetValue)); } return(_SetValueFunc); }
public ValueInfoEnum( string tag, _GetValue <T> getValue, string description, bool spacerFollows, _SetValue <T> setValue, VT <T>[] possibleValues, InlineParamVis inlineParam) : base(tag, description, spacerFollows, inlineParam) { this.getValue = getValue; this.setValue = setValue; this.possibleValues = possibleValues; }
public ValueInfoDouble( string tag, _GetValue <double> getValue, double defaultValue, string description, bool spacerFollows, _SetValue <double> setValue, InlineParamVis inlineParam) : base(tag, description, spacerFollows, inlineParam) { this.getValue = getValue; this.defaultValue = defaultValue; this.setValue = setValue; }
public string[] sort_tiobe_filename_demo(string[] files) { int nCount = files.Length; string[] sorted = new string[nCount]; // init buff int[,] buff = new int[11, 3]; int n = 0; Regex regex = new Regex("^TIOBE Index for (\\w+) (\\d{4})\\.html$"); for (int i = 0; i < nCount; i++) { buff[i, 0] = buff[i, 1] = i; MatchCollection ms = regex.Matches(files[i]); int nDatespan = 0; if (ms.Count == 1 && ms[0].Groups.Count == 3) { int nMonth = 0; _month.TryGetValue(ms[0].Groups[1].ToString(), out nMonth); nDatespan = Convert.ToInt32(ms[0].Groups[2].ToString()) * 100 + nMonth; // Console.WriteLine(ms[0].Groups[2] + ", " + ms[0].Groups[1]); } else { nDatespan = ++n; } buff[i, 2] = nDatespan; } // Func<int, int> GetIndex = (i) => { return buff[i, 1]; }; // Func<int, int> GetData = (i) => { return buff[GetIndex(i), 2]; } _GetValue GetIndex = (i) => { return(buff[i, 1]); }; _SetValue SetIndex = (i, nn) => { return(buff[i, 1] = nn); }; _GetValue GetData = (i) => { return(buff[GetIndex(i), 2]); }; // insertion sort string for (int i = 0; i < nCount - 1; i++) { int nMin = i; for (int j = i + 1; j < nCount; j++) { if (GetData(j) < GetData(nMin)) { nMin = j; } } if (i != nMin) { int t = GetIndex(i); SetIndex(i, GetIndex(nMin)); SetIndex(nMin, t); } } for (int i = 0; i < nCount; i++) { // Console.WriteLine(" " + buff[i, 0] + " " + buff[i, 1] + " " + buff[i, 2] + " "); sorted[i] = files[GetIndex(i)]; } return(sorted); }