コード例 #1
0
 public static string GetTarget_DestinationContentName(string specificDestinationContentName, InformationOutput informationOutput)
 {
     string destinationContentName = string.IsNullOrEmpty(specificDestinationContentName) ?
                                         informationOutput.DestinationContentName : specificDestinationContentName;
     if (string.IsNullOrEmpty(destinationContentName))
         return "bulkdump.all";
     return destinationContentName;
 }
コード例 #2
0
 public static AuthenticatedAsActiveDevice GetTarget_AuthenticatedAsActiveDevice(InformationOutput informationOutput)
 {
     var authenticationID = informationOutput.AuthenticatedDeviceID;
     if (string.IsNullOrEmpty(authenticationID))
         return null;
     VirtualOwner owner = VirtualOwner.FigureOwner(informationOutput);
     return AuthenticatedAsActiveDevice.RetrieveFromOwnerContent(owner, authenticationID);
 }
コード例 #3
0
 public static string GetTarget_LocalContentURL(string localContentName, InformationOutput informationOutput)
 {
     var invalidFilenameChars = Path.GetInvalidFileNameChars();
     bool hasInvalidFilenameCharacter = localContentName.Any(invalidFilenameChars.Contains);
     if(hasInvalidFilenameCharacter)
         throw new ArgumentException("Invalid filename character in localContentName: " + localContentName, "localContentName");
     bool requiresLocalName = informationOutput.LocalContentURL.EndsWith("/");
     bool hasLocalContentName = String.IsNullOrEmpty(localContentName) == false;
     if (requiresLocalName)
     {
         if(String.IsNullOrEmpty(localContentName))
             throw new ArgumentException("Valid argument missing for localContentName", "localContentName");
         return informationOutput.LocalContentURL + localContentName;
     } else if(hasLocalContentName)
         throw new ArgumentException("InformationOutput LocalContentUrl needs to end to / to support localContentName");
     return informationOutput.LocalContentURL;
 }
 public static TBEmailValidation GetTarget_EmailValidation(TBAccount owningAccount, TBCollaboratingGroup owningGroup, InformationOutput informationOutput, string[] ownerEmailAddresses)
 {
     TBEmailValidation emailValidation = new TBEmailValidation();
     var confirmation = new TBInformationOutputConfirmation();
     emailValidation.InformationOutputConfirmation = confirmation;
     if (owningAccount != null && owningGroup != null)
         throw new InvalidDataException("Both owning account and owning group cannot be defined");
     if (owningAccount == null && owningGroup == null)
         throw new InvalidDataException("Both owning account and owning group must not be null");
     if (owningAccount != null)
         confirmation.AccountID = owningAccount.ID;
     if (owningGroup != null)
         confirmation.GroupID = owningGroup.ID;
     confirmation.InformationOutputID = informationOutput.ID;
     emailValidation.ValidUntil = DateTime.UtcNow.AddMinutes(30);
     emailValidation.Email = ownerEmailAddresses.FirstOrDefault();
     if (emailValidation.Email == null)
         throw new InvalidDataException("Owner must have at least one email address defined");
     return emailValidation;
 }
コード例 #5
0
ファイル: EmailSupport.cs プロジェクト: kallex/Caloom
 public static void SendOutputJoinEmail(TBEmailValidation emailValidation, InformationOutput informationOutput, string[] ownerEmailAddresses)
 {
     string urlLink = GetUrlLink(emailValidation.ID);
     var confirmation = emailValidation.InformationOutputConfirmation;
     bool isAccount = confirmation.AccountID != null;
     string ownerID = isAccount
                          ? confirmation.AccountID
                          : confirmation.GroupID;
     string emailMessageFormat = InstanceConfiguration.EmailOutputJoinMessageFormat;
     string message = String.Format(emailMessageFormat, informationOutput.OutputDescription,
                                    isAccount ? "account" : "collaboration group", ownerID, urlLink);
     string subject = String.Format(InstanceConfiguration.EmailOutputJoinSubjectFormat, ownerID);
     foreach (string emailAddress in ownerEmailAddresses)
     {
         SendEmail(FromAddress, emailAddress, subject, message);
     }
 }
コード例 #6
0
ファイル: TheBallCore.designer.cs プロジェクト: kallex/Caloom
 private void CopyContentFrom(InformationOutput sourceObject)
 {
     OutputDescription = sourceObject.OutputDescription;
             DestinationURL = sourceObject.DestinationURL;
             DestinationContentName = sourceObject.DestinationContentName;
             LocalContentURL = sourceObject.LocalContentURL;
             AuthenticatedDeviceID = sourceObject.AuthenticatedDeviceID;
             IsValidatedAndActive = sourceObject.IsValidatedAndActive;
 }
コード例 #7
0
ファイル: TheBallCore.designer.cs プロジェクト: kallex/Caloom
partial         static void CreateCustomDemo(ref InformationOutput customDemoObject);
コード例 #8
0
ファイル: TheBallCore.designer.cs プロジェクト: kallex/Caloom
 public static InformationOutput CreateDefault()
 {
     var result = new InformationOutput();
             return result;
 }
コード例 #9
0
 public static string GetTarget_DestinationURL(InformationOutput informationOutput)
 {
     return informationOutput.DestinationURL;
 }
コード例 #10
0
 public static void ExecuteMethod_VerifyValidOutput(InformationOutput informationOutput)
 {
     if (informationOutput.IsValidatedAndActive == false)
         throw new SecurityException("InformationOutput is not active");
 }
コード例 #11
0
 public static void ExecuteMethod_PushToInformationOutput(IContainerOwner owner, InformationOutput informationOutput, string destinationUrl, string destinationContentName, string localContentUrl, AuthenticatedAsActiveDevice authenticatedAsActiveDevice)
 {
     if(authenticatedAsActiveDevice == null)
         throw new NotSupportedException("Push not currently supported without authenticated as device connection");
     DeviceSupport.PushContentToDevice(authenticatedAsActiveDevice, localContentUrl, destinationContentName);
 }
 public static void ExecuteMethod_SendEmailConfirmation(InformationOutput informationOutput, TBEmailValidation emailValidation, string[] ownerEmailAddresses)
 {
     EmailSupport.SendOutputJoinEmail(emailValidation, informationOutput, ownerEmailAddresses);
 }