コード例 #1
0
 public ThoughtRecordListModel(IDatabaseService db)
 {
     stringLoader = new StringResourceService("PageTitles");
     Title        = Title = ResourceLoader.GetForCurrentView("PageTitles").GetString("MyThoughtRecordsTitle");
     database     = db;
     Situations   = new ObservableCollection <Situation>();
 }
コード例 #2
0
 public ThoughtRecordDisplayModel(IDatabaseService db)
 {
     database             = db;
     thoughtRecordService = new ThoughtRecordService();
     stringLoader         = new StringResourceService("PageTitles");
     Title         = stringLoader.GetString("MyThoughtRecordsTitle");
     SectionTitles = thoughtRecordService.GetTitleModel();
 }
コード例 #3
0
        /// <summary>
        /// These constructors are called by the App class to initialize
        /// </summary>

        public NavigationParameterModel(IDatabaseService databaseService,
                                        LicenseInformation licenseInformation,
                                        IStringResourceService stringResourceService)
        {
            DatabaseService       = databaseService;
            LicenseInformation    = licenseInformation;
            StringResourceService = stringResourceService;
        }
コード例 #4
0
 public NavigationParameterModel(IDatabaseService databaseService,
                                 LicenseInformation licenseInformation,
                                 IStringResourceService stringResourceService,
                                 VoiceCommandActivatedEventArgs voiceCommandArgs)
 {
     DatabaseService                = databaseService;
     LicenseInformation             = licenseInformation;
     StringResourceService          = stringResourceService;
     VoiceCommandActivatedEventArgs = voiceCommandArgs;
 }
コード例 #5
0
 private void InitializeOrUpdateStringLoader(string fileName)
 {
     if (stringLoader == null)
     {
         stringLoader = new StringResourceService(fileName);
     }
     else
     {
         stringLoader.SetFile(fileName);
     }
 }
コード例 #6
0
 public ThoughtRecordEditModel(IDatabaseService db)
 {
     stringLoader           = new StringResourceService("PageTitles");
     newThoughtRecordTitle  = stringLoader.GetString("NewThoughtRecordPageTitle");
     editThoughtRecordTitle = stringLoader.GetString("EditThoughtRecordPageTitle");
     thoughtRecordService   = new ThoughtRecordService();
     SectionTitles          = thoughtRecordService.GetTitleModel();
     database = db;
     CreateNewThoughtRecord();
     commandsEnabled    = true;
     IsCurrentDataSaved = true;
 }
コード例 #7
0
 public ThoughtRecordEditModel(int thoughtRecordId, IDatabaseService db)
 {
     stringLoader           = new StringResourceService("PageTitles");
     newThoughtRecordTitle  = stringLoader.GetString("NewThoughtRecordPageTitle");
     editThoughtRecordTitle = stringLoader.GetString("EditThoughtRecordPageTitle");
     Title = editThoughtRecordTitle;
     thoughtRecordService = new ThoughtRecordService();
     SectionTitles        = thoughtRecordService.GetTitleModel();
     database             = db;
     InitializeThoughtRecord(thoughtRecordId);
     DefaultInputText = thoughtRecordService.GetDefaultInputText();
     commandsEnabled  = true;
 }
コード例 #8
0
        public string Convert(ResolutionContext context)
        {
            var sourceValue = (bool)context.SourceValue;

            if (_stringResourceService == null)
            {
                _stringResourceService = EngineContext.Current.Resolve <IStringResourceService>();
            }

            if (sourceValue)
            {
                return(_stringResourceService.GetResourceValue(MappingConstants.Texts.True));
            }

            return(_stringResourceService.GetResourceValue(MappingConstants.Texts.False));
        }
コード例 #9
0
        public string Convert(ResolutionContext context)
        {
            var sourceValue = context.SourceValue.ToStringOrEmpty();

            if (!string.IsNullOrEmpty(sourceValue))
            {
                return(sourceValue);
            }

            if (context.Parent != null && (context.Parent.SourceType.Name.StartsWith("Editable") || context.Parent.DestinationType.Name.StartsWith("Editable")))
            {
                return(null);
            }

            if (_stringResourceService == null)
            {
                _stringResourceService = EngineContext.Current.Resolve <IStringResourceService>();
            }

            var result = _stringResourceService.GetResourceValue(MappingConstants.Texts.Empty);

            return(result);
        }
コード例 #10
0
 public HelpModel()
 {
     stringLoader = new StringResourceService("PageTitles");
     Title        = stringLoader.GetString("HelpPageTitle");
     InitializeContent();
 }
コード例 #11
0
 public InformationModel()
 {
     stringLoader = new StringResourceService("PageTitles");
     Title        = stringLoader.GetString("InformationPageTitle");
     InitializeContent();
 }
コード例 #12
0
 public HomeController(IStringResourceService _stringResourceService)
 {
     this.stringResourceService = _stringResourceService;
 }