public override void Invoke(object sender, ModuleFilerEventArgs e) { try { IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell(); var link = shell.CreateShortcut(e.Name); var targetFileInfo = new FileInfo(link.TargetPath as string); ShortieCommand.ProcessShortcut(targetFileInfo); } catch { //TODO Senthil } }
/// <summary> /// Reads and checks the magic number, then opens the resource panel. /// </summary> public override void Invoke(object sender, ModuleFilerEventArgs e) { try { // Check the magic number of .resources files using (var reader = new BinaryReader(e.Data)) { int magic = reader.ReadInt32(); if (magic != -1091581234) throw new ModuleException(); } } catch { // This is not a .resources file Far.Net.Message(GetString("BadResources")); return; } // Open the resource panel (new DemoExplorer(e.Name)).OpenPanel(); }