Beispiel #1
0
        public IEnumerable <ToolStripItem> GetContextMenuItems(string sessionId)
        {
            //enhance: move these two ones up to the base class
            yield return(new ToolStripMenuItem("Show file in Windows Explorer...", null, HandleOpenInFileManager_Click));

            yield return(new ToolStripMenuItem("Open in Program Associated with this File ...", null, HandleOpenInApp_Click));

            bool needSeparator = true;

            foreach (var definition in SessionComponentDefinition.CreateHardCodedDefinitions())
            {
                if (definition.GetFileIsElligible(FullFilePath))
                {
                    if (needSeparator)
                    {
                        needSeparator = false;
                        yield return(new ToolStripSeparator());
                    }

                    string label = string.Format("Rename For {0}", definition.Name);
                    SessionComponentDefinition componentDefinition = definition;
                    yield return(new ToolStripMenuItem(label, null, (sender, args) => IdentifyAsComponent(componentDefinition, sessionId)));
                }
            }
        }
Beispiel #2
0
        public void IdentifyComponent_ShouldBeOk_Renames()
        {
            var sf = new SessionFile();

            using (var f = new TemporaryFolder("spongeTests"))
            {
                string path = f.Combine("foo.wav");
                File.CreateText(path).Close();
                sf.FullFilePath = path;
                //couldn't use the menu directly from test code:  sf.GetContextMenuItems("x").ToArray()[3].Select();

                sf.IdentifyAsComponent(SessionComponentDefinition.CreateHardCodedDefinitions().First(), "x");
                Assert.AreEqual("x_Original.wav", sf.FileName);
            }
        }
Beispiel #3
0
 private SessionComponentDefinition GetDefinitionForOriginalRecording()
 {
     return(SessionComponentDefinition.CreateHardCodedDefinitions().First());
 }