예제 #1
0
 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);
 }
예제 #2
0
        } // 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()
예제 #3
0
        } // 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()
예제 #4
0
        } // 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()
예제 #5
0
 /// <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);
 }
예제 #6
0
        } // 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()
예제 #7
0
        private void UpdateSelectedContent(IContentControl item)
        {
            if (SelectedContentTemplate != item.ContentTemplate)
            {
                SelectedContentTemplate = item.ContentTemplate;
            }

            if (SelectedContent != item.Content)
            {
                SelectedContent = item.Content;
            }
        }
예제 #8
0
        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()));
        }
예제 #9
0
 private TabPage FindTabPageWith(IContentControl contentControl)
 {
     foreach (TabPage page in _tabControl.TabPages)
     {
         var ctrl = page.Controls[0];
         if (ctrl.Equals(contentControl))
         {
             return(page);
         }
     }
     return(null);
 }
예제 #10
0
        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);
        }
예제 #11
0
 private void OnItemCheckedStateChanged(IContentControl sender, ContentControlEventArgs args)
 {
     if (args.UiElementInfo != null)
     {
         if (args.Checked)
         {
             _checkedItems.Add(args.UiElementInfo);
         }
         else
         {
             _checkedItems.Remove(args.UiElementInfo);
         }
     }
 }
예제 #12
0
        /// <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));
        }
예제 #13
0
        /// <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));
        }
예제 #14
0
 /// <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);
     }
 }
예제 #15
0
        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;
        }
예제 #17
0
 public FindLocation(string keyTerm, IContentControl location)
 {
     _keyTerm  = keyTerm;
     _location = location;
 }
예제 #18
0
 public TestHierarchyFindLocation(TreeNode node, IContentControl owner)
     : base(node.Text, owner)
 {
     _node = node;
 }
예제 #19
0
 public StatisticsFindLocation(ListViewItem lvi, IContentControl ctrl) 
    : base(CreateKeyTermFormListViewItem(lvi), ctrl) {
    _listViewItem = lvi;
 }
예제 #20
0
 public CategoryFindLocation(ListViewItem lvi, IContentControl ctrl)
    : base(lvi.Text, ctrl) {
    _listViewItem = lvi;
 }
예제 #21
0
 public void SetValue(IContentControl control)
 {
     return;
 }
예제 #22
0
 public NavigationEventArgs(IContentControl target)
 {
     Target = target;
 }
예제 #23
0
 private TabPage FindTabPageWith(IContentControl contentControl) {
    foreach(TabPage page in _tabControl.TabPages) {
       var ctrl = page.Controls[0];
       if( ctrl.Equals(contentControl) ) {
          return page;
       }
    }
    return null;
 }
예제 #24
0
 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());
 }
예제 #25
0
 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());
 }
예제 #26
0
 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());
 }
예제 #27
0
 public ConsoleOutputFindLocation(int index, string keyTerm, string searchTerm, IContentControl ctrl)
    : base(keyTerm, ctrl) {
    _index = index;
    _searchTerm = searchTerm;
 }
예제 #28
0
 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());
 }
예제 #29
0
 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());
 }
예제 #30
0
 public StatisticsFindLocation(ListViewItem lvi, IContentControl ctrl)
     : base(CreateKeyTermFormListViewItem(lvi), ctrl)
 {
     _listViewItem = lvi;
 }
예제 #31
0
 public ConsoleOutputFindLocation(int index, string keyTerm, string searchTerm, IContentControl ctrl)
     : base(keyTerm, ctrl)
 {
     _index      = index;
     _searchTerm = searchTerm;
 }
예제 #32
0
 /// <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;
 }
예제 #33
0
 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());
 }
예제 #34
0
 public CategoryFindLocation(ListViewItem lvi, IContentControl ctrl)
     : base(lvi.Text, ctrl)
 {
     _listViewItem = lvi;
 }
예제 #35
0
 /// <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);
 }
예제 #36
0
 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());
 }
예제 #37
0
 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());
 }
예제 #38
0
 public static global::Newtonsoft.Json.Linq.JToken GetMainContent(IContentControl that) => that.Value <global::Newtonsoft.Json.Linq.JToken>("mainContent");
예제 #39
0
 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());
 }
예제 #40
0
 public FindLocation(string keyTerm, IContentControl location) {
    _keyTerm = keyTerm;
    _location = location;
 }
예제 #41
0
 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());
 }
예제 #42
0
 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);
 }
예제 #43
0
 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());
 }
예제 #44
0
 public void SetValue(IContentControl control)
 {
     return;
 }
예제 #45
0
 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());
 }
예제 #46
0
 private void OnItemCheckedStateChanged(IContentControl sender, ContentControlEventArgs args) {
    if (args.UiElementInfo != null) {
       if(args.Checked) {
          _checkedItems.Add(args.UiElementInfo);
       }
       else {
          _checkedItems.Remove(args.UiElementInfo);
       }
    }
 }