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 Org.BouncyCastle.Crypto; | |
using Org.BouncyCastle.Crypto.Parameters; | |
using Org.BouncyCastle.OpenSsl; | |
using Org.BouncyCastle.Security; | |
using System; | |
using System.IO; | |
using System.Security.Cryptography; | |
namespace MyProject.Data.Encryption | |
{ |
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
public static TValue GetAttributeValue<TAttribute, TValue>(this Type type, Func<TAttribute, TValue> valueSelector) where TAttribute : Attribute | |
{ | |
var att = type.GetCustomAttributes(typeof(TAttribute), true).FirstOrDefault() as TAttribute; | |
if (att != null) | |
{ | |
return valueSelector(att); | |
} | |
return default(TValue); | |
} |
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
namespace Acr.UserDialogs | |
{ | |
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Windows.Input; | |
using System.Windows.Threading; | |
using Acr.UserDialogs.Infrastructure; | |
using SAPXamarinTransporter.WPF.UserDialogs; | |
using Xamarin.Forms.Platform.WPF.Controls; |
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
// Android MainActivity | |
using Android.App; | |
using Android.Content.PM; | |
using Android.OS; | |
using AndroidHUD; // https://github.com/redth-org/AndHUD | |
namespace ThemingDemo.Droid | |
{ | |
[Activity(Label = "ThemingDemo", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] | |
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity |
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
/* ClickOnceReinstaller v 1.1.0 | |
* - Author: Tomas Kouba ([email protected])* | |
* - Changes: | |
* - add reinstall file extension .txt | |
* - using log4net | |
* - migration should be cancelled by user | |
* - TODO | |
* - add cancellation message to reinstall.txt file | |
* | |
* v 1.0.0 |
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.Drawing; | |
using System.Text; | |
using System.Windows.Forms; | |
namespace MyVpnManager.Base | |
{ | |
/// <summary> | |
/// Specifies the contextual information about an application thread with <see cref="Icon"/> and <see cref="ContextMenuStrip"/> |
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.Deployment.Application; | |
using System.Linq; | |
using System.Text; | |
using System.Threading; | |
namespace InstallClickOnceApp | |
{ |
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
public static string CreateName(this string s) { | |
s = s.Normalize(NormalizationForm.FormD); | |
StringBuilder sb = new StringBuilder(); | |
bool upper = true; | |
for (int i = 0; i < s.Length; i++) | |
{ | |
var cat = System.Globalization.CharUnicodeInfo.GetUnicodeCategory(s[i]); | |
//Console.WriteLine(cat); | |
if (cat == System.Globalization.UnicodeCategory.DecimalDigitNumber && sb.Length == 0) | |
sb.Append('_'); |
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
private string[] IEnumStringToArray(IEnumString enumerator) | |
{ | |
const int S_OK = 0x00000000; | |
List<string> lst = new List<string>(); | |
if (enumerator != null) | |
{ | |
int cft; | |
string[] strF = new string[100]; | |
int hresult; | |
IntPtr intPtr = Marshal.AllocCoTaskMem(sizeof(int)); |