Exemplo n.º 1
0
 public void Populate(IEditorData data)
 {
     if (data == null)
     {
         return;
     }
     m_helper.StartPopulating();
     if (m_dictionary != null)
     {
         string value = m_helper.Populate(data) ?? string.Empty;
         string dropdownValue;
         if (m_dictionary.TryGetValue(value, out dropdownValue))
         {
             lstDropdown.Text = dropdownValue;
         }
         else
         {
             if (lstDropdown.IsEditable)
             {
                 lstDropdown.Text = value;
             }
             else
             {
                 lstDropdown.Text = string.Empty;
             }
         }
     }
     else
     {
         lstDropdown.Text = m_helper.Populate(data);
     }
     lstDropdown.IsEnabled = m_helper.CanEdit(data) && !data.ReadOnly;
     m_helper.FinishedPopulating();
 }
Exemplo n.º 2
0
 public void Populate(IEditorData data)
 {
     if (data == null)
     {
         return;
     }
     m_helper.StartPopulating();
     textBox.Text = m_helper.Populate(data);
     m_helper.FinishedPopulating();
 }
Exemplo n.º 3
0
        public void Populate(IEditorData data)
        {
            m_data = data;
            if (data == null)
            {
                return;
            }
            m_helper.StartPopulating();

            string value = m_helper.Populate(data) ?? string.Empty;

            // Don't change the SimpleMode setting if we're just repopulating because this expression has
            // been saved
            if (!m_saving)
            {
                SimpleMode   = IsSimpleExpression(value);
                TemplateMode = IsTemplateExpression(value);
            }

            PopulateSimpleControl();

            if (SimpleMode)
            {
                SimpleValue = ConvertToSimpleExpression(value);
            }

            if (TemplateMode)
            {
                PopulateTemplate(value);
            }

            txtExpression.Text = value;

            txtExpression.IsEnabled  = m_helper.CanEdit(data);
            txtExpression.IsReadOnly = data.ReadOnly;

            lstType.IsEnabled     = txtExpression.IsEnabled && !data.ReadOnly;
            lstTemplate.IsEnabled = txtExpression.IsEnabled && !data.ReadOnly;
            cmdInsert.IsEnabled   = txtExpression.IsEnabled && !data.ReadOnly;

            if (m_simpleEditor is TextBox)
            {
                ((TextBox)m_simpleEditor).IsReadOnly = data.ReadOnly;
            }
            else
            {
                if (m_simpleEditor != null)
                {
                    m_simpleEditor.IsEnabled = !data.ReadOnly;
                }
            }

            m_helper.FinishedPopulating();
        }
Exemplo n.º 4
0
 public void Populate(IEditorData data)
 {
     if (data == null)
     {
         return;
     }
     m_helper.StartPopulating();
     checkBox.IsChecked = m_helper.Populate(data);
     checkBox.IsEnabled = !data.ReadOnly && m_helper.CanEdit(data);
     m_helper.FinishedPopulating();
 }
Exemplo n.º 5
0
 public void Populate(IEditorData data)
 {
     m_data = data;
     if (data == null)
     {
         return;
     }
     m_helper.StartPopulating();
     ctlNumber.Value     = m_helper.Populate(data);
     ctlNumber.IsEnabled = m_helper.CanEdit(data) && !data.ReadOnly;
     m_helper.FinishedPopulating();
 }
Exemplo n.º 6
0
 public void Populate(IEditorData data)
 {
     if (data == null)
     {
         return;
     }
     m_helper.StartPopulating();
     textBox.Text       = m_helper.Populate(data);
     textBox.IsEnabled  = m_helper.CanEdit(data);
     textBox.IsReadOnly = data.ReadOnly;
     m_helper.FinishedPopulating();
 }
Exemplo n.º 7
0
 public void Populate(IEditorData data)
 {
     m_data = data;
     if (data == null)
     {
         return;
     }
     m_helper.StartPopulating();
     fileDropDown.RefreshFileList();
     fileDropDown.Filename = m_helper.Populate(data);
     fileDropDown.Enabled  = m_helper.CanEdit(data) && !data.ReadOnly;
     m_helper.FinishedPopulating();
 }
Exemplo n.º 8
0
 public void Populate(IEditorData data)
 {
     m_data = data;
     if (data == null)
     {
         m_value = null;
         return;
     }
     m_helper.StartPopulating();
     m_value            = m_helper.Populate(data);
     textBox.Text       = (m_value != null) ? m_value.Pattern : string.Empty;
     m_oldValue         = textBox.Text;
     textBox.IsEnabled  = m_helper.CanEdit(data);
     textBox.IsReadOnly = data.ReadOnly;
     m_helper.FinishedPopulating();
 }
Exemplo n.º 9
0
        public void Populate(IEditorData data)
        {
            m_data = data;

            if (data == null)
            {
                CurrentList = null;
                return;
            }

            m_helper.StartPopulating();

            CurrentList       = m_helper.Populate(data);
            listBox.IsEnabled = !data.ReadOnly && m_helper.CanEdit(data);
            toolbar.ReadOnly  = !listBox.IsEnabled;

            m_helper.FinishedPopulating();
        }
Exemplo n.º 10
0
        public void Populate(IEditorData data)
        {
            if (data == null)
            {
                return;
            }
            m_helper.StartPopulating();
            var value = m_helper.Populate(data);

            if (value != null)
            {
                value = value.Replace("<br/>", Environment.NewLine).Replace("<br />", Environment.NewLine);
            }
            textBox.Text       = value;
            textBox.IsEnabled  = m_helper.CanEdit(data);
            textBox.IsReadOnly = data.ReadOnly;
            m_helper.FinishedPopulating();
        }
Exemplo n.º 11
0
        public void Populate(IEditorData data)
        {
            m_data         = data;
            m_parentScript = data as ScriptCommandEditorData;
            if (data == null)
            {
                Populate((IEditableScripts)null);
                return;
            }
            m_helper.StartPopulating();

            m_readOnly = data.ReadOnly;
            Populate(m_helper.Populate(data));

            cmdAddScript.Visibility = (m_helper.CanEdit(data) && !m_readOnly) ? Visibility.Visible : Visibility.Collapsed;

            m_helper.FinishedPopulating();
        }
Exemplo n.º 12
0
        public void Populate(IEditorData data)
        {
            if (data == null)
            {
                return;
            }
            m_helper.StartPopulating();

            string filename = m_helper.Populate(data);

            textEditor.IsEnabled = m_helper.CanEdit(data) && !data.ReadOnly && !string.IsNullOrEmpty(filename);
            SetSyntaxHighlighting("JavaScript");
            UseFolding = false;
            if (!string.IsNullOrEmpty(filename))
            {
                m_filename = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(m_helper.Controller.Filename), filename);
                Load(m_filename);
            }

            m_helper.FinishedPopulating();
        }