public void css_check(Text text, Compiler compiler) { switch (word.type) { case Type_value.Style_attribute_tag: foreach (Tag_element element in Tag_element.Base_tags.Values) { text.canvas.selects.add(new Select(element.name, "", Kind_select.Tag)); } break; case Type_value.Style_attribute_id: foreach (Tag_element element in compiler.ids.Values) { text.canvas.selects.add(new Select(element.id, "", Kind_select.Id)); } break; case Type_value.Style_attribute_name: foreach (Tag_element element in compiler.names.Values) { text.canvas.selects.add(new Select(element.nm, "", Kind_select.Name)); } break; case Type_value.Style_attribute_class: foreach (Tag_element element in compiler.classes.Values) { text.canvas.selects.add(new Select(element.cls, "", Kind_select.Css_class)); } break; case Type_value.Style_attribute_att: foreach (Tag_attribute att in Tag_element.Base_tags[word.item.name].attributes) { text.canvas.selects.add(new Select(att.name, "", Kind_select.Tag_attribute)); } break; case Type_value.Style_tag_attribute_value: foreach (Tag_value value in Tag_element.Base_tag_attributes[word.item.name].values) { text.canvas.selects.add(new Select(value.name, "", Kind_select.Tag_value)); } break; case Type_value.Style_attribute_value: foreach(Css_attribute att in Css_attribute.attributes.Values) { text.canvas.selects.add(new Select(att.name, "", Kind_select.Style_value)); } break; } }
public Target(int count, Text text) { this.text = text; word = text.start; pos = count + 1; this.count = count; move(true); compile = html_compile; }
public Target(Target origin) { word = origin.word; pos = origin.pos; text = origin.text; compile = origin.compile; }
public void remove() { if (next == this) return; before.next = next; next.before = before; text.word_count--; text = null; }
public Word(Text text) { this.text = text; next = before = this; line = new Line(this); this.str = "\0"; this.order = 0; this.kind = Kind_word.Start; text.word_count++; this.connect(new Word("\0", Kind_word.End)); }
public Text_page(ScrollViewer scroll) { this.scroll = scroll; Background = Brushes.White; text = new Text(this); this.Focusable = true; this.ContextMenu = new TextContextMenu(this); Children.Add(selects = new Selects() { Visibility = System.Windows.Visibility.Hidden }); this.FocusVisualStyle = null; }
public void set_word(Text text, String input) { if (selected == false) return; Word start, end; start = end = text.from.word; if (Word.In_call(start)) { for (; ; start = start.before) { if (Word.In_call(start.before) == false) break; } for (; ; end = end.next) { if (Word.In_call(end.next) == false) break; } text.from.word = start; text.from.pos = 0; Target to = new Target(text.from); to.word = end; to.pos = to.word.length; text.from.delete(to); } text.from.input(input, false); }
public void check_word(Text text) { if (selects.Count == 0) return; Word start, end; start = end = text.from.word; if (Word.In_call(start)) { for (; ; start = start.before) { if (Word.In_call(start.before) == false) break; } for (; ; end = end.next) { if (Word.In_call(end.next) == false) break; } String str = ""; for (Word now = start; ; now = now.next) { str += now.str; if (now == end) break; } foreach (Select s in selects) { if (s.str.StartsWith(str)) { select(s); return; } } select(null); } else select(selects[0]); }