private void ExtendMenu()
        {
            //TODO: add menu items here, normally by calling the "Add" method on
            //		on the WorkItem.UIExtensionSites collection. For an example
            //		See: ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/02-04-340-Showing_UIElements.htm
            UIExtensionSite MainMenuSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainMenu];
            ToolStripMenuItem TopTi = new ToolStripMenuItem("Encryption");
            ToolStripMenuItem ti1   = new ToolStripMenuItem("Add Visible Text Watermark");
            ToolStripMenuItem ti2   = new ToolStripMenuItem("Add Visible Image Watermark");
            ToolStripMenuItem ti3   = new ToolStripMenuItem("Image Authentication");
            ToolStripMenuItem ti4   = new ToolStripMenuItem("Image Steganography");

            TopTi.DropDownItems.Add(ti1);
            TopTi.DropDownItems.Add(ti2);
            TopTi.DropDownItems.Add(ti3);
            TopTi.DropDownItems.Add(ti4);

            MainMenuSite.Add(TopTi);

            this.WorkItem.Commands[CommandNames.visibleTextWatermark].
            AddInvoker(ti1, "Click");
            this.WorkItem.Commands[CommandNames.visibleImageWatermark].
            AddInvoker(ti2, "Click");
            this.WorkItem.Commands[CommandNames.imageAuthentication].
            AddInvoker(ti3, "Click");
            this.WorkItem.Commands[CommandNames.imageSteganography].
            AddInvoker(ti4, "Click");
        }
        private void ExtendMenu()
        {
            //TODO: add menu items here, normally by calling the "Add" method on
            //		on the WorkItem.UIExtensionSites collection. For an example
            //		See: ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/02-04-340-Showing_UIElements.htm
            UIExtensionSite MainMenuSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainMenu];
            ToolStripMenuItem TopTi = new ToolStripMenuItem("Enchancement");
            ToolStripMenuItem ti1   = new ToolStripMenuItem("Image Smoothing");
            ToolStripMenuItem ti2   = new ToolStripMenuItem("Adjustments");
            ToolStripMenuItem ti3   = new ToolStripMenuItem("Invert");
            ToolStripMenuItem ti4   = new ToolStripMenuItem("Sharpen");

            ToolStripMenuItem ti1_1 = new ToolStripMenuItem("Gaussian Smooth");
            ToolStripMenuItem ti1_2 = new ToolStripMenuItem("Median Smooth");
            ToolStripMenuItem ti1_3 = new ToolStripMenuItem("Adaptive Smooth");
            ToolStripMenuItem ti1_4 = new ToolStripMenuItem("Blur Smooth");
            ToolStripMenuItem ti1_5 = new ToolStripMenuItem("Conservative Smooth");

            ToolStripMenuItem ti2_1 = new ToolStripMenuItem("Brightness");
            ToolStripMenuItem ti2_2 = new ToolStripMenuItem("Contrast");
            ToolStripMenuItem ti2_3 = new ToolStripMenuItem("Gamma");

            ti1.DropDownItems.Add(ti1_1);
            ti1.DropDownItems.Add(ti1_2);
            ti1.DropDownItems.Add(ti1_3);
            ti1.DropDownItems.Add(ti1_4);
            ti1.DropDownItems.Add(ti1_5);

            ti2.DropDownItems.Add(ti2_1);
            ti2.DropDownItems.Add(ti2_2);
            ti2.DropDownItems.Add(ti2_3);

            TopTi.DropDownItems.Add(ti1);
            TopTi.DropDownItems.Add(ti2);
            TopTi.DropDownItems.Add(ti3);
            TopTi.DropDownItems.Add(ti4);

            MainMenuSite.Add(TopTi);
            this.WorkItem.Commands[CommandNames.smooth_gaussian].
            AddInvoker(ti1_1, "Click");
            this.WorkItem.Commands[CommandNames.smooth_median].
            AddInvoker(ti1_2, "Click");
            this.WorkItem.Commands[CommandNames.smooth_adaptive].
            AddInvoker(ti1_3, "Click");
            this.WorkItem.Commands[CommandNames.smooth_blur].
            AddInvoker(ti1_4, "Click");
            this.WorkItem.Commands[CommandNames.smooth_conservative].
            AddInvoker(ti1_5, "Click");
            this.WorkItem.Commands[CommandNames.brightness].
            AddInvoker(ti2_1, "Click");
            this.WorkItem.Commands[CommandNames.contrast].
            AddInvoker(ti2_2, "Click");
            this.WorkItem.Commands[CommandNames.gamma_correction].
            AddInvoker(ti2_3, "Click");
            this.WorkItem.Commands[CommandNames.invert].
            AddInvoker(ti3, "Click");
            this.WorkItem.Commands[CommandNames.sharpen].
            AddInvoker(ti4, "Click");
        }
Beispiel #3
0
        public void CanEnumerateItemsInSite()
        {
            MockAdapter     adapter = new MockAdapter();
            UIExtensionSite site    = new UIExtensionSite(adapter);
            object          obj1    = new object();
            object          obj2    = new object();

            site.Add(obj1);
            site.Add(obj2);

            bool foundObj1 = false;
            bool foundObj2 = false;

            foreach (object obj in site)
            {
                if (object.ReferenceEquals(obj, obj1))
                {
                    foundObj1 = true;
                }
                else if (object.ReferenceEquals(obj, obj2))
                {
                    foundObj2 = true;
                }
            }

            Assert.IsTrue(foundObj1);
            Assert.IsTrue(foundObj2);
        }
        private void ExtendToolStrip()
        {
            UIExtensionSite MainToolbarSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainToolbar];

            ToolStripButton ts = new ToolStripButton();
            Image           im = Image.FromFile("sharp.jpg");

            ts.Image = im;
            MainToolbarSite.Add(ts);

            ToolStripButton ts1 = new ToolStripButton();
            Image           im1 = Image.FromFile("inverted.jpg");

            ts1.Image = im1;
            MainToolbarSite.Add(ts1);

            ToolStripSeparator sp = new ToolStripSeparator();

            MainToolbarSite.Add(sp);

            ts.ToolTipText  = "Sharpen Image";
            ts1.ToolTipText = "Invert Image";

            this.WorkItem.Commands[CommandNames.sharpen].
            AddInvoker(ts, "Click");
            this.WorkItem.Commands[CommandNames.invert].
            AddInvoker(ts1, "Click");
        }
        private void ExtendToolStrip()
        {
            UIExtensionSite MainToolbarSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainToolbar];

            ToolStripButton ts = new ToolStripButton();
            Image           im = Image.FromFile("missilel.png");

            ts.Image = im;
            MainToolbarSite.Add(ts);

            ToolStripButton ts1 = new ToolStripButton();
            Image           im1 = Image.FromFile("quant.gif");

            ts1.Image = im1;
            MainToolbarSite.Add(ts1);

            ToolStripSeparator sp = new ToolStripSeparator();

            MainToolbarSite.Add(sp);

            ts.ToolTipText  = "Ballistic Testing";
            ts1.ToolTipText = "Detect Origin";

            this.WorkItem.Commands[CommandNames._ballistics_testing].
            AddInvoker(ts, "Click");
            this.WorkItem.Commands[CommandNames._detect_source].
            AddInvoker(ts1, "Click");
        }
 public void ServiceCustomerAction(object caller, object target)
 {
     if (WorkItem.UIExtensionSites.Contains(UIExtensionSiteNames.CustomerQueueLinks))
     {
         UIExtensionSite site = WorkItem.UIExtensionSites[UIExtensionSiteNames.CustomerQueueLinks];
         CreateAndRegisterLinkLabel(site, Resources.ServiceCustomerLabelText, CommandNames.ServiceCustomer);
     }
 }
Beispiel #7
0
 public void AddMenuItem(UIExtensionSite site, ToolStripMenuItem item)
 {
     switch (site)
     {
     case UIExtensionSite.Options:
         commandsToolStripMenuItem.DropDownItems.Add(item);
         break;
     }
 }
Beispiel #8
0
        private void ExtendStatusStrip()
        {
            UIExtensionSite status = WorkItem.UIExtensionSites[UIExtensionSiteNames.MainStatus];

            _progressBar         = new ToolStripProgressBar();
            _progressBar.Style   = ProgressBarStyle.Marquee;
            _progressBar.Visible = false;
            status.Add(_progressBar);
        }
        private void CreateAndRegisterLinkLabel(UIExtensionSite site, string label, string command)
        {
            LinkLabel linkLabel = new LinkLabel();

            linkLabel.Text = label;
            site.Add(linkLabel);
            linkLabel.Margin = new Padding(0);

            WorkItem.Commands[command].AddInvoker(linkLabel, "Click");
        }
Beispiel #10
0
        public void RemovingItemNotInSiteDoesNotRemoveFromAdapter()
        {
            MockAdapter     adapter = new MockAdapter();
            UIExtensionSite site    = new UIExtensionSite(adapter);
            object          obj     = new object();

            site.Remove(obj);

            Assert.IsNull(adapter.RemovedElement);
        }
Beispiel #11
0
        public void CountDoesNotIncludeDuplicates()
        {
            UIExtensionSiteCollection parent = new UIExtensionSiteCollection();
            UIExtensionSiteCollection child  = new UIExtensionSiteCollection(parent);

            parent.RegisterSite("Foo", new MockAdapter());
            UIExtensionSite childSite = child["Foo"];

            Assert.AreEqual(1, child.Count);
        }
Beispiel #12
0
        private void ExtendStatusStrip()
        {
            UIExtensionSite status = WorkItem.UIExtensionSites[UIExtensionSiteNames.MainStatus];

            _connectivityStatusLabel             = new ToolStripStatusLabel();
            _connectivityStatusLabel.BorderStyle = Border3DStyle.Sunken;
            _connectivityStatusLabel.Spring      = true;
            _connectivityStatusLabel.TextAlign   = System.Drawing.ContentAlignment.MiddleRight;
            status.Add(_connectivityStatusLabel);
        }
Beispiel #13
0
        public void AddingItemToSiteAddsToAdapter()
        {
            MockAdapter     adapter = new MockAdapter();
            UIExtensionSite site    = new UIExtensionSite(adapter);
            object          obj     = new object();

            object result = site.Add(obj);

            Assert.AreSame(obj, result);
            Assert.AreSame(obj, adapter.AddedElement);
        }
Beispiel #14
0
        public void AddingItemToSiteShowsItemInSiteCollection()
        {
            MockAdapter     adapter = new MockAdapter();
            UIExtensionSite site    = new UIExtensionSite(adapter);
            object          obj     = new object();

            site.Add(obj);

            Assert.AreEqual(1, site.Count);
            Assert.IsTrue(site.Contains(obj));
        }
Beispiel #15
0
        public void RemovingItemFromSiteRemovesItFromAdapter()
        {
            MockAdapter     adapter = new MockAdapter();
            UIExtensionSite site    = new UIExtensionSite(adapter);
            object          obj     = new object();

            site.Add(obj);
            site.Remove(obj);

            Assert.AreSame(obj, adapter.RemovedElement);
            Assert.AreEqual(0, site.Count);
        }
Beispiel #16
0
        private void ExtendMenu()
        {
            //TODO: add menu items here, normally by calling the "Add" method on
            //		on the WorkItem.UIExtensionSites collection. For an example
            //		See: ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/02-04-340-Showing_UIElements.htm

            // Add the Sketcher command
            UIExtensionSite   insertMenuItem = WorkItem.UIExtensionSites[UIExtensionSiteNames.InsertToolStripMenuItem];
            ToolStripMenuItem sketcher       = new ToolStripMenuItem("Sketcher");

            insertMenuItem.Add(sketcher);
            WorkItem.Commands[Constants.CommandNames.StartSketcher].AddInvoker(sketcher, "Click");
        }
        private void ExtendToolStrip()
        {
            //TODO: add new items to the ToolStrip in the Shell. See the UIExtensionSites collection in the WorkItem.
            //		See: ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/02-04-340-Showing_UIElements.htm
            UIExtensionSite MainToolbarSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainToolbar];

            ToolStripButton ts = new ToolStripButton();
            Image           im = Image.FromFile("authenticate.png");

            ts.Image = im;
            MainToolbarSite.Add(ts);

            ToolStripButton ts1 = new ToolStripButton();
            Image           im1 = Image.FromFile("stegano.gif");

            ts1.Image = im1;
            MainToolbarSite.Add(ts1);

            ToolStripButton ts2 = new ToolStripButton();
            Image           im2 = Image.FromFile("water.jpg");

            ts2.Image = im2;
            MainToolbarSite.Add(ts2);

            ToolStripButton ts3 = new ToolStripButton();
            Image           im3 = Image.FromFile("watermark_home.jpg");

            ts3.Image = im3;
            MainToolbarSite.Add(ts3);


            ToolStripSeparator sp = new ToolStripSeparator();

            MainToolbarSite.Add(sp);

            ts.ToolTipText  = "Image Authentication";
            ts1.ToolTipText = "Image Steganography";
            ts2.ToolTipText = "Visible Text Watermark";
            ts3.ToolTipText = "Visible Image Watermark";

            this.WorkItem.Commands[CommandNames.imageAuthentication].
            AddInvoker(ts, "Click");
            this.WorkItem.Commands[CommandNames.imageSteganography].
            AddInvoker(ts1, "Click");
            this.WorkItem.Commands[CommandNames.visibleTextWatermark].
            AddInvoker(ts2, "Click");
            this.WorkItem.Commands[CommandNames.visibleImageWatermark].
            AddInvoker(ts3, "Click");
        }
Beispiel #18
0
        public void ItemsAddedToLocalSiteDoNotAffectItemsInParentSite()
        {
            UIExtensionSiteCollection parent = new UIExtensionSiteCollection();
            UIExtensionSiteCollection child  = new UIExtensionSiteCollection(parent);

            parent.RegisterSite("Foo", new MockAdapter());

            UIExtensionSite parentSite = parent["Foo"];
            UIExtensionSite childSite  = child["Foo"];

            parentSite.Add(new object());
            childSite.Add(new object());

            Assert.AreEqual(1, parentSite.Count);
            Assert.AreEqual(1, childSite.Count);
        }
        private void ExtendMenu()
        {
            //TODO: add menu items here, normally by calling the "Add" method on
            UIExtensionSite   MainMenuSite = this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainMenu];
            ToolStripMenuItem TopTi        = new ToolStripMenuItem("Source Detection");
            ToolStripMenuItem ti1          = new ToolStripMenuItem("Detect Origin");
            ToolStripMenuItem ti2          = new ToolStripMenuItem("Ballastics Testing");

            TopTi.DropDownItems.Add(ti1);
            TopTi.DropDownItems.Add(ti2);
            MainMenuSite.Add(TopTi);
            this.WorkItem.Commands[CommandNames._detect_source].
            AddInvoker(ti1, "Click");
            this.WorkItem.Commands[CommandNames._ballistics_testing].
            AddInvoker(ti2, "Click");
        }
Beispiel #20
0
        private void ExtendMenu()
        {
            //TODO: add menu items here, normally by calling the "Add" method on
            //		on the WorkItem.UIExtensionSites collection. For an example
            //		See: ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/02-04-340-Showing_UIElements.htm
            UIExtensionSite MainMenuSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainMenu];
            ToolStripMenuItem TopTi = new ToolStripMenuItem("Image Comparison");
            ToolStripMenuItem ti1   = new ToolStripMenuItem("Exhaustive Block Matching");

            TopTi.DropDownItems.Add(ti1);

            MainMenuSite.Add(TopTi);
            this.WorkItem.Commands[CommandNames.exhaustiveblock].
            AddInvoker(ti1, "Click");
        }
        public override void Load()
        {
            base.Load();

            // Register the start PartModelingController command in the main menu

            // Fetch the main menu's extension site
            UIExtensionSite   newMenuItem = _rootWorkItem.UIExtensionSites[UIExtensionSiteNames.NewToolStripMenuItem];
            ToolStripMenuItem toolStrip   = new ToolStripMenuItem("Part");

            toolStrip.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
            newMenuItem.Add(toolStrip);

            // Add the click command handlers
            _rootWorkItem.Commands[Constants.CommandNames.NewPart].AddInvoker(toolStrip, "Click");
        }
        private void ExtendToolStrip()
        {
            UIExtensionSite MainToolbarSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainToolbar];
            ToolStripButton    ts = new ToolStripButton();
            ToolStripSeparator sp = new ToolStripSeparator();
            Image im = Image.FromFile("data.jpg");

            ts.Image = im;
            MainToolbarSite.Add(ts);
            MainToolbarSite.Add(sp);

            ts.ToolTipText = "View Exif Data";

            this.WorkItem.Commands[CommandNames.view_exif].
            AddInvoker(ts, "Click");
        }
Beispiel #23
0
        private void ExtendMenu()
        {
            //TODO: add menu items here, normally by calling the "Add" method on
            //		on the WorkItem.UIExtensionSites collection. For an example
            //		See: ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/02-04-340-Showing_UIElements.htm
            UIExtensionSite MainMenuSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainMenu];
            ToolStripMenuItem TopTi = new ToolStripMenuItem("Product Updates");
            ToolStripMenuItem ti1   = new ToolStripMenuItem("Update Modules");
            ToolStripMenuItem ti2   = new ToolStripMenuItem("Update Database");

            TopTi.DropDownItems.Add(ti1);
            TopTi.DropDownItems.Add(ti2);

            MainMenuSite.Add(TopTi);
            this.WorkItem.Commands[CommandNames.updateModules].AddInvoker(ti1, "Click");
            this.WorkItem.Commands[CommandNames.updateDatabase].AddInvoker(ti2, "Click");
        }
        private void ExtendMenu()
        {
            //TODO: add menu items here, normally by calling the "Add" method on
            //		on the WorkItem.UIExtensionSites collection. For an example
            //		See: ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/02-04-340-Showing_UIElements.htm
            UIExtensionSite MainMenuSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainMenu];
            ToolStripMenuItem TopTi = new ToolStripMenuItem("Analysis");
            ToolStripMenuItem ti1   = new ToolStripMenuItem("Edge Detection");
            ToolStripMenuItem ti2   = new ToolStripMenuItem("Histogram");
            ToolStripMenuItem ti3   = new ToolStripMenuItem("Fourier Transformation");

            ToolStripMenuItem ti1_1 = new ToolStripMenuItem("Canny");
            ToolStripMenuItem ti1_2 = new ToolStripMenuItem("Sobel");
            ToolStripMenuItem ti1_3 = new ToolStripMenuItem("Difference");
            ToolStripMenuItem ti1_4 = new ToolStripMenuItem("Homogenity");
            ToolStripMenuItem ti1_5 = new ToolStripMenuItem("Edges");

            ti1.DropDownItems.Add(ti1_1);
            ti1.DropDownItems.Add(ti1_2);
            ti1.DropDownItems.Add(ti1_3);
            ti1.DropDownItems.Add(ti1_4);
            ti1.DropDownItems.Add(ti1_5);

            TopTi.DropDownItems.Add(ti1);
            TopTi.DropDownItems.Add(ti2);
            TopTi.DropDownItems.Add(ti3);

            MainMenuSite.Add(TopTi);
            this.WorkItem.Commands[CommandNames.edge_canny].
            AddInvoker(ti1_1, "Click");
            this.WorkItem.Commands[CommandNames.edge_sobel].
            AddInvoker(ti1_2, "Click");
            this.WorkItem.Commands[CommandNames.edge_difference].
            AddInvoker(ti1_3, "Click");
            this.WorkItem.Commands[CommandNames.edge_homogenity].
            AddInvoker(ti1_4, "Click");
            this.WorkItem.Commands[CommandNames.edges].
            AddInvoker(ti1_5, "Click");
            this.WorkItem.Commands[CommandNames.histogram].
            AddInvoker(ti2, "Click");
            this.WorkItem.Commands[CommandNames.fourier].
            AddInvoker(ti3, "Click");
        }
Beispiel #25
0
        public void ShowPurchaseCDCommandAction(object caller, object target)
        {
            if (_queueEntry.Person == null || !(_queueEntry.Person is Customer))
            {
                return;
            }

            UIExtensionSite site      = _workItem.UIExtensionSites[UIExtensionSiteNames.ProductsPanel];
            LinkLabel       linkLabel = new LinkLabel();

            linkLabel.Text = Resources.PurchaseCDLabelText;
            site.Add(linkLabel);
            linkLabel.Margin = new Padding(0);

            linkLabel.Click += delegate(object sender, EventArgs args)
            {
                _actionCatalog.Execute(ActionNames.ShowPurchaseCDView, _workItem, this, null);
            };
        }
Beispiel #26
0
        private void ExtendToolStrip()
        {
            //TODO: add new items to the ToolStrip in the Shell. See the UIExtensionSites collection in the WorkItem.
            //		See: ms-help://MS.VSCC.v90/MS.VSIPCC.v90/ms.practices.scsf.2008apr/SCSF/html/02-04-340-Showing_UIElements.htm

            UIExtensionSite MainToolbarSite =
                this.WorkItem.UIExtensionSites[UIExtensionSiteNames.MainToolbar];
            ToolStripButton    ts = new ToolStripButton();
            ToolStripSeparator sp = new ToolStripSeparator();
            Image im = Image.FromFile("10.ico");

            ts.Image = im;
            MainToolbarSite.Add(ts);
            MainToolbarSite.Add(sp);

            ts.ToolTipText = "About US";

            this.WorkItem.Commands[CommandNames.about].
            AddInvoker(ts, "Click");
        }
 public void AddMenuItem(UIExtensionSite site, ToolStripMenuItem item)
 {
     switch (site)
     {
         case UIExtensionSite.Options:
             commandsToolStripMenuItem.DropDownItems.Add(item);
             break;
     }
 }
Beispiel #28
0
        public void InvalidSiteNameThrows()
        {
            UIExtensionSiteCollection collection = new UIExtensionSiteCollection();

            UIExtensionSite unused = collection["Foo"];
        }