public GoogleSlides(IGetValue valueRetrieval, IFileAndFolderPathsCreator fileAndFolderPathsCreator) { _fileAndFolderPathsCreator = fileAndFolderPathsCreator; _folderForSongs = valueRetrieval.Get(KeyConfig.FolderForSongs); _folderForPptx = valueRetrieval.Get(KeyConfig.FolderForPptx); _folderForZip = valueRetrieval.Get(KeyConfig.FolderForZip); _presentationTemplate = valueRetrieval.Get(KeyConfig.PresentationTemplate); var clientSecrets = new ClientSecrets() { ClientId = valueRetrieval.Get(KeyConfig.GoogleApiClient), ClientSecret = valueRetrieval.Get(KeyConfig.GoogleApiSecret) }; var credPath = valueRetrieval.Get(KeyConfig.GoogleApiToken); var credential = GoogleWebAuthorizationBroker.AuthorizeAsync( clientSecrets, new[] { DriveService.Scope.Drive, SlidesService.Scope.Presentations }, "user", CancellationToken.None, new FileDataStore(credPath, true)).Result; _driveService = new DriveService(new BaseClientService.Initializer() { HttpClientInitializer = credential }); }
public static void SchoolClassCheck(IGetValue schoolClass) { bool returnValue = false; string[] romanNumbers = new string [] { "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX" }; string sc = schoolClass.GetValue().ToString(); string help = ""; for (int i = 0; i < romanNumbers.Length; i++) { if (sc.StartsWith(romanNumbers[i])) { help = romanNumbers[i]; returnValue = true; break; } } if (!returnValue) { schoolClass.SetErrorProvider(returnValue, "School class name contain roman numbers and arabic number. Example : VIII2"); throw new ValidationException(); } sc = sc.Substring(help.Length); if (sc.Any(s => !char.IsDigit(s))) { returnValue = false; } schoolClass.SetErrorProvider(returnValue, "School class name contain roman numbers and arabic number. Example : VIII2"); }
// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); RegisterContainers(services); var sp = services.BuildServiceProvider(); _valueRetrieval = sp.GetService <IGetValue>(); CreateAuthentication(services); services.AddCors(options => { options.AddPolicy("AllowAll", builder => { builder .AllowAnyOrigin() .AllowAnyMethod() .AllowAnyHeader() .AllowCredentials(); }); }); services.AddMvc() .AddJsonOptions(x => x.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore); var connectionString = _valueRetrieval.Get("ConnectionString"); services.AddDbContext <SongContext>(o => o.UseMySql(connectionString)); }
public static bool EmailCheck(IGetValue email) { Regex regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$"); Match match = regex.Match(email.GetValue().ToString()); email.SetErrorProvider(match.Success, "Email is not valid !"); return(match.Success); }
/// <summary> /// Constructor /// </summary> public MutationalOffset() { FuzzPercent = new FromToValue <double>(0, 5); MaxChanges = new FromToValue <ushort>(0, 2); ValidOffset = new FromToValue <ulong>(ulong.MinValue, ulong.MaxValue); Changes = new ObservableCollection <MutationalChange>(); Description = "Unnamed"; }
/// <summary> /// Initializes a new instance of the <see cref="Record"/> class. /// </summary> /// <param name="getValue">The get value.</param> public Record(IGetValue getValue) : this() { var property = getValue.Properties; foreach (var item in property) { _dic.Add(item, getValue.GetValue(item)); } }
public SongsController(ILogger <SongsController> logger, ISongRepository songRepository, IGoogleSlides googleSlides, IGetValue valueRetrieval) { _logger = logger; _songRepository = songRepository; _googleSlides = googleSlides; _valueRetrieval = valueRetrieval; }
public static IGetValue GetPropertyGetterWrapper(MemberInfo memberInfo) { IGetValue property = (IGetValue)sGetterDict[memberInfo]; if (property == null) { property = CreatePropertyGetterWrapper(memberInfo); sGetterDict[memberInfo] = property; } return(property); }
internal static IGetValue GetPropertyGetterWrapper(PropertyInfo propertyInfo) { IGetValue property = (IGetValue)s_getterDict[propertyInfo]; if (property == null) { property = CreatePropertyGetterWrapper(propertyInfo); s_getterDict[propertyInfo] = property; } return(property); }
/// <summary> /// Constructor /// </summary> public MutationalChange() { AppendByte = new FromToValue <byte>(byte.MinValue, byte.MaxValue); Weight = 1; Description = "Unnamed"; _RemoveLength = new FromToValue <ushort>(1); _AppendLength = new FromToValue <ushort>(1); _RemoveAndAppendAreSame = true; Enabled = true; }
static void Main(string[] args) { Packaging <string> stringPackage = new Packaging <string>(); ISetValue <string> setStringValue = stringPackage; setStringValue.SetData("Sample string"); // the line below causes a compile-time error IGetValue <object> getObjectValue = stringPackage; Console.WriteLine("{0}", getObjectValue.GetData()); }
private void loadFunctions() { IntPtr pGetProcessList = GetProcAddress(libInst, "IGetProcessList"); IntPtr pOpenProcess = GetProcAddress(libInst, "IOpenProcess"); IntPtr pResetTable = GetProcAddress(libInst, "IResetTable"); IntPtr pAddScript = GetProcAddress(libInst, "IAddScript"); IntPtr pRemoveRecord = GetProcAddress(libInst, "IRemoveRecord"); IntPtr pActivateRecord = GetProcAddress(libInst, "IActivateRecord"); IntPtr pApplyFreeze = GetProcAddress(libInst, "IApplyFreeze"); IntPtr pAddAddressManually = GetProcAddress(libInst, "IAddAddressManually"); IntPtr pGetValue = GetProcAddress(libInst, "IGetValue"); IntPtr pSetValue = GetProcAddress(libInst, "ISetValue"); IntPtr pProcessAddress = GetProcAddress(libInst, "IProcessAddress"); IntPtr pInitMemoryScanner = GetProcAddress(libInst, "IInitMemoryScanner"); IntPtr pNewScan = GetProcAddress(libInst, "INewScan"); IntPtr pConfigScanner = GetProcAddress(libInst, "IConfigScanner"); IntPtr pFirstScan = GetProcAddress(libInst, "IFirstScan"); IntPtr pNextScan = GetProcAddress(libInst, "INextScan"); IntPtr pCountAddressesFound = GetProcAddress(libInst, "ICountAddressesFound"); IntPtr pGetAddress = GetProcAddress(libInst, "IGetAddress"); IntPtr pInitFoundList = GetProcAddress(libInst, "IInitFoundList"); IntPtr pResetValues = GetProcAddress(libInst, "IResetValues"); IntPtr pGetBinarySize = GetProcAddress(libInst, "IGetBinarySize"); iGetProcessList = (IGetProcessList)Marshal.GetDelegateForFunctionPointer(pGetProcessList, typeof(IGetProcessList)); iOpenProcess = (IOpenProcess)Marshal.GetDelegateForFunctionPointer(pOpenProcess, typeof(IOpenProcess)); iResetTable = (IResetTable)Marshal.GetDelegateForFunctionPointer(pResetTable, typeof(IResetTable)); iAddScript = (IAddScript)Marshal.GetDelegateForFunctionPointer(pAddScript, typeof(IAddScript)); iRemoveRecord = (IRemoveRecord)Marshal.GetDelegateForFunctionPointer(pRemoveRecord, typeof(IRemoveRecord)); iActivateRecord = (IActivateRecord)Marshal.GetDelegateForFunctionPointer(pActivateRecord, typeof(IActivateRecord)); iApplyFreeze = (IApplyFreeze)Marshal.GetDelegateForFunctionPointer(pApplyFreeze, typeof(IApplyFreeze)); iAddAddressManually = (IAddAddressManually)Marshal.GetDelegateForFunctionPointer(pAddAddressManually, typeof(IAddAddressManually)); iGetValue = (IGetValue)Marshal.GetDelegateForFunctionPointer(pGetValue, typeof(IGetValue)); iSetValue = (ISetValue)Marshal.GetDelegateForFunctionPointer(pSetValue, typeof(ISetValue)); iProcessAddress = (IProcessAddress)Marshal.GetDelegateForFunctionPointer(pProcessAddress, typeof(IProcessAddress)); iInitMemoryScanner = (IInitMemoryScanner)Marshal.GetDelegateForFunctionPointer(pInitMemoryScanner, typeof(IInitMemoryScanner)); iNewScan = (INewScan)Marshal.GetDelegateForFunctionPointer(pNewScan, typeof(INewScan)); iConfigScanner = (IConfigScanner)Marshal.GetDelegateForFunctionPointer(pConfigScanner, typeof(IConfigScanner)); iFirstScan = (IFirstScan)Marshal.GetDelegateForFunctionPointer(pFirstScan, typeof(IFirstScan)); iNextScan = (INextScan)Marshal.GetDelegateForFunctionPointer(pNextScan, typeof(INextScan)); iCountAddressesFound = (ICountAddressesFound)Marshal.GetDelegateForFunctionPointer(pCountAddressesFound, typeof(ICountAddressesFound)); iGetAddress = (IGetAddress)Marshal.GetDelegateForFunctionPointer(pGetAddress, typeof(IGetAddress)); iInitFoundList = (IInitFoundList)Marshal.GetDelegateForFunctionPointer(pInitFoundList, typeof(IInitFoundList)); iResetValues = (IResetValues)Marshal.GetDelegateForFunctionPointer(pResetValues, typeof(IResetValues)); iGetBinarySize = (IGetBinarySize)Marshal.GetDelegateForFunctionPointer(pGetBinarySize, typeof(IGetBinarySize)); }
public PresentationController(ISongRepository songRepository, IConvertPresentation pptxToZipConverter, IMerge powerPointMerger, IFileAndFolderPathsCreator fileAndFolderPath, IPresentationRepository presentationRepository, IGetValue valueRetrieval, IGoogleSlides googleSlides) { _powerPointMerger = powerPointMerger; _songRepository = songRepository; _pptxToZipConverter = pptxToZipConverter; _fileAndFolderPath = fileAndFolderPath; _presentationRepository = presentationRepository; _valueRetrieval = valueRetrieval; _googleSlides = googleSlides; }
/// <summary> /// To lowercase /// </summary> /// <param name="input">Input</param> /// <param name="filter">Filter</param> /// <returns>Lowercase input</returns> public static byte[] ToLowerCase(byte[] input, IGetValue <double> filter) { for (int x = input.Length - 1; x >= 0; x--) { var entry = _cases[input[x]]; if (entry != null && (filter == null || RandomHelper.IsRandomPercentOk(filter.Get()))) { input[x] = entry.LowerCase; } } return(input); }
/// <summary> /// Convers the to. /// </summary> /// <param name="read"></param> /// <returns>A T1.</returns> public T1 ConverTo(IGetValue read) { var properties = t1Type.GetProperties(); var t1 = new T1(); foreach (var item in properties) { var value = read.GetValue(item.Name); if (value == null) { continue; } PropertySetDelegateCache.TrySet(item, t1, value); } return(t1); }
public static IGetValue CreateMethodGetterWrapper <TTarget, TValue>(MethodInfo methodInfo) { if (methodInfo == null) { throw new ArgumentNullException("methodInfo is null"); } if (methodInfo.GetParameters().Length != 0) { throw new ArgumentNullException("不支持含参读取方法"); } IGetValue getter = null; if (_methodGettersCache.TryGetValue(methodInfo, out getter)) { return(getter); } getter = new GetterWrapper <TTarget, TValue>(methodInfo); return(getter); }
public static bool PasswordCheck(IGetValue value) { string password = value.GetValue().ToString(); var hasNumber = new Regex(@"[0-9]+"); var hasUpperChar = new Regex(@"[A-Z]+"); var hasLowerChar = new Regex(@"[a-z]+"); var hasSymbols = new Regex(@"[!@#$%^&*()_+=\[{\]};:<>|./?,-]"); if (hasNumber.IsMatch(password) && hasUpperChar.IsMatch(password) && hasLowerChar.IsMatch(password) && hasSymbols.IsMatch(password)) { value.SetErrorProvider(true, ""); return(true); } else { value.SetErrorProvider(false, "Password is not correct. Must contain digit,uppercase(lowercase) letter and one special character"); return(false); } }
/// <summary>値取得プロパティ プロシージャのテスト</summary> private string GetValue(IGetValue igv) { StringBuilder sb = new StringBuilder(); sb.AppendLine(((Control)igv).Name); try { sb.AppendLine("GetInt16:" + igv.GetInt16().ToString()); } catch { } try { sb.AppendLine("GetInt32:" + igv.GetInt32().ToString()); } catch { } try { sb.AppendLine("GetInt64:" + igv.GetInt64().ToString()); } catch { } try { sb.AppendLine("GetFloat:" + igv.GetFloat().ToString()); } catch { } try { sb.AppendLine("GetDouble:" + igv.GetDouble().ToString()); } catch { } try { sb.AppendLine("GetDecimal:" + igv.GetDecimal().ToString()); } catch { } try { sb.AppendLine("GetDateTime:" + igv.GetDateTime().ToString()); } catch { } if (igv is WinCustomTextBox) { WinCustomTextBox wctbx = (WinCustomTextBox)igv; // 通常のTextプロパティ(可変) sb.AppendLine("Text:" + wctbx.Text); // ユーザの入力値だけ取得する sb.AppendLine("Text2:" + wctbx.Text2); // 編集処理を適用した値を取得する sb.AppendLine("Text3:" + wctbx.Text3); // データバインディング用プロパティ値を取得する sb.AppendLine("Value:" + wctbx.Value); } else if (igv is WinCustomMaskedTextBox) { WinCustomMaskedTextBox wcmtbx = (WinCustomMaskedTextBox)igv; // 通常のTextプロパティ(可変) sb.AppendLine("Text:" + wcmtbx.Text); // ユーザの入力値だけ取得する sb.AppendLine("Text2:" + wcmtbx.Text2); // 入力時マスクを適用した値を取得する sb.AppendLine("Text3:" + wcmtbx.Text3); } return(sb.ToString()); }
public FileAndFolderPathsCreator(IGetValue valueRetrieval) { _valueRetrieval = valueRetrieval; _folder = _valueRetrieval.Get("FileRoot"); _webAddress = _valueRetrieval.Get("WebAddress"); }
public CustomTaskManager(IGetValue getValue) { _getValue = getValue; }
public ForWithList(IMessaging messaging, IGetValue getValue) : base(messaging, getValue) { }
/// <summary> /// Creates the. /// </summary> /// <param name="getValue">The get value.</param> /// <returns>A T.</returns> public T Create <T>(IGetValue getValue) where T : class, new() { return(_objectFactory.Create <T>(getValue)); }
public ForWithConcurrentQueue(IMessaging messaging, IGetValue getValue) : base(messaging, getValue) { }
protected ParallelImplementation(IMessaging messaging, IGetValue getValue) { _messaging = messaging; _getValue = getValue; }
public Account(IGetValue valueRetrieval) { _baseUri = new Uri(valueRetrieval.Get(KeyConfig.ZamzarUrl)); _apiKey = valueRetrieval.Get(KeyConfig.ZamzarKey); }
private List <DataViewModel> dataviews = new List <DataViewModel>(); //View модель для отображения результата /*получаем данные из контейнера зависимостей*/ public DataController(IGetValue values, IDataRequest dataRequest) { _values = values; _dataRequests = dataRequest; }
public Sequential(IMessaging messaging, IGetValue getValue) : base(messaging, getValue) { }
public PptxToZipConverter(IFileAndFolderPathsCreator fileAndFolderPath, IGetValue valueRetrieval) { _fileAndFolderPath = fileAndFolderPath; _baseUri = new Uri(valueRetrieval.Get(KeyConfig.ZamzarUrl)); _apiKey = valueRetrieval.Get(KeyConfig.ZamzarKey); }
/// <summary> /// Constructor /// </summary> /// <param name="length">Length</param> public RandomFuzzingInput(IGetValue <long> length) : base("Random") { Length = length; }
/// <summary>値取得プロパティ プロシージャのテスト</summary> private string GetValue(IGetValue igv) { StringBuilder sb = new StringBuilder(); sb.AppendLine(((Control)igv).Name); try { sb.AppendLine("GetInt16:" + igv.GetInt16().ToString()); } catch { } try { sb.AppendLine("GetInt32:" + igv.GetInt32().ToString()); } catch { } try { sb.AppendLine("GetInt64:" + igv.GetInt64().ToString()); } catch { } try { sb.AppendLine("GetFloat:" + igv.GetFloat().ToString()); } catch { } try { sb.AppendLine("GetDouble:" + igv.GetDouble().ToString()); } catch { } try { sb.AppendLine("GetDecimal:" + igv.GetDecimal().ToString()); } catch { } try { sb.AppendLine("GetDateTime:" + igv.GetDateTime().ToString()); } catch { } if (igv is WinCustomTextBox) { WinCustomTextBox wctbx = (WinCustomTextBox)igv; // 通常のTextプロパティ(可変) sb.AppendLine("Text:" + wctbx.Text); // ユーザの入力値だけ取得する sb.AppendLine("Text2:" + wctbx.Text2); // 編集処理を適用した値を取得する sb.AppendLine("Text3:" + wctbx.Text3); // データバインディング用プロパティ値を取得する sb.AppendLine("Value:" + wctbx.Value); } else if (igv is WinCustomMaskedTextBox) { WinCustomMaskedTextBox wcmtbx = (WinCustomMaskedTextBox)igv; // 通常のTextプロパティ(可変) sb.AppendLine("Text:" + wcmtbx.Text); // ユーザの入力値だけ取得する sb.AppendLine("Text2:" + wcmtbx.Text2); // 入力時マスクを適用した値を取得する sb.AppendLine("Text3:" + wcmtbx.Text3); } return sb.ToString(); }
public TaskWithList(IMessaging messaging, IGetValue getValue, ICustomTaskManager customManager) : base(messaging, getValue) { _customManager = customManager; }