public int CompareTo(object obj) { BPObject _obj = (BPObject)obj; if (extension == _obj.extension) { return(name.CompareTo(_obj.name)); } else { return(extension.CompareTo(_obj.extension)); } }
private void SetBPObjects() { //ObservableCollection<IntellisenseObject> Iobjects = App.IntellisenseObjects; BpObjects bpObj = new BpObjects(); foreach (var obj in App.IntellisenseObjects) { if (obj.Class.Type == IntellisenseType.Keyword) { foreach (var kw in obj.Keywords) { Member member = new Member(); member.name = kw.Name; member.type = MemberTypes.Custom; foreach (var w in kw.Summary) { member.summary += w; member.summary += " "; } member.other.Add("example", kw.Example); BpObjects.keywords.Add(member); } } else { var sbObj = new BPObject(); BpObjects.objects.Add(sbObj); sbObj.extension = "SmallBasicEV3Extension"; sbObj.name = obj.Class.Name; foreach (var w in obj.Class.Summary) { sbObj.summary += w; sbObj.summary += " "; } foreach (var method in obj.Methods) { var member = new Member(); sbObj.members.Add(member); member.name = method.Name; member.type = MemberTypes.Method; foreach (var w in method.Summary) { member.summary += w; member.summary += " "; } member.returns = method.Return; int i = 0; foreach (var param in method.ParamName) { member.arguments.Add(param, method.ParamSummary[i]); i++; } if (method.Example != "") { member.other.Add("example", method.Example); } } foreach (var prop in obj.Property) { var member = new Member(); sbObj.members.Add(member); member.name = prop.Name; member.type = MemberTypes.Method; foreach (var w in prop.Summary) { member.summary += w; member.summary += " "; } member.returns = prop.Return; int i = 0; foreach (var param in prop.ParamName) { member.arguments.Add(param, prop.ParamSummary[i]); i++; } if (prop.Example != "") { member.other.Add("example", prop.Example); } } foreach (var ev in obj.Event) { var member = new Member(); sbObj.members.Add(member); member.name = ev.Name; member.type = MemberTypes.Method; foreach (var w in ev.Summary) { member.summary += w; member.summary += " "; } member.returns = ev.Return; int i = 0; foreach (var param in ev.ParamName) { member.arguments.Add(param, ev.ParamSummary[i]); i++; } if (ev.Example != "") { member.other.Add("example", ev.Example); } } } } }