public LimnorWebApp() { GlobalVariableTimeout = 20; AjaxTimeout = 0; SessionDataStorage = EnumSessionDataStorage.Cookies; _sessonVariables = new SessionVariableCollection(this); }
public PropertyDescriptorNewSessionVariable(SessionVariableCollection owner) : base("New variable", new Attribute[] { new EditorAttribute(typeof(TypeEditorSessionVariable), typeof(UITypeEditor)) , new RefreshPropertiesAttribute(RefreshProperties.All) , new NotForProgrammingAttribute() , new ParenthesizePropertyNameAttribute(true) }) { _owner = owner; }
public void LoadData(SessionVariableCollection owner) { _owner = owner; for (int i = 0; i < _owner.Count; i++) { listBox1.Items.Add(_owner[i]); } }
public void LoadData(SessionVariableCollection owner, SessionVariable defValue) { _owner = owner; _defVal = defValue; if (_defVal != null) { textBox1.Text = _defVal.Name; } }
public PropertyDescriptorSessionVariable(SessionVariable s, SessionVariableCollection owner) : base(s.Name, new Attribute[] { new WebClientMemberAttribute() , new WebServerMemberAttribute() }) { _owner = owner; _variable = s; }
private void buttonAdd_Click(object sender, EventArgs e) { DlgSessionVariable dlg = new DlgSessionVariable(); SessionVariableCollection ow = new SessionVariableCollection(_owner.Owner); for (int i = 0; i < listBox1.Items.Count; i++) { ow.Add(listBox1.Items[i] as SessionVariable); } dlg.LoadData(ow, null); if (dlg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK) { listBox1.Items.Add(dlg.Return); } }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { if (context != null && context.Instance != null && provider != null) { IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService)); if (edSvc != null) { SessionVariable sv = context.Instance as SessionVariable; SessionVariableCollection svc = context.Instance as SessionVariableCollection; if (svc == null) { LimnorWebApp wa = context.Instance as LimnorWebApp; if (wa != null) { svc = wa.GlobalVariables; } else { SessionVariableCollection.PropertyDescriptorNewSessionVariable psdv = context.PropertyDescriptor as SessionVariableCollection.PropertyDescriptorNewSessionVariable; if (psdv != null) { svc = psdv.Owner; } else { SessionVariableCollection.PropertyDescriptorSessionVariable psdv0 = context.PropertyDescriptor as SessionVariableCollection.PropertyDescriptorSessionVariable; if (psdv0 != null) { svc = psdv0.Owner; } } } } if (svc != null) { DlgSessionVariable dlg = new DlgSessionVariable(); dlg.LoadData(svc, sv); if (edSvc.ShowDialog(dlg) == System.Windows.Forms.DialogResult.OK) { if (sv != null) { sv.Name = dlg.Return.Name; sv.Value = dlg.Return.Value; } else { svc.Add(dlg.Return); } value = dlg.Return; IDevClassReferencer dcr = svc.Owner as IDevClassReferencer; if (dcr != null) { IDevClass dc = dcr.GetDevClass(); if (dc != null) { dc.NotifyChange(dcr, context.PropertyDescriptor.Name); } } } } } } return(value); }