Beispiel #1
0
        public StartMenuResult(IResultProvider provider, FileInfo file)
        {
            _file = file;

            ID = Hash.CreateFrom(file.FullName);
            Title = file.GetNameWithoutExtension();
            Description = file.Directory.FullName;
            Provider = provider;
        }
        public void StringSplitByKeyTest()
        {
            String target = "a: bcd e: fg h: i h:";
            Dictionary<String, String> answers = target.SplitByKey("a:|e:|h:", true);

            Assert.True(answers.Count == 3);

            String location = @"C:\WebPage\FortinetIDS\12113.html";
            FileInfo file = new FileInfo(location);
            String answer = file.GetNameWithoutExtension();
        }
        public FileSearchResult(IResultProvider provider, FileInfo fileInfo)
        {
            _fileInfo = fileInfo;

            Provider = provider;
            ID = Hash.CreateFrom(_fileInfo.FullName);
            Title = fileInfo.GetNameWithoutExtension();
        }
Beispiel #4
0
        private string GetNameFromFilePath(string filePath)
        {
            FileInfo keyFile = new FileInfo(filePath);

            return keyFile.GetNameWithoutExtension();
        }
Beispiel #5
0
 private void ExportTableConfiguration_Click(object sender, EventArgs e)
 {
     if (!Pinball.Table.TableConfigurationFilename.IsNullOrWhiteSpace())
     {
         FileInfo FI = new FileInfo(Pinball.Table.TableConfigurationFilename);
         SaveTableConfigDialog.InitialDirectory = FI.Directory.FullName;
         SaveTableConfigDialog.FileName = FI.FullName;
     }
     else if (!Pinball.Table.TableFilename.IsNullOrWhiteSpace())
     {
         FileInfo FI = new FileInfo(Pinball.Table.TableFilename);
         SaveTableConfigDialog.InitialDirectory = FI.Directory.FullName;
         SaveTableConfigDialog.FileName = Path.Combine(FI.Directory.FullName,"{0}.xml".Build(FI.GetNameWithoutExtension()));
     }
     else
     {
         SaveTableConfigDialog.InitialDirectory = Pinball.GlobalConfig.GetGlobalConfigDirectory().FullName;
     }
     if (SaveTableConfigDialog.ShowDialog() == DialogResult.OK)
     {
         Pinball.Table.TableConfigurationFilename = SaveTableConfigDialog.FileName;
         try
         {
             Pinball.Table.SaveConfigXmlFile(SaveTableConfigDialog.FileName);
             UpdateWindowTitle();
             MessageBox.Show("Table configuration saved to\n{0}".Build(SaveTableConfigDialog.FileName), "Table configuration saved", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
         catch (Exception E)
         {
             MessageBox.Show("Could not save table config to\n{0}\n\nThe following error occured:\n{1}".Build(SaveTableConfigDialog.FileName, E.Message), "File save error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }