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();
        }
示例#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"];
        }
示例#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);
            }));
        }
示例#4
0
 public FeatureTaskList(AllowedVariablesFeature owner)
 {
     _owner = owner;
 }