コード例 #1
0
        private void btnRemove_Click(object sender, RoutedEventArgs e)
        {
            if (lbPlugins.SelectedIndex > -1)
            {
                Autoload plugin = (Autoload)DataContext;

                plugin.Plugins.RemoveAt(lbPlugins.SelectedIndex);
                plugin.SaveFile();
            }
        }
コード例 #2
0
        private void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Multiselect      = false;
            ofd.CheckFileExists  = true;
            ofd.CheckPathExists  = true;
            ofd.InitialDirectory = ((Autoload)DataContext).Directory;
            ofd.Filter           = "Dynamic Link Library (*.dll)|*.dll";

            if ((bool)ofd.ShowDialog())
            {
                Autoload plugin = (Autoload)DataContext;
                FileInfo file   = new FileInfo(ofd.FileName);

                plugin.Plugins.Add(file.Name);
                plugin.SaveFile();
            }
        }
コード例 #3
0
 public Settings(Autoload plugin)
 {
     InitializeComponent();
     DataContext = plugin;
 }