public void TestMethodCovariance() { ICreator <Device> deviceCreator = new DeviceCreator(); ICreator <Keyboard> keyboardCreator = new KeyboardCreator(); deviceCreator = keyboardCreator; }
public UploadFileSession() { _steps = new List <UploadStepDesciptor> { new UploadStepDesciptor { Step = UploadFileSessionStep.SetMediaType, PromptText = "Was möchtest du hochladen?", Conditions = new MessageVerifier.MessageCondition { Text = new MessageVerifier.TextCondition { EqualTo = new[] { "Software", "Musik", "Video", "Andere" } } }, InvalidMessageErrorText = "Bitte gib eine der folgenden Paketarten an: 'Software', 'Musik', 'Video', 'Andere'", Action = SetMediaType, Keyboard = KeyboardCreator.CreateKeyboard("Software", "Musik", "Video", "Andere") }, new UploadStepDesciptor { Step = UploadFileSessionStep.SetTitle, PromptText = "Bitte gib den Namen des Paketes ein.", Conditions = new MessageVerifier.MessageCondition { Text = new MessageVerifier.TextCondition { MinLength = 1, MaxLength = 200 } }, InvalidMessageErrorText = "Der Titel muss zwischen 1 und 200 Zeichen lang sein.", Action = SetTitle }, new UploadStepDesciptor { Step = UploadFileSessionStep.SetDescription, PromptText = "Bitte gib die Beschreibung des Paketes ein.", Conditions = new MessageVerifier.MessageCondition { Text = new MessageVerifier.TextCondition { MinLength = 1, MaxLength = 5000 } }, InvalidMessageErrorText = "Die Beschreibung muss zwischen 1 und 5000 Zeichen lang sein.", Action = SetDescription }, new UploadStepDesciptor { Step = UploadFileSessionStep.SetPlatform, PromptText = "Bitte lege die Plattform für das Paket fest.", Conditions = new MessageVerifier.MessageCondition { Text = new MessageVerifier.TextCondition { EqualTo = new[] { "Windows", "Linux", "OSX", "Android", "IOS", "Andere" } } }, InvalidMessageErrorText = "Bitte gib eine der folgenden Plattformen an: Windows, Linux, OSX, Android, IOS, Andere", Action = SetPlatform, Keyboard = KeyboardCreator.CreateKeyboard("Windows", "Linux", "Android", "IOS", "OSX", "Andere") }, new UploadStepDesciptor { Step = UploadFileSessionStep.MorePlatforms, PromptText = "Möchtest du weitere Plattformen festlegen?", Conditions = new MessageVerifier.MessageCondition { Text = new MessageVerifier.TextCondition { EqualTo = new[] { "Ja", "Nein" } } }, InvalidMessageErrorText = "Bitte gib 'Ja' oder 'Nein' ein.", Action = MorePlatforms, Keyboard = KeyboardCreator.CreateKeyboard("Ja", "Nein") }, new UploadStepDesciptor { Step = UploadFileSessionStep.SetImage, PromptText = "Bitte gib den Link zu einem Bild für das Paket an.", Conditions = new MessageVerifier.MessageCondition { Text = new MessageVerifier.TextCondition { MinLength = 1, Contains = new[] { "http", "none" } } }, InvalidMessageErrorText = "Dies ist kein gültiger Link", Action = SetImage }, new UploadStepDesciptor { Step = UploadFileSessionStep.UploadFile, PromptText = "Bitte lade nun das Paket hoch.", Conditions = new MessageVerifier.MessageCondition { File = new MessageVerifier.FileCondition { Null = false } }, InvalidMessageErrorText = "Dies ist keine gültige Datei", Action = UploadFile }, new UploadStepDesciptor { Step = UploadFileSessionStep.Finalize, PromptText = "", Conditions = new MessageVerifier.MessageCondition(), InvalidMessageErrorText = "", Action = Finalize }, new UploadStepDesciptor { Step = UploadFileSessionStep.MoreFiles, PromptText = "Möchtest du weitere Dateien hochladen?", Conditions = new MessageVerifier.MessageCondition { Text = new MessageVerifier.TextCondition { EqualTo = new[] { "Ja", "Nein" } } }, InvalidMessageErrorText = "Bitte gib 'Ja' oder 'Nein' ein.", Action = MoreFiles, Keyboard = KeyboardCreator.CreateKeyboard("Ja", "Nein") } }; }
// Use this for initialization void Awake() { StartCoroutine(latestart()); kc = gameObject.GetComponent <KeyboardCreator>(); }