public IEnumerator SelectOnly(IEnumerable <VisualPayload> payloads) { IEnumerator iterator; UnSelectedList.AddRange(SelectedList); SelectedList.Clear(); foreach (var payload in payloads) { UnSelectedList.Remove(payload); SelectedList.Add(payload); payload.VisualData.Bound.ClearBounds(); iterator = SelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } iterator = SendUnselected(); while (iterator.MoveNext()) { yield return(null); } iterator = TransmitMultiStates(); while (iterator.MoveNext()) { yield return(null); } }
private List <ExchangeAccount> GetGridViewAccounts(GridView gv, SelectedState state) { List <ExchangeAccount> accounts = new List <ExchangeAccount>(); for (int i = 0; i < gv.Rows.Count; i++) { GridViewRow row = gv.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) { continue; } ExchangeAccount account = new ExchangeAccount(); account.AccountType = (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), ((Literal)row.FindControl("litAccountType")).Text); account.AccountName = (string)gv.DataKeys[i][0]; account.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) { accounts.Add(account); } } return(accounts); }
protected List <ESPermission> GetGridViewPermissions(SelectedState state) { List <ESPermission> permissions = new List <ESPermission>(); for (int i = 0; i < gvPermissions.Rows.Count; i++) { GridViewRow row = gvPermissions.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) { continue; } ESPermission permission = new ESPermission(); permission.Account = (string)gvPermissions.DataKeys[i][0]; permission.Access = ((Literal)row.FindControl("litAccess")).Text; permission.DisplayName = ((Literal)row.FindControl("litAccount")).Text; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) { permissions.Add(permission); } } return(permissions); }
protected List <OrganizationUser> GetGridViewUsers(SelectedState state) { List <OrganizationUser> users = new List <OrganizationUser>(); for (int i = 0; i < gvUsers.Rows.Count; i++) { GridViewRow row = gvUsers.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) { continue; } OrganizationUser user = new OrganizationUser(); user.AccountName = (string)gvUsers.DataKeys[i][0]; user.DisplayName = ((Literal)row.FindControl("litAccount")).Text; user.SamAccountName = ((HiddenField)row.FindControl("hdnSamAccountName")).Value; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) { users.Add(user); } } return(users); }
protected List <RdsServer> GetGridViewServers(SelectedState state) { List <RdsServer> servers = new List <RdsServer>(); for (int i = 0; i < gvServers.Rows.Count; i++) { GridViewRow row = gvServers.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) { continue; } RdsServer server = new RdsServer(); server.Id = (int)gvServers.DataKeys[i][0]; server.FqdName = ((Literal)row.FindControl("litFqdName")).Text; server.Status = ((Literal)row.FindControl("litStatus")).Text; var rdsCollectionId = ((HiddenField)row.FindControl("hdnRdsCollectionId")).Value; if (!string.IsNullOrEmpty(rdsCollectionId)) { server.RdsCollectionId = Convert.ToInt32(rdsCollectionId); } if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) { servers.Add(server); } } return(servers); }
private List <ExchangeAccount> GetGridViewAccounts(GridView gv, SelectedState state) { List <ExchangeAccount> accounts = new List <ExchangeAccount>(); for (int i = 0; i < gv.Rows.Count; i++) { GridViewRow row = gv.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) { continue; } ExchangeAccount account = new ExchangeAccount(); account.AccountType = (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), ((Literal)row.FindControl("litAccountType")).Text); account.AccountName = (string)gv.DataKeys[i][0]; account.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; account.PrimaryEmailAddress = ((Literal)row.FindControl("litPrimaryEmailAddress")).Text; if (gv != gvPopupAccounts) { DropDownList ddlPermissions = (DropDownList)row.FindControl("ddlPermissions"); //HiddenField PermissionLabel = (HiddenField)row.FindControl("PermissionLabel"); //account.PublicFolderPermission = PermissionLabel.Value; account.PublicFolderPermission = ddlPermissions.SelectedValue; } if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) { accounts.Add(account); } } return(accounts); }
protected List <ResourceGroupInfo> GetGridViewResourceGroups(SelectedState state) { List <ResourceGroupInfo> groups = new List <ResourceGroupInfo>(); for (int i = 0; i < gvResourceGroups.Rows.Count; i++) { GridViewRow row = gvResourceGroups.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) { continue; } ResourceGroupInfo user = new ResourceGroupInfo(); user.GroupName = ((Literal)row.FindControl("litGroupName")).Text; user.GroupId = Convert.ToInt32(((HiddenField)row.FindControl("hdnGroupId")).Value); if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) { groups.Add(user); } } return(groups); }
public IEnumerator Select(VisualPayload payload) { bool sendNormal = !SelectedList.Any(); UnSelectedList.Remove(payload); SelectedList.Add(payload); payload.VisualData.Bound.ClearBounds(); var iterator = SelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } if (sendNormal) { iterator = SendUnselected(); while (iterator.MoveNext()) { yield return(null); } } iterator = TransmitMultiStates(); while (iterator.MoveNext()) { yield return(null); } }
public async override void OnNavigatedTo(object navigationParameter, Windows.UI.Xaml.Navigation.NavigationMode navigationMode, Dictionary <string, object> viewModelState) { base.OnNavigatedTo(navigationParameter, navigationMode, viewModelState); if (viewModelState != null) { if (navigationMode == NavigationMode.Refresh) { var stateErrorsCollection = RetrieveEntityStateValue <IDictionary <string, ReadOnlyCollection <string> > >("stateErrorsCollection", viewModelState); if (stateErrorsCollection != null) { SelectedState.SetAllErrors(stateErrorsCollection); } } } // Note: Each time app selects from main page (StateListPage) detail page (StateDetailPage) is recreated. // Meaning that constructor is run and SelectedState is null. // If SuspendAndTerminate (e.g. debug mode) SelectedState is saved to SessionState (because of [RestorableState] attribute). // Therefore, if SelectedState has been saved, use it instead of doing GetStateAsync. if (SelectedState == null) { string errorMessage = string.Empty; int stateId = (int)navigationParameter; if (stateId == 0) { SelectedState = new State(); SelectedState.ValidateProperties(); RunAllCanExecute(); } else { try { LoadingData = true; CrudResult = await _stateRepository.GetStateAsync(stateId); SelectedState = JsonConvert.DeserializeObject <List <State> >(CrudResult.Content.ToString()).FirstOrDefault <State>(); } catch (HttpRequestException ex) { ErrorMessageTitle = ErrorMessagesHelper.HttpRequestExceptionError; //TODO: Log stack trace to database here ErrorMessage = string.Format("{0}", ex.Message); } finally { LoadingData = false; } if (ErrorMessage != null && ErrorMessage != string.Empty) { MessageDialog messageDialog = new MessageDialog(ErrorMessage, ErrorMessageTitle); await messageDialog.ShowAsync(); _navService.GoBack(); } } } RunAllCanExecute(); }
public void ThenEveryInputIsSetToItsDefaultValues() { _actor.AsksFor(Text.Of(SubmissionPage.UrlInputField)).Should().BeEmpty(); _actor.AsksFor(SelectedOptionText.Of(SubmissionPage.TypeSelect)).Should().Be("Blog Posts"); _actor.AsksFor(Text.Of(SubmissionPage.EmailInputField)).Should().BeEmpty(); _actor.AsksFor(Text.Of(SubmissionPage.DescriptionInputField)).Should().BeEmpty(); _actor.AsksFor(SelectedState.Of(SubmissionPage.PrivacyPolicy)).Should().BeFalse(); }
// ** overrides public override void Apply(Border bdr, SelectedState selState) { base.Apply(bdr, selState); ApplyBorder(bdr, _bdrLeft, new Thickness(_bdrThickness.Left, 0, 0, 0)); ApplyBorder(bdr, _bdrTop, new Thickness(0, _bdrThickness.Top, 0, 0)); ApplyBorder(bdr, _bdrRight, new Thickness(0, 0, _bdrThickness.Right, 0)); ApplyBorder(bdr, _bdrBottom, new Thickness(0, 0, 0, _bdrThickness.Bottom)); }
public override void OnNavigatedFrom(Dictionary <string, object> viewModelState, bool suspending) { base.OnNavigatedFrom(viewModelState, suspending); if (viewModelState != null) { AddEntityStateValue("stateErrorsCollection", SelectedState.GetAllErrors(), viewModelState); } }
public void GivenThePrivacyPolicyIsNotAccepted() { var privacyPolicyIsChecked = _actor.AskingFor(SelectedState.Of(SubmissionPage.PrivacyPolicy)); if (privacyPolicyIsChecked) { _actor.AttemptsTo(Click.On(SubmissionPage.PrivacyPolicy)); } }
public void OnButtonClick() { if (_selectedState != SelectedState.Selected) { _selectedState = SelectedState.Selected; } else { _selectedState = SelectedState.Deselected; } UpdateState(); }
// When Update button is pressed private async void OnUpdateState() { string errorMessage = string.Empty; bool isCreating = false; SelectedState.ValidateProperties(); var updateErrors = SelectedState.GetAllErrors().Values.SelectMany(pc => pc).ToList(); if (updateErrors.Count == 0) { try { LoadingData = true; if (SelectedState.Id == 0) { isCreating = true; CrudResult = await _stateRepository.CreateStateAsync(SelectedState); SelectedState = JsonConvert.DeserializeObject <List <State> >(CrudResult.Content.ToString()).FirstOrDefault <State>(); } else { CrudResult = await _stateRepository.UpdateStateAsync(SelectedState); } } catch (ModelValidationException mvex) { // there were server-side validation errors DisplayStateErrorMessages(mvex.ValidationResult); } catch (HttpRequestException ex) { ErrorMessageTitle = isCreating ? ErrorMessagesHelper.CreateAsyncFailedError : ErrorMessagesHelper.UpdateAsyncFailedError; ErrorMessage = ex.Message; } finally { LoadingData = false; RunAllCanExecute(); } if (ErrorMessage != null && ErrorMessage != string.Empty) { MessageDialog messageDialog = new MessageDialog(ErrorMessage, ErrorMessageTitle); await messageDialog.ShowAsync(); _navService.GoBack(); } } else { RunAllCanExecute(); } }
public override void InitializeStateMachine() { LerpCartridge cart_lerp = new LerpCartridge(); SelectedState s_selected = new SelectedState(ref ItemData, ref c_itemActiveData); PostselectedState s_postSelected = new PostselectedState(ref ItemData, ref c_itemActiveData, ref cart_lerp); UnselectedState s_unselected = new UnselectedState(ref ItemData, ref c_itemActiveData); PreselectedState s_preselected = new PreselectedState(ref ItemData, ref c_itemActiveData, ref cart_lerp); sm_menuItem = new StateMachine(s_unselected, StateRef.ITEM_UNSELECTED); sm_menuItem.AddState(s_postSelected, StateRef.ITEM_POSTSELECTED); sm_menuItem.AddState(s_selected, StateRef.ITEM_SELECTED); sm_menuItem.AddState(s_preselected, StateRef.ITEM_PRESELECTED); }
/// <summary> /// Toggle profile option menu /// </summary> public void ChooseProfile() { audioSrc.Play(); if (selectedState == SelectedState.NONE) { profileOptions.SetActive(true); selectedState = SelectedState.PROFILE; } else if (selectedState == SelectedState.PROFILE) { profileOptions.SetActive(false); selectedState = SelectedState.NONE; } }
public IEnumerator TransmitAll() { IEnumerator iterator; if (SelectedList.Count > 0) { foreach (var payload in UnSelectedList) { payload.VisualData.Bound.ClearBounds(); iterator = NormalState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } } else { foreach (var payload in UnSelectedList) { payload.VisualData.Bound.ClearBounds(); iterator = NoneSelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } } foreach (var payload in SelectedList) { payload.VisualData.Bound.ClearBounds(); iterator = SelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } iterator = TransmitMultiStates(); while (iterator.MoveNext()) { yield return(null); } }
public async void sendState() { // time = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds(); var robot = new SelectedState(); robot.name = name; robot.isSelected = isSelected; string json = JsonUtility.ToJson(robot); // var response = await client.PostAsync("http://74.207.254.19:7000/state/save", new StringContent(json, Encoding.UTF8, "application/json")); var response = await client.PostAsync("http://localhost:7000/selectedstate/save", new StringContent(json, Encoding.UTF8, "application/json")); var responseString = await response.Content.ReadAsStringAsync(); }
public IEnumerator Select(IEnumerable <VisualPayload> payloads) { if (!payloads.Any()) { yield return(null); yield break; } bool sendNormal = !SelectedList.Any(); IEnumerator iterator; foreach (var payload in payloads) { if (SelectedList.Contains(payload)) { continue; } UnSelectedList.Remove(payload); SelectedList.Add(payload); payload.VisualData.Bound.ClearBounds(); iterator = SelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } if (sendNormal) { iterator = SendUnselected(); while (iterator.MoveNext()) { yield return(null); } } iterator = TransmitMultiStates(); while (iterator.MoveNext()) { yield return(null); } }
public Selector(SpriteBatch spriteBatch, Card card) { // Make card selector outline line = new Texture2D(spriteBatch.GraphicsDevice, 1, 1); line.SetData <Color>(new Color[] { Color.White }); lineWidth = 4; // Other selector variables color = Color.Black; selected = card; attacking = null; //idk summoning = null; //idk settingMagic = null; //idk settingTrap = null; //idk state = SelectedState.P1_HAND; action = SelectedAction.NONE; index = 0; }
protected override void OnProcessOutputSchema(MutableObject newSchema) { var elementList = EntryField.GetLastKeyValue(newSchema) as IEnumerable <MutableObject>; if (elementList == null) { Debug.LogError("This isn't a valid schema! The entries field is empty!"); } var singleSchema = elementList.First(); var multiSchema = new MutableObject(); multiSchema.Add("Entries", elementList); NormalState.TransmitSchema(singleSchema); SelectedState.TransmitSchema(singleSchema); NormalStateMulti.TransmitSchema(multiSchema); SelectedStateMulti.TransmitSchema(multiSchema); }
/// <summary> /// Toggle category options /// </summary> public void ChooseCategory() { audioSrc.Play(); if (selectedState == SelectedState.NONE) { categoryWheel.SetActive(true); categoryWheel.GetComponent <SelectionWheel> ().SetSelected(GameManager.instance.client.pb.GetRoomCategory()); selectedState = SelectedState.CATEGORY; } else if (selectedState == SelectedState.CATEGORY) { if (!categoryWheel.GetComponent <SelectionWheel> ().GetSelected().Equals(GameManager.instance.client.pb.GetRoomCategory())) { GameManager.instance.client.pb.SetCategory(categoryWheel.GetComponent <SelectionWheel>().GetSelected()); } categoryWheel.SetActive(false); selectedState = SelectedState.NONE; } }
/// <summary> /// Toggle difficulty options /// </summary> public void ChooseDifficulty() { audioSrc.Play(); if (selectedState == SelectedState.NONE) { difficultyWheel.SetActive(true); difficultyWheel.GetComponent <SelectionWheel> ().SetSelected(GameManager.instance.client.pb.GetDifficulty()); selectedState = SelectedState.DIFFICULTY; } else if (selectedState == SelectedState.DIFFICULTY) { if (!difficultyWheel.GetComponent <SelectionWheel> ().GetSelected().Equals(GameManager.instance.client.pb.GetDifficulty())) { GameManager.instance.client.pb.SetDifficulty(difficultyWheel.GetComponent <SelectionWheel>().GetSelected()); } difficultyWheel.SetActive(false); selectedState = SelectedState.NONE; } }
private void OnItemSelected(SelectedState selected, InventoryItemInstance item, Button button) { if (SelectedButton != null) { SelectedButton.image.color = Color.white; } SelectedButton = button; SelectedItem = item; Selected = selected; if (SelectedItem.ItemModel.Stackable) { QuantityPicker.gameObject.SetActive(true); QuantityInputField.text = "1"; } //highlight button button.image.color = Color.blue; //dumb but will work for now PaintSelectedItem(); }
public IEnumerator SelectAll() { IEnumerator iterator; foreach (var payload in UnSelectedList) { payload.VisualData.Bound.ClearBounds(); iterator = SelectedState.Transmit(payload); while (iterator.MoveNext()) { yield return(null); } } SelectedList.AddRange(UnSelectedList); UnSelectedList.Clear(); iterator = TransmitMultiStates(); while (iterator.MoveNext()) { yield return(null); } }
protected override void OnProcessOutputSchema(MutableObject newSchema) { var entry = EntryField.GetEntries(newSchema); var foundEntries = entry.ToList(); if (!foundEntries.Any()) { Debug.Log("No valid entries in " + EntryField.AbsoluteKey); Router.TransmitAllSchema(new MutableObject()); return; } MutableObject outMutable = null; foreach (var foundEntry in EntryField.GetEntries(newSchema)) { outMutable = foundEntry.Last(); break; } NormalState.TransmitSchema(outMutable); SelectedState.TransmitSchema(outMutable); NoneSelectedState.TransmitSchema(outMutable); var multiSchema = new MutableObject() { { "Entries", new List <MutableObject> { outMutable } } }; NormalStateMulti.TransmitSchema(multiSchema); SelectedStateMulti.TransmitSchema(multiSchema); NoneSelectedStateMulti.TransmitSchema(multiSchema); }
protected List <RemoteApplication> GetGridViewApps(SelectedState state) { List <RemoteApplication> apps = new List <RemoteApplication>(); for (int i = 0; i < gvApps.Rows.Count; i++) { GridViewRow row = gvApps.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) { continue; } RemoteApplication app = new RemoteApplication(); app.Alias = (string)gvApps.DataKeys[i][0]; app.DisplayName = ((LinkButton)row.FindControl("lnkDisplayName")).Text; app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value; app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value; var users = ((HiddenField)row.FindControl("hfUsers")).Value; if (!string.IsNullOrEmpty(users)) { app.Users = new string[] { "New" }; } if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) { apps.Add(app); } } return(apps); }
private void ClearState() { SelectedButton = null; Selected = SelectedState.None; SelectedItem = null; }
public static void SetElementSelectedState(RectLayer layer, SelectedState state) { for (int i = 0; i < layer.ElementCollection.Count; i++) { if (layer.ElementCollection[i] is RectElement) { layer.ElementCollection[i].ElementSelectedState = state; } else if (layer.ElementCollection[i] is RectLayer) { SetElementSelectedState((RectLayer)layer.ElementCollection[i], state); } } }
public ScriptStateBackup(SelectedState selected, Dictionary <string, List <UIControl> > ifaceSectionDict) { Selected = selected; IfaceSectionDict = ifaceSectionDict ?? new Dictionary <string, List <UIControl> >(StringComparer.OrdinalIgnoreCase); }
public virtual void Apply(Border bdr, SelectedState selState) { Apply(bdr); }
protected override void OnMouseEnter(EventArgs e) { base.OnMouseEnter(e); if (selec != SelectedState.Selected) { selec = SelectedState.Over; Refresh(); } }
protected override void OnMouseLeave(EventArgs e) { base.OnMouseLeave(e); if (selec != SelectedState.Selected) { selec = SelectedState.None; Refresh(); } }
protected List<RdsServer> GetGridViewServers(SelectedState state) { List<RdsServer> servers = new List<RdsServer>(); for (int i = 0; i < gvServers.Rows.Count; i++) { GridViewRow row = gvServers.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) continue; RdsServer server = new RdsServer(); server.Id = (int)gvServers.DataKeys[i][0]; server.FqdName = ((Literal)row.FindControl("litFqdName")).Text; server.Status = ((Literal)row.FindControl("litStatus")).Text; var rdsCollectionId = ((HiddenField)row.FindControl("hdnRdsCollectionId")).Value; if (!string.IsNullOrEmpty(rdsCollectionId)) { server.RdsCollectionId = Convert.ToInt32(rdsCollectionId); } if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) servers.Add(server); } return servers; }
protected List<ESPermission> GetGridViewPermissions(SelectedState state) { List<ESPermission> permissions = new List<ESPermission>(); for (int i = 0; i < gvPermissions.Rows.Count; i++) { GridViewRow row = gvPermissions.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) continue; ESPermission permission = new ESPermission(); permission.Account = (string)gvPermissions.DataKeys[i][0]; permission.Access = ((Literal)row.FindControl("litAccess")).Text; permission.DisplayName = ((Literal)row.FindControl("litAccount")).Text; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) permissions.Add(permission); } return permissions; }
private void pictureBox1_MouseLeave(object sender, EventArgs e) { if (selec != SelectedState.Selected) { selec = SelectedState.None; Refresh(); } }
public static void SetElementCollectionState(ObservableCollection<IElement> collection, SelectedState value) { if (collection == null || collection.Count == 0) { return; } for (int i = 0; i < collection.Count; i++) { if (collection[i].ElementSelectedState != value) { collection[i].ElementSelectedState = value; } } }
private List<ExchangeAccount> GetGridViewAccounts(GridView gv, SelectedState state) { List<ExchangeAccount> accounts = new List<ExchangeAccount>(); for (int i = 0; i < gv.Rows.Count; i++) { GridViewRow row = gv.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) continue; ExchangeAccount account = new ExchangeAccount(); account.AccountType = (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), ((Literal)row.FindControl("litAccountType")).Text); account.AccountName = (string)gv.DataKeys[i][0]; account.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; account.PrimaryEmailAddress = ((Literal)row.FindControl("litPrimaryEmailAddress")).Text; if(state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) accounts.Add(account); } return accounts; }
private List<ExchangeAccount> GetGridViewAccounts(GridView gv, SelectedState state) { List<ExchangeAccount> accounts = new List<ExchangeAccount>(); for (int i = 0; i < gv.Rows.Count; i++) { GridViewRow row = gv.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) continue; ExchangeAccount account = new ExchangeAccount(); account.AccountType = (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), ((Literal)row.FindControl("litAccountType")).Text); account.AccountName = (string)gv.DataKeys[i][0]; account.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; account.PrimaryEmailAddress = ((Literal)row.FindControl("litPrimaryEmailAddress")).Text; if (gv != gvPopupAccounts) { DropDownList ddlPermissions = (DropDownList)row.FindControl("ddlPermissions"); //HiddenField PermissionLabel = (HiddenField)row.FindControl("PermissionLabel"); //account.PublicFolderPermission = PermissionLabel.Value; account.PublicFolderPermission = ddlPermissions.SelectedValue; } if(state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) accounts.Add(account); } return accounts; }
protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (selec != SelectedState.Selected) { selec = SelectedState.Selected; Refresh(); } }
private void pictureBox1_MouseEnter(object sender, EventArgs e) { if (selec != SelectedState.Selected) { selec = SelectedState.Over; Refresh(); } }
private void pictureBox1_Click(object sender, EventArgs e) { if (selec != SelectedState.Selected) { selec = SelectedState.Selected; if (Selected != null) Selected(this, new EventArgs()); Refresh(); } }
protected List<RemoteApplication> GetGridViewApps(SelectedState state) { List<RemoteApplication> apps = new List<RemoteApplication>(); for (int i = 0; i < gvApps.Rows.Count; i++) { GridViewRow row = gvApps.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) continue; RemoteApplication app = new RemoteApplication(); app.Alias = (string)gvApps.DataKeys[i][0]; app.DisplayName = ((LinkButton)row.FindControl("lnkDisplayName")).Text; app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value; app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value; var users = ((HiddenField)row.FindControl("hfUsers")).Value; if (!string.IsNullOrEmpty(users)) { app.Users = new string[]{"New"}; } if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) apps.Add(app); } return apps; }
protected List<OrganizationUser> GetGridViewUsers(SelectedState state) { List<OrganizationUser> users = new List<OrganizationUser>(); for (int i = 0; i < gvUsers.Rows.Count; i++) { GridViewRow row = gvUsers.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) continue; OrganizationUser user = new OrganizationUser(); user.AccountName = (string)gvUsers.DataKeys[i][0]; user.DisplayName = ((Literal)row.FindControl("litAccount")).Text; user.SamAccountName = ((HiddenField)row.FindControl("hdnSamAccountName")).Value; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) users.Add(user); } return users; }
protected List<ResourceGroupInfo> GetGridViewResourceGroups(SelectedState state) { List<ResourceGroupInfo> groups = new List<ResourceGroupInfo>(); for (int i = 0; i < gvResourceGroups.Rows.Count; i++) { GridViewRow row = gvResourceGroups.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect == null) continue; ResourceGroupInfo user = new ResourceGroupInfo(); user.GroupName = ((Literal)row.FindControl("litGroupName")).Text; user.GroupId = Convert.ToInt32(((HiddenField)row.FindControl("hdnGroupId")).Value); if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || (state == SelectedState.Unselected && !chkSelect.Checked)) groups.Add(user); } return groups; }