Ejemplo n.º 1
0
        protected override void Initialize(object navigationData)
        {
            base.Initialize(navigationData);
            var service = (IConfigurationService)GetService(typeof(IConfigurationService));

            pictureBox1.Image = service.Scope.GetImage();

            _feature = new AllowedVariablesFeature(Module);
            _feature.RewriteSettingsUpdated = this.InitializeListPage;
            _feature.Load();
        }
Ejemplo n.º 2
0
        public AllowedVariableItem(ConfigurationElement element, AllowedVariablesFeature feature)
        {
            this.Element = element;
            _feature     = feature;
            this.Flag    = element == null || element.IsLocallyStored ? "Local" : "Inherited";
            if (element == null)
            {
                return;
            }

            this.Name = (string)element["name"];
        }
Ejemplo n.º 3
0
        public AddAllowedVariableDialog(IServiceProvider serviceProvider, AllowedVariablesFeature feature)
            : base(serviceProvider)
        {
            InitializeComponent();

            var container = new CompositeDisposable();

            FormClosed += (sender, args) => container.Dispose();

            container.Add(
                Observable.FromEventPattern <EventArgs>(btnOK, "Click")
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                if (feature.Items.Any(item => txtName.Text == item.Name))
                {
                    ShowMessage(
                        "The specified server variable already exists.",
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error,
                        MessageBoxDefaultButton.Button1);
                    return;
                }

                Item = new AllowedVariableItem(null, feature)
                {
                    Name = txtName.Text
                };
                DialogResult = DialogResult.OK;
            }));

            container.Add(
                Observable.FromEventPattern <EventArgs>(txtName, "TextChanged")
                .Sample(TimeSpan.FromSeconds(1))
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                btnOK.Enabled = !string.IsNullOrWhiteSpace(txtName.Text);
            }));
        }
Ejemplo n.º 4
0
 public FeatureTaskList(AllowedVariablesFeature owner)
 {
     _owner = owner;
 }