Example #1
0
 public override IEmailRecipients GetRecipients()
 {
     return(new EmailRecipientsWithPermission(
                ToUser,
                ActionsRequiringPermissions.HandlePackageOwnershipRequest,
                replyTo: new[] { FromUser.ToMailAddress() }));
 }
Example #2
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (FromUser.Length != 0)
            {
                hash ^= FromUser.GetHashCode();
            }
            if (TargetUser.Length != 0)
            {
                hash ^= TargetUser.GetHashCode();
            }
            if (Content.Length != 0)
            {
                hash ^= Content.GetHashCode();
            }
            if (SendTime != 0)
            {
                hash ^= SendTime.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
Example #3
0
        private static FromUser ParseFromUser(JObject o)
        {
            var fromUser = new FromUser()
            {
                OnlineId = (String)o["onlineId"]
            };

            return(fromUser);
        }
        private static FromUser ParseFromUser(JObject o)
        {
            var fromUser = new FromUser()
            {
                OnlineId   = (String)o["onlineId"],
                Earned     = (Boolean)o["earned"],
                EarnedDate = o["earnedDate"] != null ? (string)o["earnedDate"] : string.Empty
            };

            return(fromUser);
        }
Example #5
0
        private static FromUser ParseFromUser(JObject o)
        {
            var fromUser = new FromUser()
            {
                OnlineId       = (String)o["onlineId"],
                HiddenFlag     = (bool)o["hiddenFlag"],
                Progress       = (int)o["progress"],
                LastUpdateDate = o["lastUpdateDate"] != null ? (string)o["lastUpdateDate"] : string.Empty,
                EarnedTrophies = (JObject)o["earnedTrophies"] != null?ParseEarnedTrophies((JObject)o["earnedTrophies"]) : null
            };

            return(fromUser);
        }
Example #6
0
        public void SendEmail(CodeActivityContext context, Dictionary <Guid, string> pmDetails, IWorkflowContext wfContext, IOrganizationService _service)
        {
            //From: From User
            //To: List of PM

            ActivityParty fromParty = new ActivityParty()
            {
                PartyId = new EntityReference("systemuser", FromUser.Get(context).Id)
            };

            ActivityParty toParty = new ActivityParty()
            {
                PartyId = new EntityReference(ToUser.Get(context).LogicalName, ToUser.Get(context).Id)
            };

            List <ActivityParty> ccActivityPartyList = new List <ActivityParty>();

            foreach (var item in pmDetails)
            {
                ActivityParty ccParty = new ActivityParty
                {
                    PartyId = new EntityReference(ToUser.Get(context).LogicalName, item.Key)
                };
                ccActivityPartyList.Add(ccParty);
            }

            Email email = new Email
            {
                To                = new ActivityParty[] { toParty },
                From              = new ActivityParty[] { fromParty },
                Subject           = Subject.Get(context),
                Description       = "Dear User <br /> The timeframe to complete project task has elapsed.",
                DirectionCode     = true,
                Cc                = ccActivityPartyList,
                RegardingObjectId = new EntityReference("msdyn_project", wfContext.PrimaryEntityId),
            };

            Guid _emailId = _service.Create(email);

            SendEmailRequest sendEmailreq = new SendEmailRequest
            {
                EmailId       = _emailId,
                TrackingToken = "",
                IssueSend     = true
            };

            SendEmailResponse sendEmailresp = (SendEmailResponse)_service.Execute(sendEmailreq);
        }
Example #7
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Category != 0)
            {
                hash ^= Category.GetHashCode();
            }
            if (FromUser.Length != 0)
            {
                hash ^= FromUser.GetHashCode();
            }
            if (ToUser.Length != 0)
            {
                hash ^= ToUser.GetHashCode();
            }
            hash ^= actionList_.GetHashCode();
            hash ^= messageList_.GetHashCode();
            return(hash);
        }
        private void DeleteTalkStorage(StorageFactory storageFactory)
        {
            using var md5 = MD5.Create();
            var data = md5.ComputeHash(Encoding.Default.GetBytes(FromUser.ToString()));

            var sBuilder = new StringBuilder();

            for (int i = 0, n = data.Length; i < n; i++)
            {
                sBuilder.Append(data[i].ToString("x2"));
            }

            var md5Hash = sBuilder.ToString();

            var storage = storageFactory.GetStorage(_tenantId.ToString(CultureInfo.InvariantCulture), "talk");

            if (storage != null && storage.IsDirectory(md5Hash))
            {
                storage.DeleteDirectory(md5Hash);
            }
        }