예제 #1
0
        public static ICachUseCase GetUseCase(UseCaseType type, ICachService service)
        {
            switch (type)
            {
            case UseCaseType.DEFAULT:
                return(new CachUseCase(service));

            default:
                return(new CachUseCase(service));
            }
        }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
        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)));
        }
예제 #4
0
 private ICachUseCase GetUseCase(UseCaseType type, ICachService service)
 {
     return(UseCaseFactory.GetUseCase(type, service));
 }
예제 #5
0
 public UseCaseOptions(UseCaseType type, string name, Policy policy)
 {
     Name   = name;
     Type   = type;
     Policy = policy;
 }