This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Sub RemoveAllDeletedItemsSubFolders() | |
| Dim oDeletedItems As Outlook.Folder | |
| Dim oFolders As Outlook.Folders | |
| Dim oItems As Outlook.Items | |
| Dim i As Long | |
| 'Obtain a reference to deleted items folder | |
| Set oDeletedItems = Application.Session.GetDefaultFolder(olFolderDeletedItems) | |
| Set oFolders = oDeletedItems.Folders | |
| For i = oFolders.Count To 1 Step -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static class ObservableExtensions | |
| { | |
| public static IObservable<TSource> CompleteAfter<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate) | |
| { | |
| return new AnonymousObservable<TSource>(observer => | |
| { | |
| var complete = false; | |
| return source.Subscribe( | |
| x => | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var authClient = new LiveAuthClient(); | |
| LiveLoginResult authResult = await authClient.LoginAsync( | |
| new List<string>() { "wl.signin", "wl.basic" }); | |
| if (authResult.Status == LiveConnectSessionStatus.Connected) | |
| { | |
| LiveConnectClient client = new LiveConnectClient(authResult.Session); | |
| LiveOperationResult liveOpResult = await client.GetAsync("me"); | |
| string name = (string)liveOpResult.Result["name"]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function get-bitrate( $file) { | |
| $shell = New-Object -ComObject Shell.Application | |
| $dir = $shell.NameSpace($file.Directory.FullName) | |
| $fileObj = $dir.parseName($file.Name) | |
| $bitrateAttribute = 0 | |
| for( $index = 5; -not $bitrateAttribute; ++$index ) { | |
| $name = $directoryObject.GetDetailsOf( $dir.Items, $index ) | |
| if( $name -eq 'Bit rate' ) { $bitrateAttribute = $index } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function () { | |
| var | |
| // The username and password for BASIC auth | |
| username, | |
| password, | |
| // CHANGE THIS | |
| apiRoot = "https://api.foo.com/version", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class WinRTMetadataResolver : MetadataResolver | |
| { | |
| public WinRTMetadataResolver(IAssemblyResolver resolver) | |
| : base(resolver) | |
| { | |
| } | |
| IDictionary<string, ModuleDefinition> _loadedModules = new Dictionary<string, ModuleDefinition>(); | |
| public override TypeDefinition Resolve(TypeReference type) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static string[] ParseTypeName(string typename) | |
| { | |
| UInt32 partsCount; | |
| IntPtr[] typeNameParts = null; | |
| try | |
| { | |
| var hr = RoParseTypeName(typename, out partsCount, out typeNameParts); | |
| var parts = partsCount == 0 ? new string[0] : typeNameParts.Select(p => WindowsRuntimeMarshal.PtrToStringHString(p)).ToArray(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //note, this wrapper funtion returns the metadata file name and token | |
| //it immediately releases the importer pointer | |
| static Tuple<string, UInt32> ResolveTypeName(string typename) | |
| { | |
| string path; | |
| object importer = null; | |
| UInt32 token; | |
| try | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace MetadataReader | |
| { | |
| using HRESULT = System.UInt32; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class WinRTInterop | |
| { | |
| public static IMetaDataDispenser GetMetadataDispenser() | |
| { | |
| var clsid = new Guid("{E5CB7A31-7512-11d2-89CE-0080C792E5D8}"); //CLSID_CorMetaDataDispenser | |
| //var iid = new Guid("{31BCFCE2-DAFB-11D2-9F81-00C04F79A0A3}"); //IID_IMetaDataDispenserEx | |
| var iid = new Guid("{809C652E-7396-11D2-9771-00A0C9B4D50C}"); //IID_IMetaDataDispenser | |
| object ppv; | |
| var hr = MetaDataGetDispenser(clsid, iid, out ppv); |