コード例 #1
0
ファイル: Plug.cs プロジェクト: GolDieTub/OOTPiSP
        public static byte[] ActivatePlug(Plug plugin, byte[] _data, bool way)
        {
            switch (plugin.Type)
            {
            case PluginType.Cryptography:
                byte[] result = null;
                if (way)
                {
                    result = ((ICrypography)plugin.internalPlugin).Encrypt(_data);
                }
                else
                {
                    result = ((ICrypography)plugin.internalPlugin).Decrypt(_data);
                }
                return(result);

            default:
                IPlugin plugin_IPlugin = plugin as IPlugin;
                return(null);
            }
        }
コード例 #2
0
        private void GetPlugs(string Path)
        {
            if (!Directory.Exists(Path))
            {
                return;
            }

            Plug curr = lstPlugins.SelectedItem as Plug;

            lstPlugins.BeginUpdate();
            lstPlugins.Items.Clear();

            foreach (string f in Directory.GetFiles(Path))
            {
                FileInfo fi = new FileInfo(f);

                if (fi.Extension.Equals(".dll"))
                {
                    lstPlugins.Items.Add(new Plug(f));
                }
            }
            lstPlugins.EndUpdate();
        }