// Token: 0x060015C2 RID: 5570 RVA: 0x0004E184 File Offset: 0x0004C384
        private static EmailAddressWrapper ConvertParticipantToEmailAddressWrapper(IParticipant participant)
        {
            ParticipantInformationDictionary participantInformation            = EWSSettings.ParticipantInformation;
            ParticipantInformation           participantInformationOrCreateNew = participantInformation.GetParticipantInformationOrCreateNew(participant);

            return(EmailAddressWrapper.FromParticipantInformation(participantInformationOrCreateNew));
        }
Exemplo n.º 2
0
 public HangoutEvent(DateTime timeStamp, IParticipant sender, string text, string attachment)
 {
     TimeStamp  = timeStamp;
     Sender     = sender;
     Text       = text;
     Attachment = attachment;
 }
Exemplo n.º 3
0
 private static string AddParticipants(string s, IParticipant part1, IParticipant part2)
 {
     if (s.Contains('1') || s.Contains('2'))
     {
         if (s.Contains('1') && part1 != null)
         {
             char[] temp = part1.Name.ToCharArray();
             s = s.Replace('1', temp[0]);
         }
         else
         {
             s = s.Replace('1', ' ');
         }
         if (s.Contains('2') && part2 != null)
         {
             char[] temp = part2.Name.ToCharArray();
             s = s.Replace('2', temp[0]);
         }
         else
         {
             s = s.Replace('2', ' ');
         }
     }
     return(s);
 }
Exemplo n.º 4
0
 public static string ReplaceStrings(string text, IParticipant first, IParticipant second)
 {
     if (first != null)
     {
         if (!first.Equipment.IsBroken)
         {
             text = text.Replace('1', first.Name[0]);
         }
         else
         {
             text = text.Replace('1', char.ToLower(first.Name[0]));
         }
     }
     else
     {
         text = text.Replace('1', ' ');
     }
     if (second != null)
     {
         if (!second.Equipment.IsBroken)
         {
             text = text.Replace('2', second.Name[0]);
         }
         else
         {
             text = text.Replace('2', char.ToLower(second.Name[0]));
         }
     }
     else
     {
         text = text.Replace('2', ' ');
     }
     return(text);
 }
Exemplo n.º 5
0
 public ParticipantDto(IParticipant o)
 {
     ParticipantId = o.ParticipantId;
     Accepted = o.Accepted;
     ClientId = o.ClientId;
     SessionId = o.SessionId;
 }
Exemplo n.º 6
0
        public static IRendezVous InitialiserPlageOuverture(PayloadPlageOuverture payload)
        {
            IRendezVous rdv = Fabrique.Get <IRendezVous>();

            rdv.Sujet = $"[rdv-solidarités] - {Sanitize($"Plage d'ouverture : {string.Join(" - ", payload.Data.Motifs.Select(i => i.Name))}", SanitizeSujet)}";
            rdv.Lieu  = Sanitize(payload.Data.Lieu.Address, SanitizeLieu);

            DateTime dtd = DateTime.ParseExact(payload.Data.FirstDay, "yyyy-MM-dd", CultureInfo.InvariantCulture);
            DateTime dts = DateTime.ParseExact(payload.Data.StartTime, "HH:mm:ss", CultureInfo.InvariantCulture);
            DateTime dtf = DateTime.ParseExact(payload.Data.EndTime, "HH:mm:ss", CultureInfo.InvariantCulture);

            rdv.Debut = dtd.Add(new TimeSpan(dts.Hour, dts.Minute, dts.Second));
            rdv.Fin   = dtd.Add(new TimeSpan(dtf.Hour, dtf.Minute, dtf.Second));

            Agent        organisateur = payload.Data.Agent;
            IParticipant po           = Fabrique.Get <IParticipant>();

            po.Nom           = Sanitize($"{organisateur.LastName} {organisateur.FirstName}", SanitizeNom).Trim();
            po.Courriel      = organisateur.Email.ToLowerInvariant();
            rdv.Organisateur = po;

            rdv.Recurrence = payload.Data.Rrule;

            rdv.StatutAffichage = StatutAffichage.Occupe;
            rdv.ExternalId      = payload.Data.IcalUid;

            return(rdv);
        }
Exemplo n.º 7
0
        public static void CopyParticipants(IParticipant p)
        {
            List <IParticipant> participants = GetOrCreateParticipantsClipboard();

            participants.Add(p);
            HttpContext.Current.Session["Participants"] = participants;
        }
Exemplo n.º 8
0
        public static void CopyParticipantsRemove(IParticipant p)
        {
            List <IParticipant> participants = GetOrCreateParticipantsClipboard();

            participants = (from x in participants where (x as IParticipant).Code != (p as IParticipant).Code select x).ToList();
            HttpContext.Current.Session["Participants"] = participants;
        }
Exemplo n.º 9
0
 public void Logout(IParticipant participant)
 {
     if (participants.ContainsKey(participant.Name))
     {
         participants.Remove(participant.Name);
     }
 }
Exemplo n.º 10
0
        // set good characters in strings
        public static string ChangeStrings(String tekst, IParticipant een, IParticipant twee)
        {
            char first = 'X';

            if (tekst.Contains('1') && een != null)
            {
                if (!een.Equipment.isBroken)
                {
                    first = een.GetFirstLetter();
                }
                tekst = tekst.Replace('1', first);
            }
            else
            {
                tekst = tekst.Replace('1', ' ');
            }

            char second = 'X';

            if (tekst.Contains('2') && twee != null)
            {
                if (!twee.Equipment.isBroken)
                {
                    second = twee.GetFirstLetter();
                }
                tekst = tekst.Replace('2', second);
            }
            else
            {
                tekst = tekst.Replace('2', ' ');
            }
            return(tekst);
        }
Exemplo n.º 11
0
 public void Login(IParticipant participant)
 {
     if (!participants.ContainsKey(participant.Name))
     {
         participants.Add(participant.Name, participant);
     }
 }
Exemplo n.º 12
0
 public Slot(Team team, IParticipant participant, int slotNumber, int index)
 {
     Team        = team;
     Participant = participant;
     SlotNumber  = slotNumber;
     Index       = index;
 }
            public override void OnBindViewHolder(RecyclerView.ViewHolder viewHolderObj, int position)
            {
                IParticipant participant = mParticipants[position];
                var          viewHolder  = viewHolderObj as ViewHolder;

                viewHolder.mTitle.Text = participant.Name;
                viewHolder.mAvatar.SetParticipants(participant.Id);
                viewHolder.mParticipant = participant;

                LayerPolicy block = null;

                foreach (LayerPolicy policy in _activity.GetLayerClient().Policies)
                {
                    if (policy.GetPolicyType() != LayerPolicy.PolicyType.Block)
                    {
                        continue;
                    }
                    if (!policy.SentByUserID.Equals(participant.Id))
                    {
                        continue;
                    }
                    block = policy;
                    break;
                }

                viewHolder.mBlockPolicy        = block;
                viewHolder.mBlocked.Visibility = block == null ? ViewStates.Invisible : ViewStates.Visible;
            }
Exemplo n.º 14
0
        protected override object InternalTryGetValue(PropertyBag.BasicPropertyStore propertyBag)
        {
            IDictionary <RecipientItemType, HashSet <string> > recipients = null;

            foreach (ComplexParticipantExtractorBase <string> complexParticipantExtractorBase in ReplyAllDisplayNamesProperty.Extractors)
            {
                if (complexParticipantExtractorBase.ShouldExtract(propertyBag))
                {
                    IList <string> replyTo;
                    object         result;
                    if (complexParticipantExtractorBase.Extract(propertyBag, (Participant participant) => participant.DisplayName, this.ParticipantRepresentationComparer, out recipients, out replyTo))
                    {
                        IParticipant simpleParticipant  = base.GetSimpleParticipant(InternalSchema.Sender, propertyBag);
                        IParticipant simpleParticipant2 = base.GetSimpleParticipant(InternalSchema.From, propertyBag);
                        result = ReplyAllParticipantsRepresentationProperty <string> .BuildReplyAllRecipients <string>((simpleParticipant == null)?null : simpleParticipant.DisplayName, (simpleParticipant2 == null)?null : simpleParticipant2.DisplayName, replyTo, recipients, this.ParticipantRepresentationComparer);
                    }
                    else
                    {
                        result = new PropertyError(this, PropertyErrorCode.GetCalculatedPropertyError);
                    }
                    return(result);
                }
            }
            return(new PropertyError(this, PropertyErrorCode.GetCalculatedPropertyError));
        }
Exemplo n.º 15
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IList <ParticipantModel> > GetAllAsync(this IParticipant operations, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetAllWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 16
0
 public static void DisplayParticipantNotification(IParticipant participant, string name)
 {
     Console.Clear();
     Console.WriteLine("   Our winner is: {0}", participant.Name);
     Console.WriteLine("   Thanks for playing {0}!", name);
     Console.ReadLine();
 }
Exemplo n.º 17
0
 // Save quality after race
 private void SaveQuality(IParticipant deelnemer)
 {
     Data.Competition.KwaliteitGegevens.AddItemToList(new GegevensQualityVoorNaRace()
     {
         Deelnemer = deelnemer, QualityVoorRace = _quality[deelnemer], QualityNaRace = deelnemer.Equipment.Quality, Track = Track
     });
 }
Exemplo n.º 18
0
        protected void UnRegisterParticipantButton_Command(object sender, CommandEventArgs e)
        {
            string[]     participantInfo = e.CommandArgument.ToString().Split(',');
            IParticipant participant     = AttendRegistrationEngine.GetParticipant(participantInfo[0], participantInfo[1]);

            RegisterParticipant(participant, true);
        }
Exemplo n.º 19
0
 public static IParticipant AddLogTextAndSave(string type, string info, IParticipant participant)
 {
     participant = (participant as ParticipantBlock).CreateWritableClone() as ParticipantBlock;
     AddLogText(type, info, participant);
     ServiceLocator.Current.GetInstance <IContentRepository>().Save(participant as IContent, EPiServer.DataAccess.SaveAction.Publish | EPiServer.DataAccess.SaveAction.ForceCurrentVersion, EPiServer.Security.AccessLevel.NoAccess);
     return(participant);
 }
Exemplo n.º 20
0
 public void LapCompletedTest(IParticipant driver)
 {
     driver.LapsCompleted++;
     Console.SetCursorPosition(0, y);
     //Console.Write($"Driver {driver.Name} has completed a lap in {driver.LapTime.TotalSeconds} seconds. Lap nr: {driver.LapsCompleted}"); //program seems to go back in time and change the lapscompleted of a driver. (multithreading issue?)
     y++;
 }
Exemplo n.º 21
0
 public Transaction(IParticipant Payee, IParticipant Payer, IAmount Amount, DateTime Date)
 {
     this.Payee  = Payee;
     this.Payer  = Payer;
     this.Amount = Amount;
     this.Date   = Date;
 }
            public void Refresh()
            {
                // Get new sorted list of Participants
                IParticipantProvider provider = App.GetParticipantProvider();

                mParticipants.Clear();
                foreach (string participantId in _activity.mConversation.Participants)
                {
                    if (participantId.Equals(_activity.GetLayerClient().AuthenticatedUserId))
                    {
                        continue;
                    }
                    IParticipant participant = provider.GetParticipant(participantId);
                    if (participant == null)
                    {
                        continue;
                    }
                    mParticipants.Add(participant);
                }
                mParticipants.Sort();

                // Adjust participant container height
                int height = (int)System.Math.Round((double)mParticipants.Count * _activity.Resources.GetDimensionPixelSize(Resource.Dimension.atlas_secondary_item_height));

                LinearLayout.LayoutParams params_ = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, height);
                _activity.mParticipantRecyclerView.LayoutParameters = params_;

                // Notify changes
                NotifyDataSetChanged();
            }
Exemplo n.º 23
0
        protected override void OnInit(EventArgs e)
        {
            DetailsXFormControl.FormDefinition = XForm.CreateInstance(new Guid((CurrentData as EventPageBase).RegistrationForm.Id.ToString()));

            string email = Request.QueryString["email"];
            string code  = Request.QueryString["code"];

            HiddenCode.Value  = code;
            HiddenEmail.Value = email;


            if (!string.IsNullOrEmpty(email) && !string.IsNullOrEmpty(code))
            {
                IParticipant participant = AttendRegistrationEngine.GetParticipant(email, code);
                if (participant != null)
                {
                    SerializableXmlDocument xmlDoc = new SerializableXmlDocument();
                    xmlDoc.LoadXml(participant.XForm);
                    DetailsXFormControl.Data.Data = xmlDoc;
                }
            }

            SessionsPanel.Controls.Add(AttendSessionEngine.GetSessionsControl(CurrentData.ContentLink, null));
            SessionsPanel.DataBind();
            base.OnInit(e);
        }
Exemplo n.º 24
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='participantModel'>
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <ParticipantModel> CreatedOrUpdateAsync(this IParticipant operations, ParticipantModel participantModel, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreatedOrUpdateWithHttpMessagesAsync(participantModel, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Exemplo n.º 25
0
        private MySTT GetSTTEngine(uint aUserId)
        {
            try
            {
                if (this.mSpeechToTextPool.ContainsKey(aUserId))
                {
                    return(this.mSpeechToTextPool[aUserId]);
                }
                else
                {
                    string lUserDisplayName = aUserId.ToString();
                    string lUserId          = aUserId.ToString();

                    IParticipant participant        = this.GetParticipantFromMSI(aUserId);
                    var          participantDetails = participant?.Resource?.Info?.Identity?.User;

                    if (participantDetails != null)
                    {
                        lUserDisplayName = participantDetails.DisplayName;
                        lUserId          = participantDetails.Id;
                    }

                    var lNewSE = new MySTT(this._callId, lUserDisplayName, lUserId, this.GraphLogger, this._eventPublisher, this._settings);
                    this.mSpeechToTextPool.Add(aUserId, lNewSE);

                    return(lNewSE);
                }
            }
            catch (Exception ex)
            {
                this.GraphLogger.Error($"GetSTTEngine failed for userid: {aUserId}. Details: {ex.Message}");
            }

            return(null);
        }
        public IDisposable Participate <TRequest, TResponse>(string topic, IParticipant <TRequest, TResponse> participant)
        {
            var token = _messageBus.Participate(topic, participant);

            _subscriptions.Add(token);
            return(token);
        }
Exemplo n.º 27
0
 public SectionData(IParticipant left, IParticipant right)
 {
     Left          = left;
     DistanceLeft  = 0;
     Right         = right;
     DistanceRight = 0;
 }
Exemplo n.º 28
0
 //public SectionData() { }
 public SectionData(IParticipant left, int distanceLeft, IParticipant right, int distanceRight)
 {
     this.Left     = left;
     DistanceLeft  = distanceLeft;
     this.Right    = right;
     DistanceRight = distanceRight;
 }
Exemplo n.º 29
0
 private static string DrawParticipants(string graphic, IParticipant right, IParticipant left)
 {
     if (right != null)
     {
         if (right.Equipment.IsBroken)
         {
             graphic = graphic.Replace('1', '!');
         }
         else
         {
             graphic = graphic.Replace('1', right.Name.ToCharArray()[0]);
         }
     }
     else
     {
         graphic = graphic.Replace('1', ' ');
     }
     if (left != null)
     {
         if (left.Equipment.IsBroken)
         {
             graphic = graphic.Replace('2', '!');
         }
         else
         {
             graphic = graphic.Replace('2', left.Name.ToCharArray()[0]);
         }
     }
     else
     {
         graphic = graphic.Replace('2', ' ');
     }
     return(graphic);
 }
Exemplo n.º 30
0
 void OnParticipantAdded(string username, ChannelId channel, IParticipant participant)
 {
     if (_vivoxVoiceManager.ActiveChannels.Count > 0)
     {
         _lobbyChannelId = _vivoxVoiceManager.ActiveChannels.FirstOrDefault().Channel;
     }
 }
Exemplo n.º 31
0
 public static IParticipant AddLogTextAndSave(string type, string info, IParticipant participant)
 {
     participant = (participant as ParticipantBlock).CreateWritableClone() as ParticipantBlock;
     AddLogText(type, info, participant);
     ServiceLocator.Current.GetInstance<IContentRepository>().Save(participant as IContent, EPiServer.DataAccess.SaveAction.Publish | EPiServer.DataAccess.SaveAction.ForceCurrentVersion, EPiServer.Security.AccessLevel.NoAccess);
     return participant;
 }
Exemplo n.º 32
0
        private void LogSectionTime(IParticipant participant, DateTime time, Section section)
        {
            TimeSpan span = time - StartTime - _previousSectionTimes[participant];

            _previousSectionTimes[participant] += span;
            Data.Competition.LogSectionTime(participant, span, section);
        }
Exemplo n.º 33
0
 protected string Income(IParticipant participant)
 {
     if(participant.AttendStatus == AttendStatus.Confirmed.ToString() || participant.AttendStatus == AttendStatus.Participated.ToString()) { 
         TotalIncome += participant.Price;
         TotalCount++;
     }
     return string.Empty;
 }
Exemplo n.º 34
0
 public ParticipantViewModel(IParticipant participant)
     : this()
 {
     Id = participant.Id;
     Name = participant.Name;
     Avatar = participant.Avatar;
     IsUserContact = participant.IsUserContact;
     ParticipantAteCoefficient = participant.ParticipantAteCoefficient;
 }
Exemplo n.º 35
0
 public static void AddParticipantToWorksheet(Worksheet ws, int row, IParticipant p)
 {
     string participantData = GetParticipantData(p, null);
     string[] participantValues = participantData.Split(';');
     for (int i = 0; i < participantValues.Length; i++)
     {
         ws.Cells[row, i] = new Cell(participantValues[i]);
     }
 }
Exemplo n.º 36
0
 public bool SendStatusMail(IParticipant participant)
 {
     AttendStatus status = AttendStatus.Undefined;
     EventPageBase CurrentEvent = EPiServer.DataFactory.Instance.Get<EventPageBase>(participant.EventPage);
     Enum.TryParse<AttendStatus>(participant.AttendStatus, out status);
     foreach (ScheduledEmailBlock scheduledEmailBlock in AttendScheduledEmailEngine.GetScheduledEmails(CurrentEvent.ContentLink, SendOptions.Action, status))
     {
         AttendScheduledEmailEngine.SendScheduledEmail(scheduledEmailBlock, participant);
     }
     return true;
 }
Exemplo n.º 37
0
        public virtual void Register(IParticipant participant)
        {
            // checking if participant is already in dictionary
            if (Participants.ContainsValue(participant) == false)
            {
                Participants[participant.Name] = participant;
            }

            // adding this mediator object to participant when registering
            participant.Mediator = this;
        }
Exemplo n.º 38
0
        public Server(ServerInit serverInit)
        {
            _serverId = serverInit.Uuid;
            _serverCount = serverInit.ServerCount;
            _participant = new Participant(_serverId, new KeyValueStorage());
            _version = serverInit.Version;
            _isSplitLocked = false;
            StartHearthBeat();

            _parent = serverInit.Parent;
            _faultDetection = serverInit.FaultDetection;
        }
Exemplo n.º 39
0
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            Response.Cache.SetExpires(DateTime.Now.AddSeconds(-1));

            string idstring = Request.QueryString["participant"];
            string email = Request.QueryString["email"];
            string code = Request.QueryString["code"];

            int id = 0;
            int.TryParse(idstring, out id);

            registration = AttendRegistrationEngine.GetParticipant(id);

            if (null == registration)
            {
                Response.Status = "404 Not Found";
                Response.StatusCode = 404;
                Response.End();
            }
            else
            {
                EventPageBase EventPageBaseData = EPiServer.DataFactory.Instance.GetPage(registration.EventPage) as EventPageBase;

                var file = ServiceLocator.Current.GetInstance<IContentRepository>().Get<MediaData>(EventPageBaseData.EventDetails.PdfTemplate);
                string pdfTemplateUrl = UrlResolver.Current.GetUrl(file.ContentLink);
                
                //string pdfTemplateUrl = EventPageBaseData.EventDetails.PdfTemplate;
                var filestream = file.BinaryData.OpenRead();
                

                VirtualFile vf = HostingEnvironment.VirtualPathProvider.GetFile(pdfTemplateUrl);

                string physicalPath = "";
                /*
                UnifiedFile uf = vf as UnifiedFile;
                if (null != uf)
                    physicalPath = uf.LocalPath;
                */
                Response.ContentType = "application/pdf";
                Response.AddHeader("Content-Disposition", String.Format("attachment; filename=EventDiploma_{0}.pdf", code));

                PdfGenerator.Create(filestream, registration, EventPageBaseData, Response.OutputStream);

                Response.Flush();
                Response.End();
            }
        }
Exemplo n.º 40
0
        public static void SendScheduledEmail(ScheduledEmailBlock scheduledEmailBlock, IParticipant participant)
        {
            EmailTemplateBlock et;
            EmailSender email;

            if (scheduledEmailBlock != null)
            {
                if (scheduledEmailBlock.EmailTemplateContentReference == null)
                    et = (scheduledEmailBlock.EmailTemplate);
                else
                    et = DataFactory.Instance.Get<EmailTemplateBlock>(scheduledEmailBlock.EmailTemplateContentReference);

                if (et != null)
                {
                    email = new EmailSender(participant, et);
                    email.Send();
                }
            }
        }
        public bool SendStatusMail(IParticipant participant, EmailTemplateBlock et)
        {
            EmailSender email;
            email = new EmailSender(participant, et);

            email.Send();

            return true;
        }
Exemplo n.º 42
0
 private static string GetParticipantData(IParticipant participant, List<string> formFields)
 {
     string data = participant.AttendStatus.ToString() + ";" + participant.Email + ";" + participant.Code + ";";
     NameValueCollection allFormFields = AttendRegistrationEngine.GetFormData(participant);
     if (formFields == null)
         foreach (var key in allFormFields.AllKeys)
             data += allFormFields.Get(key).Replace(System.Environment.NewLine, ", ") + ";";
     else
     {
         foreach (string formField in formFields)
         {
             if (!string.IsNullOrEmpty(formField))
                 data += AttendRegistrationEngine.GetParticipantInfo(participant, formField).Replace(System.Environment.NewLine, ", ") + ";";
         }
     }
     return data;
 }
Exemplo n.º 43
0
 protected string GetFormData(IParticipant participant, string fieldname)
 {
     return AttendRegistrationEngine.GetParticipantInfo(participant, fieldname);
 }
Exemplo n.º 44
0
 public ParticipantHandler(IParticipant participant)
 {
     _participant = participant;
 }
Exemplo n.º 45
0
        private static void RemoveParticipant(IParticipant participant)
        {
            foreach(ICapability ic in participant.Capabilities)
            {
                DisposeCapability(ic);
            }

            participants.Remove(participant.Identifier);

            try
            {
                if (ParticipantRemoved != null)
                {
                    FormInvoke(ParticipantRemoved, new object[] { participant } );
                }

                if (logActivity == true)
                {
                    eventLog.WriteEntry("Removed " + participant.ToString(), EventLogEntryType.Information, 2);
                }
            }
            catch (ThreadAbortException) {}
            catch (Exception e)
            {
                eventLog.WriteEntry(e.ToString() ,EventLogEntryType.Error, 99);
            }
        }
 public override string GetEditUrl(IParticipant participant)
 {
     return EPiServer.Editor.PageEditing.GetEditUrl((participant as EPiServer.Core.IContent).ContentLink);
 }
 public void SetSelectedAnonymous(IParticipant participant)
 {
     SelectedAnonymous = participant;
 }
Exemplo n.º 48
0
 public static void AddLogText(string type, string info, IParticipant participant)
 {
     participant.Log = participant.Log + DateTime.Now.ToString() + "|" + type + "|" + info + ";";
 }
Exemplo n.º 49
0
        private void OnParticipantRemoved(IParticipant p)
        {
            if (Conference.ActiveVenue != null) // We may have already left the venue and this is coming in late because it's invoked on the form thread and comes in via the message loop
            {
                // Remove the receiver participant from the list
                foreach (ListViewItem lvi in listView.Items)
                {
                    if (lvi.Tag == p)
                    {
                        imageList.Images.RemoveAt(lvi.Index);
                        listView.Items.Remove(lvi);
                    }
                }

                RefreshImages();
                DisplayParticipantCount();
            }
        }
Exemplo n.º 50
0
        protected static string GetPropertyValue(string objectName, string propertyName, EventPageBase CurrentEvent, IParticipant CurrentParticipant)
        {
            object value = null;

            if (0 == String.Compare("CurrentPage", objectName, true))
            {
                if (0 == String.Compare(propertyName, "PageLinkUrl", true))
                {
                    string linkUrl = CurrentEvent.LinkURL;
                    UrlBuilder ub = new UrlBuilder(linkUrl);

                    Global.UrlRewriteProvider.ConvertToExternal(ub, CurrentEvent.PageLink, System.Text.Encoding.UTF8);

                    value = ub.ToString();
                }
                else
                {
                    value = CurrentEvent.Property[propertyName];
                }
            }
            else if (0 == String.Compare("CurrentRegistration", objectName, true))
            {
                value = AttendRegistrationEngine.GetParticipantInfo(CurrentParticipant, propertyName);
            }


            if (null == value)
                return "";
            else
                return value.ToString();
        }
Exemplo n.º 51
0
        private static void RaiseCapabilityParticipantRemoved(ICapability capability, IParticipant participant)
        {
            try
            {
                if (CapabilityParticipantRemoved != null)
                {
                    FormInvoke(CapabilityParticipantRemoved, new object[] { capability, new ParticipantEventArgs(participant) } );
                }

                if (logActivity == true)
                {
                    eventLog.WriteEntry("CapabilityParticipantRemoved " + capability.ToString() + ":" + participant.ToString(), EventLogEntryType.Information, 1);
                }
            }
            catch (ThreadAbortException) {}
            catch (Exception e)
            {
                eventLog.WriteEntry(e.ToString(),EventLogEntryType.Error, 99);
            }
        }
Exemplo n.º 52
0
 public void Add ( string identifier, IParticipant iParticipant )
 {
     Dictionary.Add( identifier, iParticipant );
 }
Exemplo n.º 53
0
 private static void OnParticipantRemoved(IParticipant p)
 {
     Console.WriteLine(string.Format(CultureInfo.CurrentCulture, Strings.ParticipantRemoved, p.Name));
 }
 public override void SaveParticipant(IParticipant participant)
 {
     ServiceLocator.Current.GetInstance<IContentRepository>().Save(participant as EPiServer.Core.IContent, EPiServer.DataAccess.SaveAction.Publish);
 }
Exemplo n.º 55
0
 public EmailSender(IParticipant participant, EmailTemplateBlock emailTemplate)
 {
     CurrentEvent = EPiServer.DataFactory.Instance.Get<EventPageBase>(participant.EventPage);
     CurrentParticipant = participant;
     Email = EmailTemplate.Load(emailTemplate, CurrentEvent, CurrentParticipant);
 }
Exemplo n.º 56
0
 private static RiotJsTransformer.JavascriptyPlayer TransformParticipant(IParticipant participant, int teamId, long dudeAccountId)
 {
     GameParticipant gameParticipant = participant as GameParticipant;
     if (gameParticipant == null)
     {
         return new RiotJsTransformer.JavascriptyPlayer()
         {
             PickState = "completed"
         };
     }
     double accountId = -1;
     double summonerId = -1;
     PlayerParticipant playerParticipant = gameParticipant as PlayerParticipant;
     if (playerParticipant != null)
     {
         accountId = playerParticipant.AccountId;
         summonerId = playerParticipant.SummonerId;
     }
     RiotJsTransformer.JsRerollState jsRerollState = null;
     AramPlayerParticipant aramPlayerParticipant = gameParticipant as AramPlayerParticipant;
     if (aramPlayerParticipant != null && aramPlayerParticipant.PointSummary != null)
     {
         PointSummary pointSummary = aramPlayerParticipant.PointSummary;
         RiotJsTransformer.JsRerollState jsRerollState1 = new RiotJsTransformer.JsRerollState()
         {
             Points = (int)pointSummary.CurrentPoints,
             MaximumPoints = pointSummary.MaxRolls * (int)pointSummary.PointsCostToRoll,
             RerollCost = (int)pointSummary.PointsCostToRoll
         };
         jsRerollState = jsRerollState1;
     }
     RiotJsTransformer.JavascriptyPlayer javascriptyPlayer = new RiotJsTransformer.JavascriptyPlayer()
     {
         Name = gameParticipant.SummonerName,
         InternalName = gameParticipant.SummonerInternalName,
         SummonerId = summonerId,
         AccountId = accountId,
         TeamId = teamId,
         RerollState = jsRerollState,
         SpellIds = new int[0],
         PickState = RiotJsTransformer.TransformPickState(gameParticipant.PickMode),
         IsDude = accountId == (double)dudeAccountId
     };
     return javascriptyPlayer;
 }
Exemplo n.º 57
0
 private void OnParticipantAdded(IParticipant p)
 {
     if (Conference.ActiveVenue != null) // We may have already left the venue and this is coming in late because it's invoked on the form thread and comes in via the message loop
     {
         ListViewItem lvi = new ListViewItem();
         lvi.Text = p.Name;
         lvi.Tag = p;
         //toolTip.SetToolTip(lvi, p.ToString());
         listView.Items.Add(lvi);
         imageList.Images.Add(p.DecoratedIcon);
         RefreshImages();
         DisplayParticipantCount();
     }
 }
Exemplo n.º 58
0
 public static EmailTemplate Load(EmailTemplateBlock template, EventPageBase EventPageBase, IParticipant participant)
 {
     EmailTemplate email = new EmailTemplate();
     email.HtmlBody = PopulatePropertyValues(template.MainBody != null ? template.MainBody.ToString() : string.Empty, EventPageBase, participant);
     email.Body = PopulatePropertyValues(template.MainTextBody, EventPageBase, participant);
     email.To = PopulatePropertyValues(template.To, EventPageBase, participant);
     email.From = PopulatePropertyValues(template.From, EventPageBase, participant);
     email.Cc = PopulatePropertyValues(template.CC, EventPageBase, participant);
     email.Bcc = PopulatePropertyValues(template.BCC, EventPageBase, participant);
     email.Subject = PopulatePropertyValues(template.Subject, EventPageBase, participant);
     email.Participant = participant;
     email.SendAsSms = template.SendAsSms;
     return email;
 }
Exemplo n.º 59
0
        protected List<string> GetFormFields(IParticipant participant)
        {
            List<string> fieldsList = new List<string>();
            foreach (ListItem checkBox in FormFieldsCheckBoxList.Items)
            {
                if (checkBox.Selected)
                    fieldsList.Add(AttendRegistrationEngine.GetParticipantInfo(participant, checkBox.Value) ?? "&nbsp;");

            }
            return fieldsList;
        }
Exemplo n.º 60
0
        public static string PopulatePropertyValues(string template, EventPageBase EventPageBase, IParticipant participant)
        {
            if (template != null)
            {
                template = EmailTemplate.databindPattern.Replace(template, delegate(Match m)
                {

                    string value = GetPropertyValue(m.Groups[1].Value, m.Groups[2].Value, EventPageBase, participant);

                    if (!String.IsNullOrEmpty(value))
                        value = EmailTemplate.xmlSafe.Replace(value, new MatchEvaluator(XmlSafe));

                    return value;
                });
            }
            return template;
        }