public static ICachUseCase GetUseCase(UseCaseType type, ICachService service) { switch (type) { case UseCaseType.DEFAULT: return(new CachUseCase(service)); default: return(new CachUseCase(service)); } }
protected override async void OnNavigatedTo(NavigationEventArgs e) { BackStackClass.SetBackButtonVisibility(); if (e.Parameter != null) { if (e.NavigationMode == NavigationMode.Back) { if (e.Parameter is UseCaseType && (UseCaseType)e.Parameter == UseCaseType.jatkaPaivaa) { /* Asynkroninen operaatio ilman varoituksia. */ string s = Localization.GetLocalizedTextWithVariables("EventXStoppedInListMsg", Tapahtuma.getTapahtuma().nimi); Task task = new MessageDialog(s).ShowAsync().AsTask(); /* Sulje tapahtuma*/ Tapahtuma.hylkääTapahtuma(); } BackStackClass.Navigate(typeof(StartupProjected)); } if (e.Parameter is UseCaseType) { UseCase = (UseCaseType)e.Parameter; tapahtumat = await InputOutput.ReadTapahtumatFromXmlFilesAsyncToList("Tapahtuma"); listTapahtumat.ItemsSource = tapahtumat; /* List creates Tapahtuma objects and last read Tapahtuma is stored to static lastThis variable in Tapahtuma. It needs to be discarded. */ Tapahtuma.hylkääTapahtuma(); } else { /* Problem */ throw new NotImplementedException(); } if (UseCase == UseCaseType.poista) { ValmisButton.Content = Localization.GetLocalizedText("Delete"); ValmisButton.Background = new SolidColorBrush(Colors.Red); } } }
private Guid CreateUseCase(GenericManager manager, string name, string displayName, string description, UseCaseType type, UseCaseContent content) { var usecase = new UseCase() { SchemaId = SchemaEntityReference, Name = name, Description = description, DisplayName = displayName, Type = new OptionSetValue((int)type), Content = JsonParserService.StringfyWithTypes(content), }; return(manager.Create(UseCase.LogicalName, Entity.EntityToDictionary(usecase))); }
private ICachUseCase GetUseCase(UseCaseType type, ICachService service) { return(UseCaseFactory.GetUseCase(type, service)); }
public UseCaseOptions(UseCaseType type, string name, Policy policy) { Name = name; Type = type; Policy = policy; }