public void ParseOutlookFormatGoogleContactsTest() { var f = @"D:\_Test\sunamo\SunamoCsv\contacts_Outlook.csv"; GoogleContactExportRow c = new GoogleContactExportRow(); var g = c.GetType().GetProperties().Select(d2 => d2.Name); var c2 = TF.ReadAllText(f); CsvFile csv = new CsvFile(); //CsvReader csvReader = new CsvReader(); csv.Populate(true, c2); var gCount = g.Count(); List <List <string> > ls = new List <List <string> >(gCount); int i = 0; foreach (var item in g) { var ls2 = LinearHelper.GetStringListFromTo(0, gCount - 1); var li = CA.ToList <int>(ls2); var entries = csv.Strings(0); ls.Add(entries); } int d = 0; }
public MainDashDisplayViewModel() { ChangeName = new RelayCommand(() => { CA.ChangeProperty("FirstName", "Mico", "GetFullName"); }); }
public CANode(CA ca) { this.ca = ca; this.caControl = ca.CaControl; this.Tag = caControl; // Make this available for child use // Add in the folders for the CA database (keeping track of the CertsNode instances) currentCerts = new CertsNode(caControl, CertStatus.Current) { DisplayName = "Current Certificates" }; expiredCerts = new CertsNode(caControl, CertStatus.Expired) { DisplayName = "Expired Certificates" }; revokedCerts = new CertsNode(caControl, CertStatus.Revoked) { DisplayName = "Revoked Certificates" }; profiles = new ProfilesNode(caControl) { DisplayName = "Profiles" }; this.Children.Add(currentCerts); this.Children.Add(revokedCerts); this.Children.Add(expiredCerts); this.Children.Add(profiles); // Check the status of the CA and setup accordngly Refresh(); }
public void ToStringTable() { var els = "Extra really long string"; var l1 = CA.ToList <string>("A", els, "", ""); var l2 = CA.ToList <string>("B", "", els, ""); //List<List<string>> ls = new List<List<string>>(); //ls.Add(l1); //ls.Add(l2); var headers = TestData.listABCD; var list = new List <string>(); list.AddRange(l1); list.AddRange(l2); var td = CA.OneDimensionArrayToTwoDirection(list.ToArray(), 4); //string[,] t = new string[] //cl.CmdTableTest(); //CmdTableTests.CmdTable2Tests(); var s = TableParser.ToStringTable(td); Console.WriteLine(s); }
public async Task <ConfirmArrivalDtos> CreateOrUpdateCAAsync(int containerId, DateTime arrivalDate) { CA entity = await GetCAbyContainerId(containerId); ConfirmArrivalDtos input = new ConfirmArrivalDtos(); input.ContainerId = containerId; input.ArrivalDate = arrivalDate; if (entity != null) { entity.ArrivalDate = input.ArrivalDate; _confirmArrivalRepository.Update(entity); } else { entity = Mapper.Map <CA>(input); _confirmArrivalRepository.Insert(entity); } await UpdateContainer(containerId, arrivalDate); await UnitOfWork.SaveChangesAsync(); return(Mapper.Map <ConfirmArrivalDtos>(entity)); }
public void GetPairsStartAndEnd_3() { var input = "{ { } } } {"; string cbl = AllStrings.lcub; string cbr = AllStrings.rcub; var expected = new List <Tuple <int, int> >(); expected.Add(new Tuple <int, int>(0, 6)); expected.Add(new Tuple <int, int>(2, 4)); List <int> onlyLeftExcepted = CA.ToList <int>(10); List <int> onlyRightExcepted = CA.ToList <int>(8); var occL = SH.ReturnOccurencesOfString(input, cbl); var occR = SH.ReturnOccurencesOfString(input, cbr); List <int> onlyLeft = null; List <int> onlyRight = null; var actual = SH.GetPairsStartAndEnd(occL, occR, ref onlyLeft, ref onlyRight); AssertExtensions.EqualTuple <int, int>(expected, actual); onlyLeft.Sort(); Assert.Equal <int>(onlyLeftExcepted, onlyLeft); Assert.Equal <int>(onlyRightExcepted, onlyRight); }
private List <List <string> > Invoke() { List <List <string> > result = new List <List <string> >(); int repeat = 2; int maxMs = repeat * miliseconds; Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); var listCmd = CA.ToListString(cd, getActualFolder); var list = PowershellRunner.ci.Invoke(listCmd); foreach (var item in list) { result.Add(item); } /* * 1 - * 3 - 3514 */ stopwatch.Stop(); //DebugLogger.Instance.WriteLine("max", maxMs); //DebugLogger.Instance.WriteLine("elapsed", stopwatch.ElapsedMilliseconds); return(result); }
public void TryMagickTest() { //exceptedPath = DefaultPaths.Downloads; var listCmd = CA.ToListString("cd " + DefaultPaths.Downloads, "magick Ostman.webp Ostman.jpg"); PowershellRunner.ci.Invoke(listCmd); }
public WinCertMaker() { InitializeComponent(); certModel = new CA(); spNewCa.DataContext = certModel; basePath = Environment.CurrentDirectory; keysFolder = String.Format("{0}\\keys", basePath); caPath = String.Format("{0}\\ca.crt", keysFolder); keyPath = String.Format("{0}\\ca.key", keysFolder); serverCaPath = String.Format("{0}\\server.crt", keysFolder); serverKeyPath = String.Format("{0}\\server.key", keysFolder); serverCsrPath = String.Format("{0}\\server.csr", keysFolder); clientCaPath = String.Format("{0}\\client.crt", keysFolder); clientKeyPath = String.Format("{0}\\client.key", keysFolder); clientCsrPath = String.Format("{0}\\client.csr", keysFolder); openSslPath = String.Format("{0}\\openssl.exe", basePath); configPath = String.Format("{0}\\config.cnf", basePath); dbPath = String.Format("{0}\\index", keysFolder); serialPath = String.Format("{0}\\serial", keysFolder); }
public void SerializeObject(string filename, CA.Model.Settings objectToSerialize) { Stream stream = File.Open(filename, FileMode.Create); BinaryFormatter bFormatter = new BinaryFormatter(); bFormatter.Serialize(stream, objectToSerialize); stream.Close(); }
public void GenerateCommandForGitAddTest() { const string folder = @"D:\_Test\ConsoleApp1\ConsoleApp1\GenerateCommandForGitAdd\"; const string extension = AllExtensions.txt; const string moreCandidates = "a"; const string fileDoesntExistsOnDisc = "c"; const string fileDoesntExistsInFolder = "a/b"; List <string> filesOK = CA.ToListString("a/a.txt", "b/b.txt"); string expected = GitBashBuilder.CreateGitAddForFiles(new System.Text.StringBuilder(), filesOK); List <string> filesBad = new List <string>(); if (false) { filesBad.AddRange(CA.ToEnumerable(moreCandidates, fileDoesntExistsInFolder, fileDoesntExistsOnDisc)); } else { filesBad.AddRange(CA.ToEnumerable("a/a.txt", "b.txt - b")); } bool anyError; string actual = Program.GenerateCommandForGitAdd(TypedDebugLogger.Instance, folder, filesBad, out anyError, extension); Assert.Equal(expected, actual); }
public static void TestSerialize() { var a1 = new CA { a = 2, b = 3 }; var b1 = new CB { c = 2.4f, d = 25.5f }; var formatter = new BinaryFormatter(); byte[] s1bytes; using (var stream = new MemoryStream()) { formatter.Serialize(stream, a1); formatter.Serialize(stream, b1); s1bytes = stream.ToArray(); Debug.Log(s1bytes.Length + " => " + string.Join(",", Array.ConvertAll(s1bytes, Convert.ToString))); } using (var stream = new MemoryStream(s1bytes)) { var a2 = (CA)formatter.Deserialize(stream); //var b2 = (CB) formatter.Deserialize(stream); Debug.Log(a2); //Debug.Log(b2); } }
/// <summary> /// Insert into xlf file /// </summary> /// <param name="txtEnglishTranslate"></param> private void Add() { if (acceptHotkey.Tag == null) { pascal = ConvertPascalConvention.ToConvention(string.IsNullOrWhiteSpace(txtEnglishTranslate.Text) ? txtText.Text : txtEnglishTranslate.Text); } else { pascal = acceptHotkey.Tag.ToString(); } // A2 insertToClipboard if (IsAlreadyContainedInXlfKeys(pascal, false)) { return; } if (!string.IsNullOrWhiteSpace(pascal)) { var fromL = GetFrom(); var toL = GetTo(); if (fromL == Langs.cs) { // Write czech XmlLocalisationInterchangeFileFormat.Append(fromL, string.Empty, txtText.Text, pascal, filesWithTranslation[fromL]); XmlLocalisationInterchangeFileFormat.Append(toL, string.Empty, txtEnglishTranslate.Text, pascal, filesWithTranslation[toL]); } else { XmlLocalisationInterchangeFileFormat.Append(fromL, string.Empty, txtText.Text, pascal, filesWithTranslation[fromL]); } AddConsts(CA.ToListString(pascal)); } }
public void sr_llenar_grid_detalle(ref DataGridView dgr, long tkt) { animalitos db = new animalitos(CN.CONEC); int IDSORT = func_CODSORTEO(tkt); var query = (from qrydetalleticket in db.dbdtickets join qryanimal in db.dbanimalitos on qrydetalleticket.CODIGODTK equals qryanimal.CODIGO into AN join qryestatus in db.dbestatus on qrydetalleticket.ESTATUSDTK equals qryestatus.CODESTATUS into CA from ANX in AN.Where(x => x.CODIGO == qrydetalleticket.CODIGODTK).DefaultIfEmpty() from CAX in CA.Where(b => b.CODESTATUS == qrydetalleticket.ESTATUSDTK).DefaultIfEmpty() where qrydetalleticket.IDTICKETDTR == tkt && ANX.IDSORTEOAN == IDSORT select new { qrydetalleticket.IDTICKETDTR, qrydetalleticket.CODIGODTK, ANX.NOMBRE_ANIMALITO, qrydetalleticket.MONTO, qrydetalleticket.PREMIO, CAX.NOMESTATUS } ).ToList(); dgr.DataSource = query; }
public void AddMethod(int _Miliseconds, Action _Action) { CA ca = new CA(); ca._Action = _Action; ca._Miliseconds = _Miliseconds; _List.Add(ca); }
protected void btCrear_Click(object sender, EventArgs e) { int secuencial = (int)(Session["secuencial"]); secuencial++; Session["secuencial"] = secuencial; string claveAcceso = new CA().GeneraClaveAcceso(secuencial.ToString()); string infoTruibutaria = new MyXml().infoTributaria(claveAcceso, secuencial.ToString()); string infoFactura = new MyXml().infoFactura(txtCedula.Text.Trim(), txtNombre.Text, Session["SubTotal_sin_impuestos2"].ToString().Replace(',', '.'), Session["ivaTotal"].ToString().Replace(',', '.'), Session["Valor_Total"].ToString().Replace(',', '.')); DataTable items = (DataTable)(Session["myItems"]); string detalles = new MyXml().detalles(items); string infoAdicional = new MyXml().adiocnales(txtDireccion.Text, txtemail.Text); string xml = infoTruibutaria + infoFactura + detalles + infoAdicional; string autorizado = new MyXml().autotizerXML(xml, claveAcceso); OperadorDatos op = new OperadorDatos("TEst"); op.CadenaConexion = ConfigurationManager.ConnectionStrings["Ecomp_Connection"].ToString(); op.NombreProcedimiento = "test_insert_tViewerSend"; op.AgregarParametro("@documento_autorizado", autorizado); op.AgregarParametro("@claveAcceso", claveAcceso); op.AgregarParametro("@nroAutorizacion", claveAcceso); op.AgregarParametro("@RUC", txtCedula.Text.Trim()); op.AgregarParametro("@RazonSocial", txtNombre.Text); op.AgregarParametro("@nro_documento", "00404000000" + secuencial.ToString()); op.EjecutarNonQuery(); ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "console", "SetItemsErroresMsj('Se ha creado correctamente su documento electrónico <strong>" + "004-040-00000" + secuencial.ToString() + "</strong>');", true); }
public static void ParseVariablesTest() { var s = @" class C1{ private int var1; public string var2; void action1() { int var3; var3=var1*var1; var2=""Completed""; } } "; const string var1 = "var1"; const string var2 = "var2"; const string var3 = "var3"; var actual = RoslynParser.ParseVariables(s); Assert.Equal <string>(CA.ToListString(var1, var2, var3), CA.ToListString(actual.Item1)); Assert.Equal <string>(CA.ToListString(var3, var2), actual.Item2); }
static void Main() { string strURI = "ATSAM"; CA pCA = new CA(strURI); CCL pCCL = new CCL(); //MAPCommonLayer.SA pSA = new MAPCommonLayer.SA(strURI); if (CA.Status == Macro.ErrorCode.ecNone) { RemotingConfiguration.RegisterWellKnownClientType(typeof(BusinessFacadeLayer.BFL), "http://" + CA.ServerIPAddress + ":" + CA.PortNumber + "/" + strURI + "URI"); try { ABFL pBFL = new BusinessFacadeLayer.BFL(); pBFL.InitializeLifetimeService(); ServerSupplier serverSupplier = new ServerSupplier(pBFL); } catch { CCL.pMB.Show(pCCL.GetResourceString("ecServerConnection"), pCCL.GetResourceString("strErrorTitle"), MessageBoxIcon.Stop, MessageBoxButtons.OK); Application.Exit(); return; } } else { CCL.pMB.Show(pCCL.GetResourceString("ecClientConnection"), pCCL.GetResourceString("strErrorTitle"), MessageBoxIcon.Stop, MessageBoxButtons.OK); Application.Exit(); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new frmMain()); }
public void DoubleOrMoreMultiLinesToSingleTest() { var input = @"a b"; var excepted = @"a b"; // CA.DoubleOrMoreMultiLinesToSingle(ref input); // Assert.Equal(excepted, input); // input = @"a //b"; CA.DoubleOrMoreMultiLinesToSingle(ref input); Assert.Equal(excepted, input); input = @"@media screen and (min-width: 1025px) and (max-width: 1280px) { #cd { width: 200px; } }"; CA.DoubleOrMoreMultiLinesToSingle(ref input); Assert.Equal(excepted, input); }
public void ToJaggedTest() { var input = new bool[2, 2] { { true, false }, { false, true } }; var actual = CA.ToJagged(input); }
public void ToJaggedTTest() { var input = new int[2, 2] { { 0, 1 }, { 2, 3 } }; var actual = CA.ToJagged <int>(input); }
public void RemoveDuplicitiesListTest() { //cc List <string> foundedDuplicites; //c,b,a var list = CA.RemoveDuplicitiesList(TestData.listABCCC, out foundedDuplicites); int i = 0; }
public void GetDuplicitiesTest() { // a,b,c List <string> alreadyProcessed; // list = c var list = CA.GetDuplicities(TestData.listABCCC, out alreadyProcessed); int i = 0; }
public void HighlightingWordsTest() { string words = "Hello world Hello hello"; //string veta = SH.XCharsBeforeAndAfterWholeWords(SH.ReplaceAll(celyObsah, AllStrings.space, CA.ToListString(AllChars.whiteSpacesChars).ToArray()), stred, naKazdeStrane); var s = HtmlHelper.HighlightingWords(words, 100, 4, CA.ToListString("Hello")); int i = 0; }
public void AllExtensionsInFolders() { string folder = @"D:\_Test\sunamo\Helpers\FileSystem\FS\AllExtensionsInFolders\"; var excepted = CA.ToListString(".html", ".bowerrc", ".php"); var actual = FS.AllExtensionsInFolders(System.IO.SearchOption.TopDirectoryOnly, folder); Assert.Equal <string>(excepted, actual); }
public void AggregateFilesFromAllFolders() { List <string> files = CA.ToListString(f1_1, f1_3); Dictionary <string, int> relativeFilePathForEveryColumn = null; FileIndex.AggregateFilesFromAllFolders(folder1, fi, relativeFilePathForEveryColumn, files); }
static Func <T[]> NestedTypeMutate <T> () where T : IEquatable <T> { var local = new CA <T> .Nested(); return(() => { return new[] { CA <T> .Nested.Value, local.Value2 }; }); }
public static List <string> GetProjectsInSlnFile(string item, ref Solution sln) { sln = Solution.LoadFrom(item); var s = sln.Projects.Select(d => d.Project.FileName).ToList(); CA.ChangeContent(null, s, FS.AbsoluteFromCombinePath); return(s); }
public void ValuesBetweenQuotesTest() { var expected = CA.ToList <string>("a", "c"); var actual = SH.ValuesBetweenQuotes("'a' b 'c'", false, true); Assert.Equal(expected, actual); actual = SH.ValuesBetweenQuotes("\"a\" b \"c\"", false); Assert.Equal(expected, actual); }
static void Main(string[] args) { CA[] arr = new CA[10]; for (int i = 0; i < 10; i++) { arr[i] = new CA(i); Console.WriteLine("arr[{0}] = {1}", i, arr[i].rd); } }
public void JoinIEnumerableTest() { var input = "ab"; var input2 = "cd"; var expected = "abcd"; var actual = CA.JoinIEnumerable <char>(input, input2); Assert.Equal(expected, actual); }
public void AddMethod(int _Miliseconds, Action _Action2, Func<bool> func,bool nw) { CA ca = null; if (!nw) ca = _List.FirstOrDefault(a => a._Action2 == _Action2); if (ca == null) { ca = new CA(); lock (_List) _List.Add(ca); } ca.stacktrace = UnityEngine.StackTraceUtility.ExtractStackTrace(); ca._Action2 = _Action2; ca._Miliseconds = _Miliseconds; ca.func = func; }
public void AddMethod(int _Miliseconds, Action _Action2, Func<bool> func) { CA ca = _List.FirstOrDefault(a => a._Action2 == _Action2); if (ca == null) { ca = new CA(); lock (_List) _List.Add(ca); } ca.stacktrace = new StackTrace(); ca._Action2 = _Action2; ca._Miliseconds = _Miliseconds; ca.func = func; }
public CANotIssuedException(CA.RequestDisposition disposition) { Disposition = disposition; }