コード例 #1
0
 public SwButtonListener(View button_in, ControlId id_in, bool vibrate_enable_in)
 {
     Log.Info(TAG, "SwButtonListener - key");
     button          = button_in;
     id              = id_in;
     dispatcher      = MessageDispatcher.GetInstance();
     vibrate_enabled = vibrate_enable_in;
 }
コード例 #2
0
ファイル: EditRegexForm.cs プロジェクト: sabrogden/logjoint
        void IView.WriteControl(ControlId ctrl, string value)
        {
            var obj = GetCtrl(ctrl);

            if (obj != null)
            {
                obj.Text = value;
            }
        }
コード例 #3
0
ファイル: EditRegexForm.cs プロジェクト: sabrogden/logjoint
        void IView.SetControlVisibility(ControlId ctrl, bool value)
        {
            var obj = GetCtrl(ctrl);

            if (obj != null)
            {
                obj.Visible = value;
            }
        }
コード例 #4
0
        void IView.EnableControl(ControlId ctrl, bool enable)
        {
            var c = GetControl(ctrl);

            if (c is NSTextField)
            {
                ((NSTextField)c).Enabled = enable;
            }
        }
コード例 #5
0
        void IView.ResetSelection(ControlId ctrl)
        {
            var tv = (GetControl(ctrl) as NSTextView);

            if (tv != null)
            {
                tv.SelectedRange = new NSRange();
            }
        }
        private string getUniqueId()
        {
            int    from     = ControlId.IndexOf("_ctl") + "_ctl".Length;
            int    to       = ControlId.LastIndexOf("_");
            string index    = ControlId.Substring(from, to - from);
            string uniqueId = "ctl" + index;

            return(uniqueId);
        }
コード例 #7
0
ファイル: EditRegexForm.cs プロジェクト: sabrogden/logjoint
        void IView.EnableControl(ControlId ctrl, bool enable)
        {
            var obj = GetCtrl(ctrl);

            if (obj != null)
            {
                obj.Enabled = enable;
            }
        }
コード例 #8
0
        void IView.SetLabelProps(ControlId labelId, string text, Color?color)
        {
            var ctrl = GetCtrl(labelId);

            ctrl.Text = text;
            if (color != null)
            {
                ctrl.ForeColor = color.Value.ToSystemDrawingObject();
            }
        }
コード例 #9
0
        void IView.SetControlOptions(ControlId id, string [] options)
        {
            var cb = (NSComboBox)GetControl(id);

            cb.RemoveAll();
            foreach (var opt in options)
            {
                cb.Add(new NSString(opt));
            }
        }
コード例 #10
0
        void IView.SetLabelProps(ControlId labelId, string text, ModelColor?color)
        {
            var ctrl = GetCtrl(labelId);

            ctrl.Text = text;
            if (color != null)
            {
                ctrl.ForeColor = color.Value.ToColor();
            }
        }
コード例 #11
0
        public VJoyButtonControl(ControlInfo controlInfo, ControlId controlId, Expression <FieldSelector <uint> > selector, int bit)
            : base(controlInfo, controlId)
        {
            Guard.NotNull(selector, nameof(selector));

            _getValueDelegate = MakeGetValueDelegate(selector);
            _setValueDelegate = MakeSetValueDelegate(selector);

            _setBitMask   = (uint)1 << bit;
            _unsetBitMask = ~_setBitMask;
        }
コード例 #12
0
        void IView.SetLabelProps(ControlId labelId, string text, ModelColor color)
        {
            var ctrl = GetControl(labelId);

            if (ctrl == null)
            {
                return;
            }
            ctrl.StringValue = text;
            ctrl.TextColor   = color.ToColor().ToNSColor();
        }
コード例 #13
0
        void IView.SetControlOptions(ControlId id, string[] options)
        {
            var cb = GetControl(id) as ComboBox;

            if (cb == null)
            {
                return;
            }
            cb.Items.Clear();
            cb.Items.AddRange(options);
        }
コード例 #14
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Returns HashCode</returns>
 public override int GetHashCode()
 {
     return(String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|",
                          this.ControlProperties.Aggregate(0, (acc, next) => acc += next.GetHashCode()),
                          Type.GetHashCode(),
                          CustomWebPartName?.GetHashCode() ?? 0,
                          JsonControlData?.GetHashCode() ?? 0,
                          ControlId.GetHashCode(),
                          Order.GetHashCode(),
                          Column.GetHashCode()
                          ).GetHashCode());
 }
コード例 #15
0
        void IView.ModifyControl(ControlId id, string text, bool?enabled)
        {
            var ctrl = GetControl(id);

            if (text != null)
            {
                ctrl.Text = StringUtils.NormalizeLinebreakes(text);
            }
            if (enabled != null)
            {
                ctrl.Enabled = enabled.Value;
            }
        }
コード例 #16
0
        void IView.SetControlVisibility(ControlId ctrl, bool value)
        {
            var v = GetControl(ctrl) as NSView;

            if (ctrl == ControlId.EmptyReLabel)
            {
                v = emptyReContainer;
            }
            if (v != null)
            {
                v.Hidden = !value;
            }
        }
コード例 #17
0
        void IView.SetLabelProps(ControlId labelId, string text, Color?color)
        {
            var ctrl = GetControl(labelId);

            if (ctrl == null)
            {
                return;
            }
            ctrl.StringValue = text;
            if (color != null)
            {
                ctrl.TextColor = color.Value.ToNSColor();
            }
        }
コード例 #18
0
        Control GetCtrl(ControlId ctrl)
        {
            switch (ctrl)
            {
            case ControlId.HeaderLabel: return(headerLabel);

            case ControlId.CompanyNameEdit: return(companyNameTextBox);

            case ControlId.FormatNameEdit: return(formatNameTextBox);

            case ControlId.DescriptionEdit: return(descriptionTextBox);

            default: return(null);
            }
        }
コード例 #19
0
        Control GetCtrl(ControlId id)
        {
            switch (id)
            {
            case ControlId.HeaderReStatusLabel: return(headerReStatusLabel);

            case ControlId.XsltStatusLabel: return(xsltStatusLabel);

            case ControlId.TestStatusLabel: return(testStatusLabel);

            case ControlId.SampleLogStatusLabel: return(sampleLogStatusLabel);

            default: return(null);
            }
        }
コード例 #20
0
 string IView.this[ControlId id]
 {
     get
     {
         return(GetCtrl(id)?.Text ?? "");
     }
     set
     {
         var ctrl = GetCtrl(id);
         if (ctrl != null)
         {
             ctrl.Text = value;
         }
     }
 }
コード例 #21
0
        NSTextField GetControl(ControlId id)
        {
            View.EnsureCreated();
            switch (id)
            {
            case ControlId.HeaderReStatusLabel: return(headerReStatusLabel);

            case ControlId.XsltStatusLabel: return(xsltStatusLabel);

            case ControlId.TestStatusLabel: return(testStatusLabel);

            case ControlId.SampleLogStatusLabel: return(sampleLogStatusLabel);

            default: return(null);
            }
        }
コード例 #22
0
 private void SetInputBackground(View vin, ControlId id)
 {
     Log.Debug(TAG, "SetInputBackground");
     if (id == selected_control)
     {
         vin.SetBackgroundColor(Android.Graphics.Color.SkyBlue);
     }
     else if (SwSettings.GetControlMotion(id).type == MotionType.Invalid)
     {
         vin.SetBackgroundColor(Android.Graphics.Color.Red);
     }
     else
     {
         vin.SetBackgroundColor(Android.Graphics.Color.Transparent);
     }
 }
コード例 #23
0
        NSTextField GetControl(ControlId id)
        {
            switch (id)
            {
            case ControlId.HeaderReStatusLabel: return(headerReStatusLabel);

            case ControlId.BodyReStatusLabel: return(bodyReStatusLabel);

            case ControlId.FieldsMappingLabel: return(fieldsMappingLabel);

            case ControlId.TestStatusLabel: return(testStatusLabel);

            case ControlId.SampleLogStatusLabel: return(sampleLogStatusLabel);

            default: return(null);
            }
        }
コード例 #24
0
        void IView.WriteControl(ControlId ctrl, string value)
        {
            var c = GetControl(ctrl);

            if (c is NSTextField)
            {
                ((NSTextField)c).StringValue = value;
            }
            else if (c is NSTextView)
            {
                ((NSTextView)c).Value = value;
            }
            else if (c is NSWindow)
            {
                ((NSWindow)c).Title = value;
            }
        }
コード例 #25
0
        Control GetControl(ControlId ctrl)
        {
            switch (ctrl)
            {
            case ControlId.RemoveFieldButton: return(removeFieldButton);

            case ControlId.NameComboBox: return(nameComboBox);

            case ControlId.CodeTypeComboBox: return(codeTypeComboBox);

            case ControlId.CodeTextBox: return(codeTextBox);

            case ControlId.AvailableInputFieldsContainer: return(availableInputFieldsPanel);

            default: return(null);
            }
        }
コード例 #26
0
        string IView.ReadControl(ControlId id)
        {
            var obj = GetControl(id);

            if (obj is NSTextView)
            {
                return(((NSTextView)obj).Value);
            }
            else if (obj is NSButton)
            {
                return(((NSButton)obj).StringValue);
            }
            else if (obj is NSComboBox)
            {
                return(((NSComboBox)obj).StringValue);
            }
            return(null);
        }
コード例 #27
0
        object IView.ReadControlValue(ControlId id)
        {
            switch (id)
            {
            case ControlId.IndependentLogsModeButton:
                return(independentLogsModeButton.State == NSCellStateValue.On);

            case ControlId.RotatedLogModeButton:
                return(rotatedLogModeButton.State == NSCellStateValue.On);

            case ControlId.FileSelector:
                return(fileTextField.StringValue);

            case ControlId.FolderSelector:
                return(folderTextField.StringValue);
            }
            return(null);
        }
コード例 #28
0
        object IView.ReadControlValue(ControlId id)
        {
            switch (id)
            {
            case ControlId.IndependentLogsModeButton:
                return(independentLogModeRadioButton.Checked);

            case ControlId.RotatedLogModeButton:
                return(rotatedLogModeRadioButton.Checked);

            case ControlId.FileSelector:
                return(filePathTextBox.Text);

            case ControlId.FolderSelector:
                return(folderPartTextBox.Text);
            }
            return(null);
        }
コード例 #29
0
        void IView.WriteControlValue(ControlId id, object value)
        {
            switch (id)
            {
            case ControlId.IndependentLogsModeButton:
                independentLogsModeButton.State = ((bool)value) ? NSCellStateValue.On : NSCellStateValue.Off;
                break;

            case ControlId.RotatedLogModeButton:
                rotatedLogModeButton.State = ((bool)value) ? NSCellStateValue.On : NSCellStateValue.Off;
                break;

            case ControlId.FileSelector:
                fileTextField.StringValue = (string)value;
                break;

            case ControlId.FolderSelector:
                folderTextField.StringValue = (string)value;
                break;
            }
        }
コード例 #30
0
        void IView.WriteControlValue(ControlId id, object value)
        {
            switch (id)
            {
            case ControlId.IndependentLogsModeButton:
                independentLogModeRadioButton.Checked = (bool)value;
                break;

            case ControlId.RotatedLogModeButton:
                rotatedLogModeRadioButton.Checked = (bool)value;
                break;

            case ControlId.FileSelector:
                filePathTextBox.Text = (string)value;
                break;

            case ControlId.FolderSelector:
                folderPartTextBox.Text = (string)value;
                break;
            }
        }