コード例 #1
0
 public LimnorWebApp()
 {
     GlobalVariableTimeout = 20;
     AjaxTimeout           = 0;
     SessionDataStorage    = EnumSessionDataStorage.Cookies;
     _sessonVariables      = new SessionVariableCollection(this);
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 public void LoadData(SessionVariableCollection owner)
 {
     _owner = owner;
     for (int i = 0; i < _owner.Count; i++)
     {
         listBox1.Items.Add(_owner[i]);
     }
 }
コード例 #4
0
 public void LoadData(SessionVariableCollection owner, SessionVariable defValue)
 {
     _owner  = owner;
     _defVal = defValue;
     if (_defVal != null)
     {
         textBox1.Text = _defVal.Name;
     }
 }
コード例 #5
0
 public PropertyDescriptorSessionVariable(SessionVariable s, SessionVariableCollection owner)
     : base(s.Name, new Attribute[] {
     new WebClientMemberAttribute()
     , new WebServerMemberAttribute()
 })
 {
     _owner    = owner;
     _variable = s;
 }
コード例 #6
0
        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);
            }
        }
コード例 #7
0
 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);
 }