public XmlDocumentViewSchema(string name, Pair data, bool includeSpecialSchema) { this._includeSpecialSchema = includeSpecialSchema; this._children = (OrderedDictionary) data.First; this._attrs = (ArrayList) data.Second; this._name = name; }
private void PrintDictionary(OrderedDictionary dic) { foreach (DictionaryEntry entry in dic) { Output.WriteLine("{0}-{1}", entry.Key, entry.Value); } }
/// <summary> /// Parses the parameters passed to the constructor. /// </summary> /// <param name="fields">The object[] passed to the constructor.</param> /// <exception cref="ArgumentException">Either the length of the params argument is odd, each pair of objects within the params argument do not each comprise a valid <see cref="KeyValuePair{SortBy,SortOrder}"/>, or there is a duplicate <see cref="SortBy"/> key within the params argument.</exception> private void ParseParams(ref object[] fields) { var orderedDictionary = new OrderedDictionary(); // Must have an even number of items in the array. if (fields.Length % 2 != 0) { throw new ArgumentException("There must be an even number of items in the array."); } else { for (int i = 0; i < fields.Length/2; i++) { if (fields[i*2] is SortBy && fields[i*2 + 1] is SortOrder) { orderedDictionary.Add((SortBy)fields[i * 2], (SortOrder)fields[i * 2 + 1]); } else { throw new ArgumentException( "Each pair of items added to the object array must be a pairing of SortBy then SortOrder."); } } } OrderedDictionary = orderedDictionary; }
private static OrderedDictionary CreateFinders() { OrderedDictionary createFinders = new OrderedDictionary(); createFinders[typeof(MenuStrip)] = (Find<MenuStrip>)delegate(MenuStrip menu, string name) { foreach (ToolStripItem item in menu.Items) { if (item.Name == name) return item; object recursed = FindFirst(item, name); if (recursed != null) return recursed; } return null; }; createFinders[typeof(ToolStripItem)] = (Find<ToolStripMenuItem>)delegate(ToolStripMenuItem rootItem, string name) { foreach (ToolStripItem item in rootItem.DropDownItems) { if (item.Name == name) return item; object recursed = FindFirst(item, name); if (recursed != null) return recursed; } return null; }; return createFinders; }
public List<CartItem> UpdateCartItems() { using (ShoppingCartActions usersShoppingCart = new ShoppingCartActions()) { String cartId = usersShoppingCart.GetCartId(); ShoppingCartActions.ShoppingCartUpdates[] cartUpdates = new ShoppingCartActions.ShoppingCartUpdates[CartList.Rows.Count]; for (int i = 0; i < CartList.Rows.Count; i++) { IOrderedDictionary rowValues = new OrderedDictionary(); rowValues = GetValues(CartList.Rows[i]); cartUpdates[i].ProductId = Convert.ToInt32(rowValues["ProductID"]); CheckBox cbRemove = new CheckBox(); cbRemove = (CheckBox)CartList.Rows[i].FindControl("Remove"); cartUpdates[i].RemoveItem = cbRemove.Checked; TextBox quantityTextBox = new TextBox(); quantityTextBox = (TextBox)CartList.Rows[i].FindControl("PurchaseQuantity"); cartUpdates[i].PurchaseQuantity = Convert.ToInt16(quantityTextBox.Text.ToString()); if (!usersShoppingCart.CheckAvailability(cartUpdates[i].PurchaseQuantity, cartUpdates[i].ProductId, cartId)) { // Reload the page. string pageUrl = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.Count() - Request.Url.Query.Count()); Response.Redirect(pageUrl + "?Action=stock&id=" + cartUpdates[i].ProductId); } } usersShoppingCart.UpdateShoppingCartDatabase(cartId, cartUpdates); CartList.DataBind(); lblTotal.Text = String.Format("{0:c}", usersShoppingCart.GetTotal()); return usersShoppingCart.GetCartItems(); } }
public static OrderedDictionary GetEmoticonHashTable() { var emoticons = new OrderedDictionary { {":D", "big-smile-emoticon-for-facebook.png"}, {":O", "surprised-emoticon.png"}, {":/", "unsure-emoticon.png"}, {":P", "facebook-tongue-out-emoticon.png"}, {":)", "facebook-smiley-face-for-comments.png"}, {":(", "facebook-frown-emoticon.png"}, {":'(", "facebook-cry-emoticon-crying-symbol.png"}, {"O:)", "angel-emoticon.png"}, {"3:)", "devil-emoticon.png"}, {"-_-", "squinting-emoticon.png"}, {":*", "kiss-emoticon.png"}, {"^_^", "kiki-emoticon.png"}, {":v", "pacman-emoticon.png"}, {":3", "curly-lips-emoticon.png"}, {"o.O", "confused-emoticon-wtf-symbol-for-facebook.png"}, {";)", "wink-emoticon.png"}, {"8-)", "glasses-emoticon.png"}, {"8| B|", "sunglasses-emoticon.png"} //{">:O", "angry-emoticon.png"}, //{">:(", "grumpy-emoticon.png"} }; return emoticons; }
/// <summary> /// Load widgets from the assembly provided. /// </summary> /// <param name="filePath">File path containing the model definitions</param> /// <param name="assemblyNamesDelimited">Comma delimited list of assembly names to load modeldefs from.</param> /// <param name="author">Override author</param> /// <param name="email">Override email</param> /// <param name="version">Override version</param> /// <param name="url">Ovverride url</param> /// <returns></returns> public static IList<ModelSettings> LoadAll(string filePath, string assemblyNamesDelimited, string author = "kishore reddy", string email = "*****@*****.**", string version = "0.9.4.1", string url = "http://commonlibrarynetcms.codeplex.com") { bool fileProvided = !string.IsNullOrEmpty(filePath); bool hasAssemblys = !string.IsNullOrEmpty(assemblyNamesDelimited); if (!fileProvided && !hasAssemblys) throw new ArgumentException("File path for model defs or list of assembly names must be provided."); var models = new OrderedDictionary(); if (hasAssemblys) { // Any loaded from assembly? Load into dictionary. var modelDefsFromAssembly = LoadFromAssemblies(assemblyNamesDelimited); if (modelDefsFromAssembly != null && modelDefsFromAssembly.Count > 0) foreach (var modelDef in modelDefsFromAssembly) models[modelDef.Value.Name] = modelDef.Value; } // Model definition config file supplied? if (fileProvided) { // Override the model defs from assembly with ones supplied in configuration file. var modelDefsFromFile = LoadFromFile(filePath); if (modelDefsFromFile != null && modelDefsFromFile.Count > 0) foreach (var modelDef in modelDefsFromFile) models[modelDef.Name] = modelDef; } // Now get all models from map as a list. var all = new List<ModelSettings>(); foreach (DictionaryEntry pair in models) all.Add(pair.Value as ModelSettings); return all; }
private void CreateCategoryNamePropertyListMap() { this.evaluatedCategories = new List<Category>(); if (this.Categories != null) { this.evaluatedCategories.AddRange(this.Categories); } this.categoryNamePropertyListMap = new OrderedDictionary(); foreach (Category category in this.Categories) { this.categoryNamePropertyListMap.Add(category.Name, new List<BaseProperty>()); } foreach (BaseProperty property in this.Properties) { if (!this.categoryNamePropertyListMap.Contains(property.Category)) { Category item = new Category { Name = property.Category }; this.evaluatedCategories.Add(item); this.categoryNamePropertyListMap.Add(item.Name, new List<BaseProperty>()); } (this.categoryNamePropertyListMap[property.Category] as List<BaseProperty>).Add(property); } }
public IOrderedDictionary GetSelectedRowData() { IOrderedDictionary result; if (null == this.SelectedRow) { result = null; } else { OrderedDictionary fieldValues = new OrderedDictionary(); foreach (object field in this.CreateColumns(null, false)) { if (field is BoundField && !fieldValues.Contains(((BoundField)field).DataField)) { fieldValues.Add(((BoundField)field).DataField, null); } } string[] dataKeyNames = this.DataKeyNames; for (int i = 0; i < dataKeyNames.Length; i++) { string key = dataKeyNames[i]; if (!fieldValues.Contains(key)) { fieldValues.Add(key, null); } } this.ExtractRowValues(fieldValues, this.SelectedRow, true, true); result = fieldValues; } return result; }
public PollsMainForm(User _user) { InitializeComponent(); //_anketsUser=new User(); //_anketsUser.Login = "******"; //_anketsUser.CodMfo = 964; //_anketsUser.CodObl = 8; //_anketsUser.CodRKC = 0; //_anketsUser.PrivilegesCodMfo = 0; //_anketsUser.PrivilegesCodObl = 6; //_anketsUser.PrivilegesCodRKC = 0; //_anketsUser. _anketsUser = _user; _deposPollsTable = new DeposPollsTableForm(_anketsUser); splitContainer1.Panel2.Controls.Add(_deposPollsTable); _deposPollsTable.Dock = DockStyle.Fill; settings = global::Poll.Properties.Settings.Default; //Console.WriteLine(settings.Test); //settings.Test = "проверка"; //Console.WriteLine(settings.Test); //MessageBox.Show(settings.Test); OrderedDictionary ttt = new OrderedDictionary(); foreach (DataColumn t in _deposPollsTable.pollsDataSet.POLL_DEPOS.Columns) { ttt.Add(t.ColumnName, ""); //settings.DeposTableColumnsText.Add(t.ColumnName,""); } settings.DeposTableColumnsText = ttt; settings.Save(); //_deposPollsTable.buttonAddPoll. //Refresh(); Update(); }
public SwcHeaderStore() { tables = new OrderedDictionary(); tables["ORIGINAL_SOURCE"] = "SIGEN"; tables["CREATURE"] = ""; tables["REGION"] = ""; tables["FIELD/LAYER"] = ""; tables["TYPE"] = ""; tables["CONTRIBUTOR"] = ""; tables["REFERENCE"] = ""; tables["RAW"] = ""; tables["EXTRAS"] = ""; tables["SOMA_AREA"] = ""; tables["SHINKAGE_CORRECTION"] = ""; tables["VERSION_NUMBER"] = ""; tables["VERSION_DATE"] = ""; tables["SCALE"] = ""; tables["INTERPOLATION"] = ""; tables["DISTANCE_THRESHOLD"] = ""; tables["VOLUME_THRESHOLD"] = ""; tables["SMOOTHING"] = ""; tables["CLIPPING"] = ""; tables["ROOT_SETTING"] = "NO"; }
public virtual IEnumerable languageSearchSettings() { var cache = LanguageSearchSettings.Cache; var oldDirtyValue = cache.IsDirty; foreach (PXResult<SMLanguageSearchSettings, WikiPageLanguage> record in PXSelectJoinGroupBy<SMLanguageSearchSettings, RightJoin<WikiPageLanguage, On<WikiPageLanguage.language, Equal<SMLanguageSearchSettings.name>>>, Where<SMLanguageSearchSettings.userID, IsNull, Or<SMLanguageSearchSettings.userID, Equal<Current<AccessInfo.userID>>>>, Aggregate<GroupBy<WikiPageLanguage.language, GroupBy<SMLanguageSearchSettings.userID, GroupBy<SMLanguageSearchSettings.active>>>>>. Select(this)) { var langSettings = (SMLanguageSearchSettings)record; var pageLanguage = (WikiPageLanguage)record; if (langSettings.UserID == null) { var fieldValues = new OrderedDictionary { {cache.GetField(typeof(SMLanguageSearchSettings.name)), pageLanguage.Language}, {cache.GetField(typeof(SMLanguageSearchSettings.userID)), PXAccess.GetUserID()}, {cache.GetField(typeof(SMLanguageSearchSettings.active)), false} }; cache.Insert(fieldValues); langSettings = (SMLanguageSearchSettings)cache.Current; } yield return langSettings; } cache.IsDirty = oldDirtyValue; }
public ActionResult Index() { Member _member = new Member("users"); Hashtable user = _member.getBySession(); Permission _permission = new Permission(Convert.ToInt32(user["type_id"])); string[] permission = _permission.get(); OrderedDictionary application = new OrderedDictionary(); if(permission.Length > 0) { ArrayList apps = this.getApplication(); if(apps.Count > 0) { foreach (Hashtable item in apps) { if (permission.Contains(item["id"])) { application["app" + item["id"]] = new Hashtable() { {"name", item["title"]}, {"setting", "/desktop/application/" + item["id"]}, {"path", "/"}, {"showOnDesktop", true} }; } } } } ViewBag.application = application; return View(); }
public void CountTests() { var d = new OrderedDictionary(); Assert.Equal(0, d.Count); for (int i = 0; i < 1000; i++) { d.Add(i, i); Assert.Equal(i + 1, d.Count); } for (int i = 0; i < 1000; i++) { d.Remove(i); Assert.Equal(1000 - i - 1, d.Count); } for (int i = 0; i < 1000; i++) { d[(object)i] = i; Assert.Equal(i + 1, d.Count); } for (int i = 0; i < 1000; i++) { d.RemoveAt(0); Assert.Equal(1000 - i - 1, d.Count); } }
internal XmlDocumentSchema(XmlDocument xmlDocument, string xPath, bool includeSpecialSchema) { if (xmlDocument == null) { throw new ArgumentNullException("xmlDocument"); } this._includeSpecialSchema = includeSpecialSchema; this._rootSchema = new OrderedDictionary(); XPathNavigator rootNav = xmlDocument.CreateNavigator(); if (!string.IsNullOrEmpty(xPath)) { XPathNodeIterator iterator = rootNav.Select(xPath); while (iterator.MoveNext()) { XPathNodeIterator iterator2 = iterator.Current.SelectDescendants(XPathNodeType.Element, true); while (iterator2.MoveNext()) { this.AddSchemaElement(iterator2.Current, iterator.Current); } } } else { XPathNodeIterator iterator3 = rootNav.SelectDescendants(XPathNodeType.Element, true); while (iterator3.MoveNext()) { this.AddSchemaElement(iterator3.Current, rootNav); } } }
public string EmitCommand(object[] tupleValues, long? tupleId= null, long? taskId = null, string streamid = null) { var result = new OrderedDictionary { {WellKnownStrings.Command, WellKnownStrings.Emit}, }; if (tupleId.HasValue) { result.Add(WellKnownStrings.Id, tupleId.Value.ToString(CultureInfo.InvariantCulture)); } if (!string.IsNullOrEmpty(streamid)) { result.Add(WellKnownStrings.Stream, streamid); } if (taskId.HasValue) { result.Add(WellKnownStrings.Task, taskId.Value); } result.Add(WellKnownStrings.Tuple, tupleValues); return result.ToJson(); }
public OrderedDictionary GetEmoticonHashTable() { const string key = "GetEmoticonHashTable"; var emoticons = _cacheService.Get<OrderedDictionary>(key); if (emoticons == null) { emoticons = new OrderedDictionary(); var root = SiteConfig.Instance.GetSiteConfig(); var emoticonNodes = root?.SelectNodes("/forum/emoticons/emoticon"); if (emoticonNodes != null) { foreach (XmlNode emoticonNode in emoticonNodes) { //<emoticon symbol="O:)" image="angel-emoticon.png" /> if (emoticonNode.Attributes != null) { var emoticonSymbolAttr = emoticonNode.Attributes["symbol"]; var emoticonImageAttr = emoticonNode.Attributes["image"]; if (emoticonSymbolAttr != null && emoticonImageAttr != null) { emoticons.Add(emoticonSymbolAttr.InnerText, emoticonImageAttr.InnerText); } } } _cacheService.Set(key, emoticons, CacheTimes.OneDay); } } return emoticons; }
public static OrderedDictionary CustomTrim(this OrderedDictionary source) { if (source == null) return null; var result = new OrderedDictionary(); var keys = source.Keys; foreach (var key in keys) { var value = source[key]; var stringValue = value as string; if (stringValue != null) { value = stringValue.CustomTrim(); } result.Add(key, value); } return result; }
public List<CartItem> UpdateCartItems( ) { using (ShoppingCartActions usersShoppingCart = new ShoppingCartActions()) { String cartId = usersShoppingCart.GetCartId(); ShoppingCartActions.ShoppingCartUpdates[] cartUpdates = new ShoppingCartActions.ShoppingCartUpdates[CartList.Rows.Count]; for (int i =0; i < CartList.Rows.Count; i++) { IOrderedDictionary rowValues = new OrderedDictionary(); rowValues = GetValues(CartList.Rows[i] ); cartUpdates[i].ProductId = Convert.ToInt32(rowValues["ProductID"] ); CheckBox cbRemove = new CheckBox(); cbRemove = (CheckBox) CartList.Rows[i].FindControl( "Remove" ); cartUpdates[i].RemoveItem = cbRemove.Checked; TextBox quantityTextBox = new TextBox(); quantityTextBox =(TextBox) CartList.Rows[i].FindControl("PurchaseQuantity"); cartUpdates[i].PurchaseQuantity =Convert.ToInt16(quantityTextBox.Text.ToString()); } usersShoppingCart.UpdateShoppingCartDatabase(cartId, cartUpdates); CartList.DataBind(); lblTotal.Text =String.Format("{0:c}", usersShoppingCart.GetTotal()); return usersShoppingCart.GetCartItems(); } }
/// <summary> /// Remove the user being chosen /// by the user drop down list /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void RemoveDepartmentButton_Click(object sender, EventArgs e) { HalonModels.Department[] removeList = new HalonModels.Department[DeptList.Rows.Count]; for (int i = 0; i < DeptList.Rows.Count; i++) { IOrderedDictionary rowValues = new OrderedDictionary(); rowValues = GetValues(DeptList.Rows[i]); int tempID = Convert.ToInt32(rowValues["Dept_ID"]); CheckBox cbRemove = new CheckBox(); cbRemove = (CheckBox)DeptList.Rows[i].FindControl("RemoveDept"); if (cbRemove.Checked) { var myItem = (from c in db.Departments where c.Dept_ID == tempID select c).FirstOrDefault(); if (myItem != null) { //Remove all related items to this department first //then remove the department db.Departments.Remove(myItem); db.SaveChanges(); // Reload the page. string pageUrl = Request.Url.AbsoluteUri.Substring(0, Request.Url.AbsoluteUri.Count() - Request.Url.Query.Count()); Response.Redirect(pageUrl + "?DepartmentAction=remove"); } else { LabelRemoveStatus.Text = "Unable to locate Department."; } } } }
public void PassingEqualityComparers() { var eqComp = new CaseInsensitiveEqualityComparer(); var d1 = new OrderedDictionary(eqComp); d1.Add("foo", "bar"); Assert.Throws<ArgumentException>(() => d1.Add("FOO", "bar")); }
public void BuildInstanceThrowsIfPropertyIsReadOnly() { OrderedDictionary values = new OrderedDictionary(1); values.Add("Name", "name"); TypeDescriptionHelper.BuildInstance(values, new SimpleEntityWithReadOnlyProperty()); }
private void ExtractTemplateValuesRecursive(ArrayList subBuilders, OrderedDictionary table, Control container) { foreach (object obj2 in subBuilders) { ControlBuilder builder = obj2 as ControlBuilder; if (builder != null) { ICollection boundPropertyEntries; if (!builder.HasFilteredBoundEntries) { boundPropertyEntries = builder.BoundPropertyEntries; } else { ServiceContainer serviceProvider = new ServiceContainer(); serviceProvider.AddService(typeof(IFilterResolutionService), builder.TemplateControl); try { builder.SetServiceProvider(serviceProvider); boundPropertyEntries = builder.GetFilteredPropertyEntrySet(builder.BoundPropertyEntries); } finally { builder.SetServiceProvider(null); } } string strA = null; bool flag = true; Control o = null; foreach (BoundPropertyEntry entry in boundPropertyEntries) { if (entry.TwoWayBound) { string str2; if (string.Compare(strA, entry.ControlID, StringComparison.Ordinal) != 0) { flag = true; } else { flag = false; } strA = entry.ControlID; if (flag) { o = container.FindControl(entry.ControlID); if ((o == null) || !entry.ControlType.IsInstanceOfType(o)) { continue; } } object target = PropertyMapper.LocatePropertyObject(o, entry.Name, out str2, base.InDesigner); table[entry.FieldName] = FastPropertyAccessor.GetProperty(target, str2, base.InDesigner); } } this.ExtractTemplateValuesRecursive(builder.SubBuilders, table, container); } } }
public void AgregarLugar(string lugar) { MySqlDataAccess mysqlAccess = new MySqlDataAccess(); OrderedDictionary listParam = new OrderedDictionary(); listParam.Add("nombreLugar", lugar); var data = mysqlAccess.ExecuteProcedure("AgregarLugar", listParam); }
public bool UpdateRecord() { //keysParams is not used as we use the where clause OrderedDictionary keysParams = new OrderedDictionary(); OrderedDictionary OldValues = new OrderedDictionary(); Update(keysParams, this.Parameters, OldValues, new DataSourceViewOperationCallback(this.HandleUpdateCallback)); return lastUpdateResult; }
public Layer(OrderedDictionary<string, IGameObject> gameObjects, int zOrder) { _gameObjects = gameObjects; _layerType = LayerTypes.ObjectLayer; this.ZOrder = zOrder; }
public System.Collections.Specialized.IOrderedDictionary ExtractValues(Control container) { OrderedDictionary dictionary = new OrderedDictionary(); dictionary["SelectedOperator"] = aspListChoices.SelectedValue; return dictionary; }
public IOrderedDictionary ExtractValues(Control container) { if (null == this.innerControl) { throw new InvalidOperationException("InnerControl not set"); } if (null == this.fieldsSection) { throw new InvalidOperationException("FieldsSection not set"); } OrderedDictionary values = new OrderedDictionary(); Dictionary<string, Control> map = new Dictionary<string, Control>(); this.BuildControlsMap(map, this.innerControl); int rcount = 0; foreach (IConfigurationElement rowElement in this.fieldsSection.Elements.Values) { int ccount = 0; foreach (IConfigurationElement fieldElement in rowElement.Elements.Values) { string id = string.Concat(new object[] { "tr", rcount, "tc", ccount, fieldElement.ConfigKey }); if (map.ContainsKey(id)) { Control fieldControl = map[id]; foreach (IConfigurationElement propertyElement in fieldElement.Elements.Values) { if (propertyElement.Attributes.ContainsKey("pull") && propertyElement.Attributes.ContainsKey("member")) { string pull = propertyElement.GetAttributeReference("pull").Value.ToString(); string member = propertyElement.GetAttributeReference("member").Value.ToString(); if (!values.Contains(pull)) { values.Add(pull, ReflectionServices.ExtractValue(fieldControl, member)); } } if (propertyElement.Attributes.ContainsKey("push") && propertyElement.Attributes.ContainsKey("member")) { string push = propertyElement.GetAttributeReference("push").Value.ToString(); string member = propertyElement.GetAttributeReference("member").Value.ToString(); if (!values.Contains(push)) { values.Add(push, ReflectionServices.ExtractValue(fieldControl, member)); } } } } ccount++; } rcount++; } return values; }
public System.Collections.Specialized.IOrderedDictionary ExtractValues(Control container) { OrderedDictionary dictionary = new OrderedDictionary(); dictionary["Value"] = uxInputText.Text; dictionary["SelectedOperator"] = aspOperators.SelectedValue; return dictionary; }
public void AgregarColonia(string colonia, string municipio) { MySqlDataAccess mysqlAccess = new MySqlDataAccess(); OrderedDictionary listParam = new OrderedDictionary(); listParam.Add("nombreColonia", colonia); listParam.Add("nombreMunicipio", municipio); var data = mysqlAccess.ExecuteProcedure("AgregarColonia", listParam); }
public System.Collections.Specialized.IOrderedDictionary @__ExtractValues__control26(System.Web.UI.Control @__container) { System.Collections.Specialized.OrderedDictionary @__table; System.Web.UI.WebControls.Label Label1; Label1 = ((System.Web.UI.WebControls.Label)(@__container.FindControl("Label1"))); @__table = new System.Collections.Specialized.OrderedDictionary(); if ((Label1 != null)) { @__table["Status"] = Label1.Text; } return(@__table); }
/// <summary> /// Interprets the generic buttons. This are buttons that are not modeled as one of the standard buttons. /// This buttons have to be extracted from the raw data sent by the corresponding device and his /// interpreting adapter implementation /// </summary> /// <param name="sender">The sender.</param> /// <param name="orderedDictionary">The ordered dictionary.</param> private void interpretGenericButtons(object sender, System.Collections.Specialized.OrderedDictionary orderedDictionary) { List <String> pressedKeys = new List <String>(); List <String> releasedKeys = new List <String>(); // here you have to check for what kind of device which buttons are placed in the raw data sent by the device if (sender is BrailleIO.BrailleIOAdapter_ShowOff) { //interpret the raw data as data from as ShowOffAdapter pressedKeys = orderedDictionary["pressedKeys"] as List <String>; releasedKeys = orderedDictionary["releasedKeys"] as List <String>; } else if (sender is BrailleIOBrailleDisAdapter.BrailleIOAdapter_BrailleDisNet) { //interpret the raw data as data from as BrailleDis device pressedKeys = orderedDictionary["allPressedKeys"] as List <String>; releasedKeys = orderedDictionary["allReleasedKeys"] as List <String>; } else { // ... check for other device types } if (pressedKeys != null && pressedKeys.Count > 0) { if (pressedKeys.Contains("crc")) { zoomToRealSize(sender); } if (pressedKeys.Contains("rsru")) { updateContrast(BS_MAIN_NAME, "center", 10); } if (pressedKeys.Contains("rsrd")) { updateContrast(BS_MAIN_NAME, "center", -10); } } if (releasedKeys != null && releasedKeys.Count > 0) { if (releasedKeys.Contains("nsrr")) { moveHorizontal(BS_MAIN_NAME, "center", -25); } if (releasedKeys.Contains("nsr")) { moveHorizontal(BS_MAIN_NAME, "center", -5); } if (releasedKeys.Contains("nsll")) { moveHorizontal(BS_MAIN_NAME, "center", 25); } if (releasedKeys.Contains("nsl")) { moveHorizontal(BS_MAIN_NAME, "center", 5); } if (releasedKeys.Contains("nsuu")) { moveVertical(BS_MAIN_NAME, "center", 25); } if (releasedKeys.Contains("nsu")) { moveVertical(BS_MAIN_NAME, "center", 5); } if (releasedKeys.Contains("nsdd")) { moveVertical(BS_MAIN_NAME, "center", -25); } if (releasedKeys.Contains("nsd")) { moveVertical(BS_MAIN_NAME, "center", -5); } } }