public override string GetSearchClauseFromModel(ViewModel model) { var singleInputModel = model as SingleInputSearchClauseModel; if (singleInputModel == null) throw new InvalidOperationException(); return "__fileName:" + singleInputModel.Input + "*"; }
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)); }
public override string GetSearchClauseFromModel(ViewModel model) { var inputModel = model as SingleInputSearchClauseModel; Debug.Assert(inputModel != null); if (inputModel.Input.IsNullOrEmpty()) return ""; return "__directory:" + inputModel.Input; }
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); }
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; }
public abstract string GetSearchClauseFromModel(ViewModel model);
private void HandleDisplay() { inputModel = builder.GetInputModel(); InputView = GetInputViewForModel(inputModel); OnUIMessage(new UIMessageEventArgs(DisplayPopupMessage)); }