Inheritance: System.NotifyPropertyChangedBase
コード例 #1
0
        public override string GetSearchClauseFromModel(ViewModel model)
        {
            var singleInputModel = model as SingleInputSearchClauseModel;
	        if (singleInputModel == null)
		        throw new InvalidOperationException();

	        return "__fileName:" + singleInputModel.Input + "*";
        }
コード例 #2
0
        public override string GetSearchClauseFromModel(ViewModel model)
        {
            var rangeModel = model as FileSizeRangeClauseModel;
            Debug.Assert(rangeModel != null);

            return string.Format("__size_numeric:[{0} TO {1}]", 
                ConvertInputStringToRangeValue(rangeModel.LowerLimit),
                ConvertInputStringToRangeValue(rangeModel.UpperLimit));
        }
コード例 #3
0
        public override string GetSearchClauseFromModel(ViewModel model)
        {
            var inputModel = model as SingleInputSearchClauseModel;
            Debug.Assert(inputModel != null);

	        if (inputModel.Input.IsNullOrEmpty())
		        return "";
	        
			return "__directory:" + inputModel.Input;
        }
コード例 #4
0
        public override string GetSearchClauseFromModel(ViewModel model)
        {
            var rangeModel = model as LastModifiedRangeClauseModel;
            Debug.Assert(rangeModel != null);

            var lowerLimit = ParseDateAndConvertToSortableFormat(rangeModel.LowerLimit, DateTime.MinValue);
            var upperLimit = ParseDateAndConvertToSortableFormat(rangeModel.UpperLimit, DateTime.MaxValue);

            return string.Format("__modified:[{0} TO {1}]", lowerLimit, upperLimit);
        }
コード例 #5
0
        private FrameworkElement GetInputViewForModel(ViewModel inputModel)
        {
            var inputModelType = inputModel.GetType();
            var viewTypeName = inputModelType.Namespace + "." + inputModelType.Name + "View";

            var viewType = Type.GetType(viewTypeName);
	        if (viewType == null)
		        throw new ArgumentException(
			        string.Format("Could not find view for inputModel. Expected to find UserControl called '{0}'", viewTypeName));

	        var view = Activator.CreateInstance(viewType) as FrameworkElement;
	        if (view == null)
		        throw new ArgumentException(
			        string.Format("Could not find view for inputModel. Expected to find UserControl called '{0}'", viewTypeName));

	        view.DataContext = inputModel;

            return view;
        }
コード例 #6
0
 public abstract string GetSearchClauseFromModel(ViewModel model);
コード例 #7
0
 private void HandleDisplay()
 {
     inputModel = builder.GetInputModel();
     InputView = GetInputViewForModel(inputModel);
     OnUIMessage(new UIMessageEventArgs(DisplayPopupMessage));
 }