Exemplo n.º 1
0
        public ApplyStyles(TextController controller, NSTextView text)
        {
            Contract.Requires(text.textStorage().layoutManagers().count() == 1, "expected one layout not " + text.textStorage().layoutManagers().count());

            m_controller = controller;
            m_storage = text.textStorage();
            m_layout = m_storage.layoutManagers().objectAtIndex(0).To<NSLayoutManager>();

            m_current = new CurrentStyles(controller, m_storage);

            Broadcaster.Register("tab stops changed", this);
            Broadcaster.Register("selected line color changed", this);
            Broadcaster.Register("computed style runs", this);
            Broadcaster.Register("text changed", this);

            if (ms_selectedLineColor == null)
                DoSetTempAttrs();

            DoResetTabStops();
            DoApplyParagraphStyles(true);

            ActiveObjects.Add(this);
        }