コード例 #1
0
        public ZeldaUI()
        {
            InitializeComponent();

            settings = Settings.Load();
            state    = State.Load();

            Icon      = Properties.Resources.ZeldaIcon;
            this.Text = $"ZELDA v{Program.version.ToString()}";
            gridFiles.DoubleBuffered(true);
            gridFiles.Columns.Clear();

            jrAPI = new JRiverAPI();
            tabsLeft.TabPages.Clear();

            txtOutput.Margins[1].Width = 0;             // remove default margin
            SetOutputStyle();

            toolStrip1.Renderer = new ToolstripRenderer(Color.PowderBlue);      // renderer to apply a backcolor on Checked toolstrip buttons
            showFunctionHelper(false);

            comboLists.DrawMode  = DrawMode.OwnerDrawFixed;
            comboLists.DrawItem += drawCombobox;

            // this doesn't work, looks like a bug in the Scintilla native control
            // it's supposed to change the representation of [CR] and [LF] symbols
            //int SCI_SETREPRESENTATION = 2665;
            //txtExpression.DirectMessage(SCI_SETREPRESENTATION, Marshal.StringToBSTR("\n"), Marshal.StringToBSTR("\xC2\xB6"));
            //txtExpression.DirectMessage(SCI_SETREPRESENTATION, Marshal.StringToBSTR("\r"), Marshal.StringToBSTR("\xC2\xA4"));
        }
コード例 #2
0
        public void updateFields(List <string> names, JRiverAPI api, bool formatted = true, bool refreshAll = false)
        {
            try
            {
                List <string> fetch = refreshAll ? names : new List <string>();
                if (!refreshAll)
                {
                    foreach (var field in names)
                    {
                        if (!fields.ContainsKey(field.ToLower()))
                        {
                            fetch.Add(field.ToLower());
                        }
                    }
                }

                if (fetch.Count > 0)
                {
                    Dictionary <string, string> values = api.getFieldValues(JRKey, fetch, formatted);
                    if (values == null)
                    {
                        return;
                    }
                    foreach (var key in values.Keys)
                    {
                        fields[key.ToLower()] = values[key];
                    }
                }
            }
            catch { }
        }
コード例 #3
0
        public InsertField(List <string> fields, JRFile file, JRiverAPI api)
        {
            InitializeComponent();

            Icon = Properties.Resources.ZeldaIcon;
            DataTable dt = new DataTable();

            dt.Columns.Add("field");
            dt.Columns.Add("value");
            foreach (var f in fields.OrderBy(f => f))
            {
                dt.Rows.Add(f, file[f]);
            }

            BindingSource bs = new BindingSource();

            bs.DataSource         = dt;
            gridFields.DataSource = bs;
        }