protected override Control AddEditor(Control container)
        {
            NameEditor ne = new NameEditor();

            ne.ID       = Name;
            ne.CssClass = "nameEditor";
            ne.WhitespaceReplacement = WhitespaceReplacement;
            ne.ToLower                 = ToLower;
            ne.ShowKeepUpdated         = ShowKeepUpdated;
            ne.KeepUpdatedDefaultValue = KeepUpdatedDefaultValue;
            ne.KeepUpdated.Text        = KeepUpdatedText;
            ne.KeepUpdated.ToolTip     = KeepUpdatedToolTip;
            ne.Placeholder(GetLocalizedText("FromDatePlaceholder") ?? Placeholder);
            container.Controls.Add(ne);
            if (Focus)
            {
                ne.Focus();
            }
            return(ne);
        }
        protected override Control AddEditor(Control container)
        {
            var ne = new NameEditor
            {
                ID       = Name,
                CssClass = "nameEditor",
                WhitespaceReplacement = ' ',     // gets trimmed to ''
                ToLower         = false,
                ShowKeepUpdated = ShowKeepUpdated
            };

            ne.KeepUpdated.Text    = KeepUpdatedText;
            ne.KeepUpdated.ToolTip = KeepUpdatedToolTip;
            ne.Placeholder(GetLocalizedText("FromDatePlaceholder") ?? Placeholder);
            container.Controls.Add(ne);
            if (Focus)
            {
                ne.Focus();
            }
            return(ne);
        }
Example #3
0
        public void Init(FlexDesignerHostServices provider, ReportParameterValues parameterValues)
        {
            Debug.Assert(parameterValues != null);

            _provider = provider;
            C1FlexReport anotherReport;

            GetReportParameterValuesEnviroment(parameterValues, out _scriptNamePrefix, out anotherReport);
            _report = parameterValues.Report;

            _updating = true;

            _valueEditor = new ValueEditor(c1FlexGrid1);
            _valueEditor.Init(provider, _report.DataSourceName, "");
            C1ThemeController.ApplyThemeToControlTree(_valueEditor, MainForm.TheMainForm.CachedTheme);
            _nameEditor = new NameEditor(c1FlexGrid1);
            _nameEditor.Init(provider, anotherReport);
            C1ThemeController.ApplyThemeToControlTree(_nameEditor, MainForm.TheMainForm.CachedTheme);

            var labelIndex = c1FlexGrid1.Cols.Fixed;
            var valueIndex = labelIndex + 1;

            foreach (var item in parameterValues)
            {
                var row = c1FlexGrid1.Rows.Add();
                row[labelIndex] = ScriptValueHelper.ToString(item.Name);
                row[valueIndex] = ScriptValueHelper.ToString(item.Value);
            }

            c1FlexGrid1.Col = labelIndex;
            if (parameterValues.Count > 0)
            {
                c1FlexGrid1.Row = c1FlexGrid1.Rows.Fixed;
            }

            UpdateButtonsSatus();

            _updating = false;
        }
        public override void UpdateEditor(ContentItem item, Control editor)
        {
            NameEditor ne = (NameEditor)editor;

            ne.Text   = item.Name;
            ne.Prefix = "/";
            ne.Suffix = item.Extension;
            try
            {
                if (Context.UrlParser.StartPage == item || item.Parent == null)
                {
                    ne.Prefix = "";
                    ne.Suffix = "";
                }
                else if (Context.UrlParser.StartPage != item.Parent)
                {
                    string parentUrl = item.Parent.Url;
                    if (!parentUrl.Contains("?"))
                    {
                        int extensionIndex = parentUrl.Length;
                        if (!string.IsNullOrEmpty(item.Parent.Extension))
                        {
                            extensionIndex = parentUrl.IndexOf(item.Extension, StringComparison.InvariantCultureIgnoreCase);
                        }
                        string prefix = parentUrl.Substring(0, extensionIndex) + "/";
                        if (prefix.Length > 60)
                        {
                            prefix = prefix.Substring(0, 50) + ".../";
                        }
                        ne.Prefix = prefix;
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Example #5
0
 private void Start()
 {
     Instance         = this;
     _inputField.text = PlayerPrefs.GetString(KEY, SystemInfo.deviceName);
 }