public void SetContent(IContentControl control) { if (control.ContentTypeParameter == null) { return; } //var type = Type.GetType(control.ContentTypeParameter,true,true); //if (type == null) return; control.Content = GetEnumList(control.ContentTypeParameter as Type); }
} // SwitchToDeviceView() /// <summary> /// Switches to the empty view. /// </summary> private void SwitchToEmptyView() { if (this.emptyViewControl == null) { this.emptyViewControl = new EmptyViewControl(); } // if this.SetCurrentViewControl(this.emptyViewControl); this.currentView = this.emptyViewControl; } // SwitchToEmptyView()
} // SwitchToServiceView() /// <summary> /// Switches to the device view. /// </summary> /// <param name="device">The device.</param> private void SwitchToDeviceView(UpnpDevice device) { if (this.deviceView == null) { this.deviceView = new DeviceInfoControl(); } // if this.SetCurrentViewControl(this.deviceView); this.currentView = this.deviceView; this.deviceView.Device = device; } // SwitchToDeviceView()
} // SwitchContentPanel() /// <summary> /// Switches to the action view. /// </summary> /// <param name="action">The action.</param> private void SwitchToActionView(UpnpServiceAction action) { if (this.actionView == null) { this.actionView = new ActionInfoControl(); } // if this.SetCurrentViewControl(this.actionView); this.currentView = this.actionView; this.actionView.Action = action; } // SwitchToActionView()
/// <summary> /// 设置扩展控件ExtContent属性值 /// </summary> /// <param name="control">扩展控件</param> public static Boolean Verify(IContentControl control) { if (control == null || String.IsNullOrEmpty(control.VerifyType)) return true; var type = KeyTypeList[control.VerifyType.ToUpper()]; if (type == null) { return false; } var valueValidation = Activator.CreateInstance(type) as IValueVerifyType; return valueValidation != null && valueValidation.Verify(control); }
} // SwitchToActionView() /// <summary> /// Switches to the service view. /// </summary> /// <param name="service">The service.</param> private void SwitchToServiceView(UpnpService service) { if (this.serviceView == null) { this.serviceView = new ServiceInfoControl(); } // if this.serviceView.Service = service; this.serviceView.CheckForServiceImplementation(); this.SetCurrentViewControl(this.serviceView); this.currentView = this.serviceView; } // SwitchToServiceView()
private void UpdateSelectedContent(IContentControl item) { if (SelectedContentTemplate != item.ContentTemplate) { SelectedContentTemplate = item.ContentTemplate; } if (SelectedContent != item.Content) { SelectedContent = item.Content; } }
public bool InputtingVerify(IContentControl control) { return(true); if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) { return(true); } var reg = new Regex(@"^\d+(\.\d+)?$"); return(reg.IsMatch(control.Value.ToString())); }
private TabPage FindTabPageWith(IContentControl contentControl) { foreach (TabPage page in _tabControl.TabPages) { var ctrl = page.Controls[0]; if (ctrl.Equals(contentControl)) { return(page); } } return(null); }
public static void UpdateRoot(this IViewBuilder viewBuilder, IContentControl control, IViewBuilder prevViewBuilder) { Debug.Assert(!object.ReferenceEquals(viewBuilder, prevViewBuilder)); var last = prevViewBuilder == null ? FSharpOption <Types.IView> .None : FSharpOption <Types.IView> .Some(prevViewBuilder.Build()); var next = viewBuilder == null ? FSharpOption <Types.IView> .None : FSharpOption <Types.IView> .Some(viewBuilder.Build()); Avalonia.FuncUI.VirtualDom.VirtualDom.updateRoot(control, last, next); }
private void OnItemCheckedStateChanged(IContentControl sender, ContentControlEventArgs args) { if (args.UiElementInfo != null) { if (args.Checked) { _checkedItems.Add(args.UiElementInfo); } else { _checkedItems.Remove(args.UiElementInfo); } } }
/// <summary> /// 设置扩展控件ExtContent属性值 /// </summary> /// <param name="control">扩展控件</param> public static Boolean InputtingVerify(IContentControl control) { if (control == null || (String.IsNullOrEmpty(control.VerifyTypeName) && control.VerifyType == null)) { return(true); } var type = control.VerifyType ?? KeyTypeDic[control.VerifyTypeName.ToUpper()]; if (type == null) { return(false); } var valueValidation = Activator.CreateInstance(type) as IValueVerifyType; return(valueValidation != null && valueValidation.InputtingVerify(control)); }
/// <summary> /// 设置扩展控件ExtContent属性值 /// </summary> /// <param name="control">扩展控件</param> public static Boolean Verify(IContentControl control) { if (control == null || String.IsNullOrEmpty(control.VerifyType)) { return(true); } var type = KeyTypeList[control.VerifyType.ToUpper()]; if (type == null) { return(false); } var valueValidation = Activator.CreateInstance(type) as IValueVerifyType; return(valueValidation != null && valueValidation.Verify(control)); }
/// <summary> /// 设置控件的Value属性值 /// </summary> /// <param name="control">扩展控件</param> public static void ExtSetValue(IContentControl control) { try { if (control == null || String.IsNullOrEmpty(control.ContentTypeName) || String.IsNullOrEmpty(control.ContentTypeParameter)) return; if (!KeyTypeDic.ContainsKey(control.ContentTypeName.ToUpper())) return; var type = KeyTypeDic[control.ContentTypeName.ToUpper()]; if (type == null) return; var contentKey = Activator.CreateInstance(type) as IContentType; if (contentKey != null) { contentKey.SetValue(control); } } catch (Exception ex) { LibraryAssistant.UILogService.WriteLog(ex); } }
public void SetContent(IContentControl control) { if (control.ContentTypeParameter == null || String.IsNullOrEmpty(control.ContentTypeParameter.ToString())) { return; } if (LocalCache.DtDict == null) { LocalCache.Update(CacheList.Dict); } if (LocalCache.DtDict == null) { return; } var dt = LocalCache.DtDict.Clone(); if (LocalCache.DtDict != null && LocalCache.DtDict.Rows.Count > 0) { var drs = LocalCache.DtDict.Select("dic_code = '" + control.ContentTypeParameter + "'"); if (drs.Length > 0) { drs = LocalCache.DtDict.Select("parent_id = '" + drs[0]["dic_id"] + "'"); foreach (var dr in drs) { dt.ImportRow(dr); } } } else { dt = LocalCache.DtDict; } var list = (from DataRow dr in dt.Rows select new ListItem(dr["dic_id"], dr["dic_name"].ToString())).ToList(); list.Insert(0, new ListItem("", "")); control.Content = list; }
public void SetContent(IContentControl control) { if (control.ContentTypeParameter == null || String.IsNullOrEmpty(control.ContentTypeParameter.ToString())) return; if (LocalCache.DtDict == null) { LocalCache.Update(CacheList.Dict); } if (LocalCache.DtDict == null) { return; } var dt = LocalCache.DtDict.Clone(); if (LocalCache.DtDict != null && LocalCache.DtDict.Rows.Count > 0) { var drs = LocalCache.DtDict.Select("dic_code = '" + control.ContentTypeParameter + "'"); if (drs.Length > 0) { drs = LocalCache.DtDict.Select("parent_id = '" + drs[0]["dic_id"] + "'"); foreach (var dr in drs) { dt.ImportRow(dr); } } } else { dt = LocalCache.DtDict; } var list = (from DataRow dr in dt.Rows select new ListItem(dr["dic_id"], dr["dic_name"].ToString())).ToList(); list.Insert(0,new ListItem("","")); control.Content = list; }
public FindLocation(string keyTerm, IContentControl location) { _keyTerm = keyTerm; _location = location; }
public TestHierarchyFindLocation(TreeNode node, IContentControl owner) : base(node.Text, owner) { _node = node; }
public StatisticsFindLocation(ListViewItem lvi, IContentControl ctrl) : base(CreateKeyTermFormListViewItem(lvi), ctrl) { _listViewItem = lvi; }
public CategoryFindLocation(ListViewItem lvi, IContentControl ctrl) : base(lvi.Text, ctrl) { _listViewItem = lvi; }
public void SetValue(IContentControl control) { return; }
public NavigationEventArgs(IContentControl target) { Target = target; }
private TabPage FindTabPageWith(IContentControl contentControl) { foreach(TabPage page in _tabControl.TabPages) { var ctrl = page.Controls[0]; if( ctrl.Equals(contentControl) ) { return page; } } return null; }
public bool Verify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"^[0-9]+([.]{1}[0-9]+){0,1}$"); return reg.IsMatch(control.Value.ToString()); }
public bool InputtingVerify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"^(?=[0-9a-zA-Z@_.]+$)"); return reg.IsMatch(control.Value.ToString()); }
public bool InputtingVerify(IContentControl control) { return true; if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"^\d+(\.\d+)?$"); return reg.IsMatch(control.Value.ToString()); }
public ConsoleOutputFindLocation(int index, string keyTerm, string searchTerm, IContentControl ctrl) : base(keyTerm, ctrl) { _index = index; _searchTerm = searchTerm; }
public bool Verify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"\d{3}-\d{8}|\d{4}-\d{7}"); return reg.IsMatch(control.Value.ToString()); }
public bool Verify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"[a-zA-z]+:\\[^\s]*"); return reg.IsMatch(control.Value.ToString()); }
public StatisticsFindLocation(ListViewItem lvi, IContentControl ctrl) : base(CreateKeyTermFormListViewItem(lvi), ctrl) { _listViewItem = lvi; }
public ConsoleOutputFindLocation(int index, string keyTerm, string searchTerm, IContentControl ctrl) : base(keyTerm, ctrl) { _index = index; _searchTerm = searchTerm; }
/// <summary> /// Takes a user control and embeds it in a tab page. /// </summary> /// <param name="contentControl">A single control that represents the content of a the tab page.</param> /// <returns>A tab page with the content control embedded.</returns> private TabPage CreateTabPageFor(IContentControl contentControl) { var tabPage = new TabPage(contentControl.Name) { ToolTipText = contentControl.ToolTipText }; contentControl.FillContextMenu += OnFillContextMenu; contentControl.AfterSelect += OnAfterSelect; contentControl.ItemCheckedStateChanged += OnItemCheckedStateChanged; var control = contentControl as Control; if(control != null) { tabPage.Controls.Add(control); control.Dock = DockStyle.Fill; } else { var label = new Label { Top = 10, Left = 10, Text = ("Couldn't load content control '" + contentControl.Name + "'. It's not derived from class Control.") }; tabPage.Controls.Add(label); } return tabPage; }
public bool InputtingVerify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(control.InputtingVerifyCondition); return reg.IsMatch(control.Value.ToString()); }
public CategoryFindLocation(ListViewItem lvi, IContentControl ctrl) : base(lvi.Text, ctrl) { _listViewItem = lvi; }
/// <summary> /// 设置扩展控件ExtContent属性值 /// </summary> /// <param name="control">扩展控件</param> public static Boolean InputtingVerify(IContentControl control) { if (control == null || (String.IsNullOrEmpty(control.VerifyTypeName) && control.VerifyType == null)) return true; var type = control.VerifyType ?? KeyTypeDic[control.VerifyTypeName.ToUpper()]; if (type == null) { return false; } var valueValidation = Activator.CreateInstance(type) as IValueVerifyType; return valueValidation != null && valueValidation.InputtingVerify(control); }
public bool InputtingVerify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"^((^\d{1,3}\.?$)|(^\d{1,3}\.\d{1,3}\.?$)|(^\d{1,3}\.\d{1,3}\.\d{1,3}\.?$)|(^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$))$"); return reg.IsMatch(control.Value.ToString()); }
public bool Verify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"^(^\d{15}$|^\d{18}$|^\d{17}(\d|X|x))$"); return reg.IsMatch(control.Value.ToString()); }
public static global::Newtonsoft.Json.Linq.JToken GetMainContent(IContentControl that) => that.Value <global::Newtonsoft.Json.Linq.JToken>("mainContent");
public bool Verify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"^((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?$"); return reg.IsMatch(control.Value.ToString()); }
public FindLocation(string keyTerm, IContentControl location) { _keyTerm = keyTerm; _location = location; }
public bool Verify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"); return reg.IsMatch(control.Value.ToString()); }
public void SetContent(IContentControl control) { if (control.ContentTypeParameter == null) return; //var type = Type.GetType(control.ContentTypeParameter,true,true); //if (type == null) return; control.Content = GetEnumList(control.ContentTypeParameter as Type); }
public bool Verify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"^-?[1-9]\d{0,32}$"); return reg.IsMatch(control.Value.ToString()); }
public void SetValue(IContentControl control) { return; }
public bool InputtingVerify(IContentControl control) { if (control.Value == null || String.IsNullOrEmpty(control.Value.ToString())) return true; var reg = new Regex(@"^[0-9]{0}([0-9]|[.])+$"); return reg.IsMatch(control.Value.ToString()); }
private void OnItemCheckedStateChanged(IContentControl sender, ContentControlEventArgs args) { if (args.UiElementInfo != null) { if(args.Checked) { _checkedItems.Add(args.UiElementInfo); } else { _checkedItems.Remove(args.UiElementInfo); } } }