virtual public IList <style_option_types> getUnUsed(styles style, geometric_events events) { IList <style_option_types> unUsed = new List <style_option_types>(); //IList<style_options> used = getUsed(); if (style.id > 0) { style_option_types[] all_op = ActiveRecordBase <style_option_types> .FindAll(); foreach (style_option_types ops in all_op) { if (ops.style_type.Contains(style.type)) { if (style._option != null && style._option.Count > 0) { foreach (style_options op in style._option) { if (this.id == op.user_event.id) { if (op.value == "") { unUsed.Add(ops); } } } } else { unUsed.Add(ops); } } } } return(unUsed); }
virtual public IList <style_option_types> getRemaining(styles style, geometric_events events) { IList <style_option_types> remaining = new List <style_option_types>(); style_option_types[] all_op = ActiveRecordBase <style_option_types> .FindAll(); if (style.id > 0) { IList <style_options> used = getUsed(style, events); IList <style_option_types> unUsed = getUnUsed(style, events); foreach (style_option_types ops in all_op) { bool op_added = false; if (used != null) { foreach (style_options op in used) { if (op.type != ops) { remaining.Add(ops); op_added = true; } } if (!op_added && (unUsed == null || !unUsed.Contains(ops))) { remaining.Add(ops); } } else if (unUsed == null || !unUsed.Contains(ops)) { remaining.Add(ops); } } } else { foreach (style_option_types ops in all_op) { remaining.Add(ops); } } return(remaining); }