private void SetPos() { if (Count == 1) { pnlSelect.Visible = false; } else { pnlSelect.Visible = true; } DoResize(); lblIndex.Text = SelectedIndex.ToString() + " of " + Count.ToString(); if (ParentControl != null) { ParentControl.Focus(); } }
void ItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { switch (e.Action) { case NotifyCollectionChangedAction.Add: AddItems(e); break; case NotifyCollectionChangedAction.Remove: RemoveItems(e); break; default: // Move, replace, reset ResetItems(); break; } SelectedIndex = SelectedIndex.Clamp(-1, Items.Count - 1); UpdateSelectedItem(); }
public string GetString() { switch (ComboType) { case GotoComboType.ExData: if (exItems.Count == 0 || SelectedIndex >= exItems.Count || SelectedIndex < 0) { return(""); } return(exItems[SelectedIndex]); case GotoComboType.ToCharData: return(Goto724Lib.ToChar(Text, GotoChar)); case GotoComboType.index: return(SelectedIndex.ToString()); } return(""); }
private void CancelAppointment() { if (SelectedIndex == null) //shouldnt be able to happen but to prevent crash --> return. { return; } int index = int.Parse(SelectedIndex.ToString(), System.Globalization.CultureInfo.InvariantCulture); int appointmentID = int.Parse(FilteredAppointments.Rows[index][0].ToString(), System.Globalization.CultureInfo.InvariantCulture); string reason = CancellationReason("Reason For Appointment Cancellation?"); if (reason == "") // If user closes dialog box, operation is cancelled and appointment remains active { return; } PatientDBConverter.DeleteAppointment(appointmentID, reason); // Appointment Moved To Cancelled Schema Success("Success!", "Patient appointment has been cancelled."); InitialiseDataTable(); // To refresh table after adjustments --> triggering onpropertychange }
protected void RenderTabPages(HtmlTextWriter writer, int index) { writer.AddAttribute(HtmlTextWriterAttribute.Id, this.ClientID + "_TabPage" + index.ToString()); Page.Trace.Warn(SelectedIndex.ToString()); if (!TabPages[index].Selected && !(SelectedIndex == -1 && index == 0)) { writer.AddStyleAttribute("visibility", "hidden"); writer.AddStyleAttribute("display", "none"); } else { writer.AddStyleAttribute("z-index", "1"); } writer.AddStyleAttribute("position", "absolute"); writer.AddStyleAttribute("width", "100%"); writer.AddStyleAttribute("height", "100%"); writer.RenderBeginTag(HtmlTextWriterTag.Div); writer.Write(TabPages[index].Value); writer.RenderEndTag(); }
public string GetString() { switch (ComboType) { case EnmComboType.ExItem: if (exItems.Count == 0 || SelectedIndex >= exItems.Count || SelectedIndex < 0) { return(""); } return(exItems[SelectedIndex]); case EnmComboType.ToChar: return(ArsLibrary.ToChar(Text, ArsChar)); case EnmComboType.All: return(Text); case EnmComboType.Index: return(SelectedIndex.ToString()); } return(""); }
/// <summary> /// コンストラクタ /// </summary> public NetworkSettingViewModel() { collectNetworkInformation(); // DataGrid の行が選択された時の動作 SelectedIndex.Subscribe(idx => { this.NetworkInfoList.ForEach(info => info.Selected.Value = string.Empty); if (idx != -1) { this.NetworkInfoList[idx].Selected.Value = "*"; this.InterfaceName.Value = this.NetworkInfoList[idx].InterfaceName.Value; this.IPAddress.Value = this.NetworkInfoList[idx].IPAddress.Value; if (_notification != null) { var notification = _notification as NetworkSettingNotification; notification.LocalHostIP = this.IPAddress.Value; } } }); OkCommand = new DelegateCommand(OKInteraction); CancelCommand = new DelegateCommand(CancelInteraction); }
/// <summary> /// Overridden. Updates the hidden input's data. /// </summary> /// <param name="e">An EventArgs object that contains the event data.</param> protected override void OnPreRender(EventArgs e) { HelperData = SelectedIndex.ToString(); base.OnPreRender(e); }
public string Get(string propertyName) { switch (propertyName) { //ELEMENT case nameof(ClassId): return(ClassId.ToString()); case nameof(AutomationId): return(AutomationId.ToString()); case nameof(Id): return(Id.ToString()); case nameof(StyleId): return(StyleId.ToString()); //VISUAL ELEMENT case nameof(AnchorX): return(AnchorX.ToString()); case nameof(AnchorY): return(AnchorY.ToString()); case nameof(BackgroundColor): return(BackgroundColor.ToHex()); case nameof(Width): return(this.Width.ToString()); case nameof(Height): return(this.Height.ToString()); case nameof(IsEnabled): return(IsEnabled.ToString()); case nameof(WidthRequest): return(this.WidthRequest.ToString()); case nameof(HeightRequest): return(this.HeightRequest.ToString()); case nameof(IsFocused): return(IsFocused.ToString()); case nameof(IsVisible): return(IsVisible.ToString()); case nameof(InputTransparent): return(InputTransparent.ToString()); case nameof(X): return(this.X.ToString()); case nameof(Y): return(this.Y.ToString()); case nameof(Opacity): return(this.Opacity.ToString()); case nameof(TranslationX): return(this.TranslationX.ToString()); case nameof(TranslationY): return(this.TranslationY.ToString()); case nameof(Rotation): return(this.Rotation.ToString()); case nameof(RotationX): return(this.RotationX.ToString()); case nameof(RotationY): return(this.RotationY.ToString()); case nameof(Scale): return(this.Scale.ToString()); //VIEW case nameof(Margin): return(this.Margin.ToString()); case nameof(VerticalOptions): return(this.VerticalOptions.ToString()); case nameof(HorizontalOptions): return(this.HorizontalOptions.ToString()); //PICKER case nameof(ItemsSource): return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y)); case nameof(SelectedItem): return(SelectedItem.ToString()); case nameof(SelectedIndex): return(SelectedIndex.ToString()); case nameof(Items): return(Items.Aggregate((x, y) => x + "," + y)); case nameof(Title): return(Title); default: return(string.Empty); } }
void OnItemsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { SelectedIndex = SelectedIndex.Clamp(-1, Items.Count - 1); }
public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath) { var cell = tableView.DequeueReusableCell(CellIdentifier) as VoteNowCellView; // Data var item = Items [indexPath.Row]; cell.Tag = item.Id; cell.UpdateUIWith(item); if (SingleSelection && 0 == indexPath.Row) { cell.IsChecked = true; cell.btnCheck.SetImage(CheckedImage, UIControlState.Normal); SelectedIndex.Add(item.Id, true); } else { cell.IsChecked = false; cell.btnCheck.SetImage(UnCheckedImage, UIControlState.Normal); } cell.btnCheck.TouchUpInside += (sender, e) => { var index = (int)cell.Tag; if (cell.IsChecked) { if (SingleSelection) { } else { if (SelectedIndex.Keys.Contains(index)) { SelectedIndex.Remove(index); } cell.IsChecked = false; cell.btnCheck.SetImage(UnCheckedImage, UIControlState.Normal); } } else { for (int lt = 0; lt < Items.Count; lt++) { var p = NSIndexPath.FromRowSection(lt, 0); var tempcell = tableView.CellAt(p) as VoteNowCellView; tempcell.IsChecked = false; tempcell.btnCheck.SetImage(UnCheckedImage, UIControlState.Normal); } cell.IsChecked = true; cell.btnCheck.SetImage(CheckedImage, UIControlState.Normal); if (SingleSelection) { SelectedIndex.Clear(); SelectedIndex.Add(index, true); } else { if (!SelectedIndex.Keys.Contains(index)) { SelectedIndex.Add(index, true); } } } var args = new AnswerSelectedEventArgs { SelectedAnswer = item }; OnAnswerSelected(args); }; return(cell); }
protected override void Render(HtmlTextWriter writer) { //if (!this.DesignMode) //{ // scriptManager.RegisterScriptDescriptors(this); //} var itemCssClass = false; var itemAltCssClass = false; if (!string.IsNullOrEmpty(ItemCssClass)) { itemCssClass = true; } if (!string.IsNullOrEmpty(ItemAltCssClass)) { itemAltCssClass = true; } writer.WriteBeginTag("ul"); if (!string.IsNullOrEmpty(CssClass)) { writer.WriteAttribute("class", CssClass); } if (!string.IsNullOrEmpty(AccessKey)) { writer.WriteAttribute("AccessKey", AccessKey); } if (Style != null && !string.IsNullOrEmpty(Style.Value)) { writer.WriteAttribute("style", Style.Value); } writer.WriteAttribute("value", string.IsNullOrEmpty(SelectedValue) ? Items[0].Value : SelectedValue); writer.WriteAttribute("index", SelectedIndex.ToString()); writer.WriteAttribute("id", this.ClientID); writer.Write(HtmlTextWriter.TagRightChar); var itemClass = string.Empty; var prefix = string.Concat(ClientID, "_Item"); UnorderedItem item; for (var i = 0; i < Items.Count; i++) { itemClass = string.Empty; item = Items[i]; writer.WriteBeginTag("li"); writer.WriteAttribute("index", i.ToString()); writer.WriteAttribute("value", item.Value); writer.WriteAttribute("onclick", String.Format("{0}{1}{2}{3}{4}{5}{6}{7}{8}", "SetSelectedValue(this, '", item.Text, "','", item.Value, "',", i, ");", OnClientItemClick ?? string.Empty, Page.ClientScript.GetPostBackEventReference(this, i.ToString()))); if (i % 2 == 0) { if (itemCssClass) { itemClass = ItemCssClass; } } else { if (itemAltCssClass) { itemClass = ItemAltCssClass; } } if (SelectedIndex == i) { itemClass = String.Format("{0}{1}{2}", itemClass, " ", SelectedItemCssClass).Trim(); } if (itemClass != string.Empty) { writer.WriteAttribute("class", ItemCssClass); } writer.Write(HtmlTextWriter.TagRightChar); writer.Write(item.Text); writer.WriteEndTag("li"); } writer.WriteEndTag("ul"); //base.Render(writer); }
public override string ToString() { return(SelectedIndex.ToString()); }
/// <summary> /// The rendering path for uplevel browsers. /// </summary> /// <param name="writer">The output stream that renders HTML content to the client.</param> protected override void RenderUpLevelPath(HtmlTextWriter writer) { writer.Write("<?XML:NAMESPACE PREFIX=\"" + TagNamespace + "\" /><?IMPORT NAMESPACE=\"" + TagNamespace + "\" IMPLEMENTATION=\"" + AddPathToFilename("tabstrip.htc") + "\" />"); writer.WriteLine(); AddAttributesToRender(writer); writer.AddAttribute("selectedIndex", SelectedIndex.ToString()); if (Orientation == Orientation.Vertical) { writer.AddAttribute("orientation", "vertical"); } if (TargetID != String.Empty) { writer.AddAttribute("targetID", Target.ClientID); } if (SepDefaultImageUrl != String.Empty) { writer.AddAttribute("sepDefaultImageUrl", SepDefaultImageUrl); } if (SepHoverImageUrl != String.Empty) { writer.AddAttribute("sepHoverImageUrl", SepHoverImageUrl); } if (SepSelectedImageUrl != String.Empty) { writer.AddAttribute("sepSelectedImageUrl", SepSelectedImageUrl); } string style = TabDefaultStyle.CssText; if (style != String.Empty) { writer.AddAttribute("tabDefaultStyle", style); } style = TabHoverStyle.CssText; if (style != String.Empty) { writer.AddAttribute("tabHoverStyle", style); } style = TabSelectedStyle.CssText; if (style != String.Empty) { writer.AddAttribute("tabSelectedStyle", style); } style = SepDefaultStyle.CssText; if (style != String.Empty) { writer.AddAttribute("sepDefaultStyle", style); } style = SepHoverStyle.CssText; if (style != String.Empty) { writer.AddAttribute("sepHoverStyle", style); } style = SepSelectedStyle.CssText; if (style != String.Empty) { writer.AddAttribute("sepSelectedStyle", style); } if (Page != null) { string script = ClientHelperID + ".value" + "=event.index"; if (AutoPostBack) { script += ";if (getAttribute('_submitting') != 'true'){setAttribute('_submitting','true');try{" + Page.GetPostBackEventReference(this, String.Empty) + ";}catch(e){setAttribute('_submitting','false');}}"; } writer.AddAttribute("onSelectedIndexChange", "JScript:" + script); writer.AddAttribute("onwcready", "JScript:try{" + ClientHelperID + ".value=selectedIndex}catch(e){}"); } writer.RenderBeginTag(TagNamespace + ":" + TabStripTagName); writer.WriteLine(); base.RenderUpLevelPath(writer); writer.RenderEndTag(); }
// Token: 0x06000340 RID: 832 RVA: 0x00024E08 File Offset: 0x00023008 private void \u0003(object \u0002, EventArgs \u0003) { if (Operators.CompareString(this .8j3b35wggv7myhr7y5hvz6qsd7mlp7vg \u200A\u2009\u2000\u2005\u0002().Text, \u0006\u2001.\u0002(-1829138894), false) == 0) { this .8j3b35wggv7myhr7y5hvz6qsd7mlp7vg \u200A\u2009\u2000\u2005\u0002().Text = \u0006\u2001.\u0002(-1829138787); this .8j3b35wggv7myhr7y5hvz6qsd7mlp7vg \u200A\u2009\u2000\u2005\u0002().Image = \u0002\u2001.\u0005(); this .8j3b35wggv7myhr7y5hvz6qsd7mlp7vg \u200A\u2009\u2000\u2005\u0002().Enabled = false; this .8j3b35wggv7myhr7y5hvz6qsd7mlp7vg \u200A\u2009\u2000\u2005\u0003().Enabled = false; int value = 0; if (this .8j3b35wggv7myhr7y5hvz6qsd7mlp7vg \u200A\u2009\u2000\u2005\u0003().Text.Contains(\u0006\u2001.\u0002(-1829124959))) { value = 1; } this.sk.Send(string.Concat(new string[] { \u0006\u2001.\u0002(-1829139089), \u000E\u2000.\u000E, this .8j3b35wggv7myhr7y5hvz6qsd7mlp7vg \u200A\u2009\u2000\u2005\u0002().SelectedIndex.ToString(), \u000E\u2000.\u000E, Conversions.ToString(checked ((int)Math.Round(unchecked (Conversions.ToDouble(this .8j3b35wggv7myhr7y5hvz6qsd7mlp7vg \u200A\u2009\u2000\u2005\u0003().Text.Split(new char[] { ' ' })[0]) * 1024.0)))), \u000E\u2000.\u000E, Conversions.ToString(value) }));
/// <summary> /// The rendering path for downlevel browsers. /// </summary> /// <param name="writer">The output stream that renders HTML content to the client.</param> protected override void RenderDownLevelPath(HtmlTextWriter writer) { writer.WriteLine("<script language=\"javascript\">" + ClientHelperID + ".value=" + SelectedIndex.ToString() + ";</script>"); writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0"); writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "0"); writer.AddAttribute(HtmlTextWriterAttribute.Border, "0"); AddAttributesToRender(writer); writer.RenderBeginTag(HtmlTextWriterTag.Table); if (Orientation == Orientation.Horizontal) { writer.RenderBeginTag(HtmlTextWriterTag.Tr); } base.RenderDownLevelPath(writer); if (Orientation == Orientation.Horizontal) { writer.RenderEndTag(); // TR } writer.RenderEndTag(); // TABLE }
/// <summary> /// Open the form and get a return value. /// </summary> /// <param name="context"></param> protected override void DoWork(CodeActivityContext context) { MultiOptionMessageBoxStyleEnum style = (Style.Expression != null) ? Style.Get(context) : MultiOptionMessageBoxStyleEnum.DropDown; bool showCancelButton = (ShowCancelButton.Expression != null) ? ShowCancelButton.Get(context) : true; string windowTitle = String.IsNullOrEmpty(Caption.Get(context)) ? " " : Caption.Get(context); List <string> items = Items.Get(context); string message = Message.Get(context); string values = String.Empty; foreach (string str in items) { if (items.IndexOf(str) != 0) { values += ", "; } values += str; } Track("Items", values); DialogResult result; if (style == MultiOptionMessageBoxStyleEnum.DropDown) { var form = new MultiOptionDropDownForm { Choices = items, Text = windowTitle, Message = message, ShowCancelButton = showCancelButton }; result = form.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { SelectedIndex.Set(context, form.SelectedIndex); SelectedText.Set(context, form.SelectedText); } DialogResult.Set(context, result); } else { var form = new MultiOptionButtonForm { Choices = items, Text = windowTitle, Message = message, ShowCancelButton = showCancelButton }; result = form.ShowDialog(); if (result == System.Windows.Forms.DialogResult.OK) { SelectedIndex.Set(context, form.SelectedIndex); SelectedText.Set(context, form.SelectedText); } DialogResult.Set(context, result); } }