Пример #1
0
 protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     try
     {
         _data = StockWidgetData.LoadFromSettings(WidgetHost.GetHost(this).WidgetInfo.Settings);
         _data.Symbols.RemoveAt(e.Item.ItemIndex);
         WidgetHost.GetHost(this).Save(_data.ToXml());
         Repeater1.DataSource = _data.Symbols;
         Repeater1.DataBind();
     }
     catch
     {
         lbData.Text = "Error deleting widget";
         ViewSet.SetActiveView(View);
     }
 }
Пример #2
0
 protected void AddStockButton_Click(object sender, EventArgs e)
 {
     try
     {
         if (newSymbol.Text != String.Empty)
         {
             _data = StockWidgetData.LoadFromSettings(WidgetHost.GetHost(this).WidgetInfo.Settings);
             _data.Symbols.Add(newSymbol.Text.ToUpper());
             newSymbol.Text = "";
             Repeater1.DataSource = _data.Symbols;
             Repeater1.DataBind();
             WidgetHost.GetHost(this).Save(_data.ToXml());
         }
     }
     catch
     {
         lbData.Text = "Error adding stock";
         ViewSet.SetActiveView(View);
     }
 }