예제 #1
0
        protected override void Initialize(object navigationData)
        {
            base.Initialize(navigationData);
            var service = (IConfigurationService)GetService(typeof(IConfigurationService));

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

            var extensions = new FileExtensionsFeature(Module);

            extensions.RequestFilteringSettingsUpdate = RefreshExtensions;
            extensions.Load();
            tpExtensions.Tag = extensions;
            RefreshExtensions();

            var rules = new FilteringRulesFeature(Module);

            rules.RequestFilteringSettingsUpdate = RefreshRules;
            rules.Load();
            tpRules.Tag = rules;

            var segments = new HiddenSegmentsFeature(Module);

            segments.RequestFilteringSettingsUpdate = RefreshSegments;
            segments.Load();
            tpSegments.Tag = segments;

            var urls = new UrlsFeature(Module);

            urls.RequestFilteringSettingsUpdate = RefreshUrls;
            urls.Load();
            tpUrl.Tag = urls;

            var verbs = new VerbsFeature(Module);

            verbs.RequestFilteringSettingsUpdate = RefreshVerbs;
            verbs.Load();
            tpVerbs.Tag = verbs;

            var headers = new HeadersFeature(Module);

            headers.RequestFilteringSettingsUpdate = RefreshHeaders;
            headers.Load();
            tpHeaders.Tag = headers;

            var queries = new QueryStringsFeature(Module);

            queries.RequestFilteringSettingsUpdate = RefreshQueries;
            queries.Load();
            tpQuery.Tag = queries;
        }
예제 #2
0
        public NewExtensionDialog(IServiceProvider serviceProvider, FileExtensionsFeature feature, bool allowed)
            : base(serviceProvider)
        {
            InitializeComponent();
            Text = string.Format("{0} File Name Extension", allowed ? "Allow" : "Deny");

            var container = new CompositeDisposable();

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

            container.Add(
                Observable.FromEventPattern <EventArgs>(txtName, "TextChanged")
                .Sample(TimeSpan.FromSeconds(1))
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                btnOK.Enabled = !string.IsNullOrWhiteSpace(txtName.Text);
            }));

            container.Add(
                Observable.FromEventPattern <EventArgs>(btnOK, "Click")
                .ObserveOn(System.Threading.SynchronizationContext.Current)
                .Subscribe(evt =>
            {
                Item = new FileExtensionsItem(null)
                {
                    Extension = txtName.Text
                };
                if (feature.Items.Any(item => item.Match(Item)))
                {
                    var service = (IManagementUIService)GetService(typeof(IManagementUIService));
                    service.ShowMessage(
                        "The file extension specified already exists.",
                        Text,
                        MessageBoxButtons.OK,
                        MessageBoxIcon.Error,
                        MessageBoxDefaultButton.Button1);
                    return;
                }

                DialogResult = DialogResult.OK;
            }));
        }
 public FeatureTaskList(FileExtensionsFeature owner)
 {
     _owner = owner;
 }