示例#1
0
        private static bool HandleCommandLinePatch(string[] args)
        {
            System.Collections.Generic.KeyValuePair <string, string> patchFilepaths = PatcherLib.Utilities.Utilities.GetPatchFilepaths(args, ".ffttext", new string[3] {
                ".bin", ".iso", ".img"
            });

            if ((string.IsNullOrEmpty(patchFilepaths.Key)) || (string.IsNullOrEmpty(patchFilepaths.Value)))
            {
                return(false);
            }
            else
            {
                System.IO.Directory.SetCurrentDirectory(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location));

                try
                {
                    FFTText fftText = FFTTextFactory.GetFilesXml(patchFilepaths.Key);
                    fftText.PatchISOSimple(patchFilepaths.Value);
                }
                catch (Exception ex)
                {
                    AttachConsole(ATTACH_PARENT_PROCESS);
                    Console.WriteLine("Error: " + ex.Message);
                }

                return(true);
            }
        }
        public static Dictionary <int, String> getBinary(Dictionary <int, int> color, PriorityQueue <int, Node> Huffman)
        {
            //insert the frequencies as nodes
            foreach (KeyValuePair <int, int> entry in color)
            {
                int  frequency = entry.Key;
                int  counter   = entry.Value;
                Node leaf      = new Node(frequency);
                Huffman.Enqueue(counter, leaf);
            }

            //construct the tree
            while (Huffman.Count != 1)
            {
                System.Collections.Generic.KeyValuePair <int, Node> rightLeaf = Huffman.Dequeue();
                System.Collections.Generic.KeyValuePair <int, Node> leftLeaf  = Huffman.Dequeue();

                int newKey = rightLeaf.Key + leftLeaf.Key;

                Node newValue = new Node(-1);
                newValue.Right = rightLeaf.Value;
                newValue.Left  = leftLeaf.Value;

                Huffman.Enqueue(newKey, newValue);
            }

            System.Collections.Generic.KeyValuePair <int, Node> rootNode = Huffman.Dequeue();
            Node root = rootNode.Value;
            Dictionary <int, String> res = new Dictionary <int, String>();

            getCode(root, "", ref res);

            return(res);
        }
示例#3
0
        private void processMessage(System.Collections.Generic.KeyValuePair <string, Rfc822Message> msg)
        {
            string token = UtilFunctions.findIssueTag(msg.Value);

            string[] parts = null;
            // issueId, accountId, tenantId
            UtilFunctions.parseMailToken(token, ref parts);

            if ((parts != null))
            {
                if (parts.Length > 2)
                {
                    // Verify issueId
                    int key = 0;
                    int.TryParse(parts[0], out key);
                    Issues issue = Issues.load((long)key);
                    if ((issue == null))
                    {
                        // Invalid issueId
                        GlobalShared.Log.Log((int)LogClass.logType.ErrorCondition, "PopListener: Invalid IssueId found <" + parts[0] + "> in message <" + msg.Key + "<", false);
                        return;
                    }
                    // Save the message
                    string   filename = UtilFunctions.saveEmail(msg.Value, Convert.ToInt64(parts[0]), issue.accountId, msg.Key);
                    Messages message  = new Messages(0, key, (int)issue.accountId, DateTime.Now, 1, DateTime.Now, false, false, GlobalShared.NULL_DATE, false, filename);
                    message.save();
                }
            }
        }
示例#4
0
 public void Call(System.Collections.Generic.KeyValuePair <int, float> param0)
 {
     func.BeginPCall();
     func.PushValue(param0);
     func.PCall();
     func.EndPCall();
 }
示例#5
0
        public void Chaining_Dictionary()
        {
            var dict = new System.Collections.Generic.Dictionary <int, int> {
                [1] = 2, [3] = 4
            };
            var sortedDict = new System.Collections.Generic.SortedDictionary <int, int> {
                [1] = 2, [3] = 4
            };

            System.Collections.Generic.KeyValuePair <int, int> dictKvp = default(System.Collections.Generic.KeyValuePair <int, int>);
            foreach (var kv in dict)
            {
                dictKvp = kv;
                break;
            }

            System.Collections.Generic.KeyValuePair <int, int> sortedDictKvp = default(System.Collections.Generic.KeyValuePair <int, int>);
            foreach (var kv in sortedDict)
            {
                sortedDictKvp = kv;
                break;
            }

            Assert.AreEqual(dictKvp, dict.First());
            Assert.AreEqual(dictKvp, dict.First(x => true));
            Assert.AreEqual(dictKvp, dict.FirstOrDefault());
            Assert.AreEqual(dictKvp, dict.FirstOrDefault(x => true));
            Assert.AreEqual(sortedDictKvp, sortedDict.First());
            Assert.AreEqual(sortedDictKvp, sortedDict.First(x => true));
            Assert.AreEqual(sortedDictKvp, sortedDict.FirstOrDefault());
            Assert.AreEqual(sortedDictKvp, sortedDict.FirstOrDefault(x => true));
        }
        public static Dictionary <string, object> DeserializeJsonToDictionary(Dictionary <string, object> values)
        {
            JavaScriptSerializer        javaScriptSerializer = new JavaScriptSerializer();
            Dictionary <string, object> dictionary           = new Dictionary <string, object>();

            try
            {
                Dictionary <string, object> .Enumerator enumerator = values.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    System.Collections.Generic.KeyValuePair <string, object> current = enumerator.Current;
                    if (current.Value.GetType() == values.GetType())
                    {
                        dictionary.Add(current.Key, DeserializeJsonToDictionary((Dictionary <string, object>)current.Value));
                    }
                    else
                    {
                        dictionary.Add(current.Key, System.Runtime.CompilerServices.RuntimeHelpers.GetObjectValue(current.Value));
                    }
                }
            }
            finally
            {
            }
            return(dictionary);
        }
示例#7
0
 /// <summary>
 /// Removes the given item.
 /// </summary>
 public bool Remove(System.Collections.Generic.KeyValuePair <TKey, TValue> item)
 {
     if (this.Contains(item))
     {
         return(this.Remove(item.Key));
     }
     return(false);
 }
 /// <summary>
 /// Adds an item to the queue
 /// </summary>
 /// <param name="item">Item to add</param>
 public override void Add(System.Collections.Generic.KeyValuePair <int, ICollection <T> > item)
 {
     if (item.Key > HighestKey)
     {
         HighestKey = item.Key;
     }
     base.Add(item);
 }
示例#9
0
        /// <summary>
        /// Update value in dictionary corresponding to key if found, else add new entry.
        /// More general than "this[key] = val;" by reporting if key was found and the old value if any.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        /// <param name="oldvalue"></param>
        /// <returns></returns>
        public virtual bool UpdateOrAdd(K key, V value, out V oldvalue)
        {
            System.Collections.Generic.KeyValuePair <K, V> p = new System.Collections.Generic.KeyValuePair <K, V>(key, value);
            bool retval = pairs.UpdateOrAdd(p, out p);

            oldvalue = p.Value;
            return(retval);
        }
示例#10
0
        public void Add(System.Collections.Generic.KeyValuePair <string, string> item)
        {
            var newitem = new DataItem()
            {
                Key = item.Key, Value = item.Value
            };

            _items.Add(newitem);
        }
示例#11
0
        /// <summary>
        /// Add a new (key, value) pair (a mapping) to the dictionary.
        /// </summary>
        /// <exception cref="DuplicateNotAllowedException"> if there already is an entry with the same key. </exception>
        /// <param name="key">Key to add</param>
        /// <param name="value">Value to add</param>
        public virtual void Add(K key, V value)
        {
            System.Collections.Generic.KeyValuePair <K, V> p = new System.Collections.Generic.KeyValuePair <K, V>(key, value);

            if (!pairs.Add(p))
            {
                throw new DuplicateNotAllowedException("Key being added: '" + key + "'");
            }
        }
示例#12
0
        public void vAddViewNode(string szNodeText, int iFormIDX, int iMDIChildIDX, tenWindowChildType enWindowChildType)
        {
            TreeNode viewNode = new TreeNode(szNodeText, (int)enWindowChildType + 9, (int)enWindowChildType + 9);

            navTreeViewGraphicalNodes.Nodes[0].Nodes[(int)enWindowChildType].Nodes.Add(viewNode);
            KeyValuePair <string, int> kvp = new System.Collections.Generic.KeyValuePair <string, int>(szNodeText, (iMDIChildIDX << 8) + iFormIDX);

            mlstKVP.Add(kvp);
        }
示例#13
0
        public bool Call(System.Collections.Generic.KeyValuePair <int, float> param0)
        {
            func.BeginPCall();
            func.PushValue(param0);
            func.PCall();
            bool ret = func.CheckBoolean();

            func.EndPCall();
            return(ret);
        }
示例#14
0
        /// <summary>
        /// Returns true if the given element exists.
        /// </summary>
        public bool Contains(System.Collections.Generic.KeyValuePair <TKey, TValue> item)
        {
            TValue value;

            if (!this.TryGetValue(item.Key, out value))
            {
                return(false);
            }
            return(value.Equals(item.Value));
        }
示例#15
0
            public void Find()
            {
                System.Collections.Generic.KeyValuePair <int, int> p = new System.Collections.Generic.KeyValuePair <int, int>(3, 78);

                Assert.IsTrue(lst.Find(ref p));
                Assert.AreEqual(3, p.Key);
                Assert.AreEqual(33, p.Value);
                p = new System.Collections.Generic.KeyValuePair <int, int>(13, 78);
                Assert.IsFalse(lst.Find(ref p));
            }
示例#16
0
 private void WattCheck(System.Collections.Generic.KeyValuePair <AlertType, AlertLimit> _storeItem)
 {
     try
     {
         if (_storeItem.Key == 25)
         {
             if (_storeItem.Value.IfPreviStatusInLimitArray == null)
             {
                 _storeItem.Value.IfPreviStatusInLimitArray = new bool[this._detector._aComputer.get_GridFanHub().Length];
                 this._notification.SetBoolArrayTrue(_storeItem.Value.IfPreviStatusInLimitArray);
             }
             int        num        = 0;
             GridPlus[] gridFanHub = this._detector._aComputer.get_GridFanHub();
             for (int i = 0; i < gridFanHub.Length; i++)
             {
                 GridPlus gridPlus = gridFanHub[i];
                 this._notification.UpdateAlertLimit(25, new AlertLimit
                 {
                     UpperAlertValue      = (double)gridPlus.get_WattNotifyUpperLimit(),
                     LowerAlertValue      = 0.0,
                     IfPreviStatusInLimit = true
                 });
                 string name = gridPlus.get_Name();
                 if (gridPlus.get_WattNotification() && name != null)
                 {
                     this._notification.Notifications(this, new AlertChangeArgs
                     {
                         Type  = 25,
                         Name  = name,
                         Value = gridPlus.get_Watt()[0],
                         Limit = new AlertLimit
                         {
                             UpperAlertValue      = _storeItem.Value.UpperAlertValue,
                             LowerAlertValue      = 0.0,
                             IfPreviStatusInLimit = _storeItem.Value.IfPreviStatusInLimitArray[num]
                         }
                     });
                 }
                 if (gridPlus.get_Watt()[0] < _storeItem.Value.UpperAlertValue)
                 {
                     _storeItem.Value.IfPreviStatusInLimitArray[num] = true;
                 }
                 else
                 {
                     _storeItem.Value.IfPreviStatusInLimitArray[num] = false;
                 }
                 num++;
             }
         }
     }
     catch
     {
     }
 }
示例#17
0
            public void RemoveWithReturn()
            {
                System.Collections.Generic.KeyValuePair <int, int> p = new System.Collections.Generic.KeyValuePair <int, int>(3, 78);
                //System.Collections.Generic.KeyValuePair<int,int> q = new System.Collections.Generic.KeyValuePair<int,int>();

                Assert.IsTrue(lst.Remove(p, out p));
                Assert.AreEqual(3, p.Key);
                Assert.AreEqual(33, p.Value);
                p = new System.Collections.Generic.KeyValuePair <int, int>(13, 78);
                Assert.IsFalse(lst.Remove(p, out _));
            }
示例#18
0
        /// <summary>
        /// Count the number of times an item is in this set.
        /// </summary>
        /// <param name="item">The item to look for.</param>
        /// <returns>The count</returns>
        public virtual int ContainsCount(T item)
        {
            System.Collections.Generic.KeyValuePair <T, int> p = new System.Collections.Generic.KeyValuePair <T, int>(item, 0);

            if (dict.Find(ref p))
            {
                return(p.Value);
            }

            return(0);
        }
示例#19
0
        public bool Contains(System.Collections.Generic.KeyValuePair <string, string> item)
        {
            var obj = Get(item.Key);

            if (obj != null && obj.Value.Equals(item.Value, StringComparison.OrdinalIgnoreCase))
            {
                return(true);
            }

            return(false);
        }
示例#20
0
        public int Call(System.Collections.Generic.KeyValuePair <int, float> param0, System.Collections.Generic.KeyValuePair <int, float> param1)
        {
            func.BeginPCall();
            func.PushValue(param0);
            func.PushValue(param1);
            func.PCall();
            int ret = (int)func.CheckNumber();

            func.EndPCall();
            return(ret);
        }
示例#21
0
        private bool ForceTimer(bool CurrentIsForm)
        {
            RegistryAccess registryAccess = new RegistryAccess();
            bool           flag1          = !CurrentIsForm;

            this.TL.LogMessage("ForceTimer", "Current IsForm: " + CurrentIsForm.ToString() + ", this makes the default ForceTimer value: " + Conversions.ToString(flag1));
            string upper = Process.GetCurrentProcess().MainModule.FileName.ToUpper();

            this.TL.LogMessage("ForceTimer", "Main process file name: " + upper);
            bool flag2 = false;
            SortedList <string, string> sortedList = registryAccess.EnumProfile("ForceSystemTimer");
            IEnumerator <System.Collections.Generic.KeyValuePair <string, string> > enumerator = null;

            try
            {
                enumerator = sortedList.GetEnumerator();
                while (enumerator.MoveNext())
                {
                    System.Collections.Generic.KeyValuePair <string, string> current = enumerator.Current;
                    if (upper.Contains(Strings.Trim(current.Key.ToUpper())))
                    {
                        this.TL.LogMessage("ForceTimer", "  Found: \"" + current.Key + "\" = \"" + current.Value + "\"");
                        flag2 = true;
                        bool result;
                        if (bool.TryParse(current.Value, out result))
                        {
                            flag1 = result;
                            this.TL.LogMessage("ForceTimer", "    Parsed OK: " + flag1.ToString() + ", ForceTimer set to: " + Conversions.ToString(flag1));
                        }
                        else
                        {
                            this.TL.LogMessage("ForceTimer", "    ***** Error - Value is not boolean!");
                        }
                    }
                    else
                    {
                        this.TL.LogMessage("ForceTimer", "  Tried: \"" + current.Key + "\" = \"" + current.Value + "\"");
                    }
                }
            }
            finally
            {
                if (enumerator != null)
                {
                    enumerator.Dispose();
                }
            }
            if (!flag2)
            {
                this.TL.LogMessage("ForceTimer", "  Didn't match any force timer application names");
            }
            this.TL.LogMessage("ForceTimer", "Returning: " + flag1.ToString());
            return(flag1);
        }
示例#22
0
        /// <summary>
        /// Check if an item (collection equal to a given one) is in the bag and
        /// if so report the actual item object found.
        /// </summary>
        /// <param name="item">On entry, the item to look for.
        /// On exit the item found, if any</param>
        /// <returns>True if bag contains item</returns>
        public virtual bool Find(ref T item)
        {
            System.Collections.Generic.KeyValuePair <T, int> p = new System.Collections.Generic.KeyValuePair <T, int>(item, 0);

            if (dict.Find(ref p))
            {
                item = p.Key;
                return(true);
            }

            return(false);
        }
示例#23
0
        public void CrashRd_CopyTo_ArgumentB()
        {
            Setup();
            for (int key = 1; key < 10; ++key)
            {
                dary1.Add(key, key + 1000);
            }

            var target = new System.Collections.Generic.KeyValuePair <int, int> [4];

            dary1.CopyTo(target, 2);
        }
示例#24
0
 public void Add(System.Collections.Generic.KeyValuePair <Key, Value> item)
 {
     try
     {
         this.lc.TryLock();
         this.dic.Add(item);
     }
     finally
     {
         this.lc.UnLock();
     }
 }
示例#25
0
        public int Update(object obj)
        {
            System.Type type = obj.GetType();
            System.Collections.Generic.KeyValuePair <string, string> key = DatabaseUtilities.GetKeyColumn(type);

            DbCommand command     = this.getCommand(type, new Func <System.Type, string>(DatabaseUtilities.GetUpdateStatement));
            string    whereClause = string.Format(" WHERE {0} = {1}", key.Key, (command is System.Data.SqlClient.SqlCommand) ? ("@" + key.Value) : (":" + key.Value));
            DbCommand expr_6B     = command;

            expr_6B.CommandText += whereClause;
            this.AddParametersFrom <object>(command, obj);
            return(this.ExecuteNonQueryCommand(command));
        }
示例#26
0
 /// <summary>
 /// Add the entries from a collection of <see cref="T:C5.KeyValuePair`2"/> pairs to this dictionary.
 /// <para><b>TODO: add restrictions L:K and W:V when the .Net SDK allows it </b></para>
 /// </summary>
 /// <exception cref="DuplicateNotAllowedException">
 /// If the input contains duplicate keys or a key already present in this dictionary.</exception>
 /// <param name="entries"></param>
 public virtual void AddAll <L, W>(System.Collections.Generic.IEnumerable <System.Collections.Generic.KeyValuePair <L, W> > entries)
     where L : K
     where W : V
 {
     foreach (System.Collections.Generic.KeyValuePair <L, W> pair in entries)
     {
         System.Collections.Generic.KeyValuePair <K, V> p = new System.Collections.Generic.KeyValuePair <K, V>(pair.Key, pair.Value);
         if (!pairs.Add(p))
         {
             throw new DuplicateNotAllowedException("Key being added: '" + pair.Key + "'");
         }
     }
 }
示例#27
0
        public int Delete <T>(int id)
        {
            System.Type type    = typeof(T);
            DbCommand   command = this.GetSqlStringCommand("DELETE FROM " + DatabaseUtilities.GetTableName(type));

            System.Collections.Generic.KeyValuePair <string, string> key = DatabaseUtilities.GetKeyColumn(type);
            string    prefix      = (command is System.Data.SqlClient.SqlCommand) ? "@" : ":";
            string    whereClause = string.Format(" WHERE {0} = {1}{2}", key.Key, prefix, key.Value);
            DbCommand expr_5C     = command;

            expr_5C.CommandText += whereClause;
            this.AddInParameter(command, prefix + key.Value, System.Data.DbType.Int32, id);
            return(this.ExecuteNonQueryCommand(command));
        }
示例#28
0
        private string GetFirstNoHeaderNode(System.Collections.Generic.Dictionary <string, NavItem> navItems, string id, out bool isAllCheck, out string nodeKey)
        {
            nodeKey    = string.Empty;
            isAllCheck = true;
            System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
            stringBuilder.Append("<div class=\"two fl clearfix\">");
            if (navItems.Values.Count > 0)
            {
                System.Collections.Generic.KeyValuePair <string, NavItem> keyValuePair = navItems.First <System.Collections.Generic.KeyValuePair <string, NavItem> >();
                if (string.IsNullOrEmpty(keyValuePair.Value.SpanName))
                {
                    nodeKey = keyValuePair.Key;
                    int num = 0;
                    using (System.Collections.Generic.Dictionary <string, NavPageLink> .Enumerator enumerator = keyValuePair.Value.PageLinks.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            System.Collections.Generic.KeyValuePair <string, NavPageLink> current = enumerator.Current;
                            string permissionId = RolePermissionInfo.GetPermissionId(id, current.Value.ID);
                            bool   flag         = this.oldPermissions.FirstOrDefault((RolePermissionInfo p) => p.PermissionId == permissionId) != null;
                            if (!flag)
                            {
                                isAllCheck = false;
                            }
                            if (num == 0)
                            {
                                stringBuilder.Append(" <div class=\"titlecheck fl\">");
                                stringBuilder.AppendFormat(" <label class=\"setalign\"> <input type=\"checkbox\" name=\"permissions\" value=\"{0}\" {1}>{2}</label>", permissionId, this.GetInputCheck(flag), current.Value.Title);
                                stringBuilder.Append("</div>");
                            }
                            else
                            {
                                stringBuilder.Append("  <div class=\"twoinerlist fl\">");
                                stringBuilder.AppendFormat(" <label class=\"setalign\"> <input type=\"checkbox\" name=\"permissions\" value=\"{0}\" {1}>{2}</label>", permissionId, this.GetInputCheck(flag), current.Value.Title);
                                stringBuilder.Append("</div>");
                            }
                            num++;
                        }
                        goto IL_185;
                    }
                }
                stringBuilder.Append(" <div class=\"titlecheck fl\">");
                stringBuilder.Append("  &nbsp;");
                stringBuilder.Append("</div>");
            }
IL_185:
            stringBuilder.Append("</div>");
            return(stringBuilder.ToString());
        }
示例#29
0
        public bool Remove(System.Collections.Generic.KeyValuePair <Key, Value> item)
        {
            bool result;

            try
            {
                this.lc.TryLock();
                result = this.dic.Remove(item);
            }
            finally
            {
                this.lc.UnLock();
            }
            return(result);
        }
示例#30
0
 /// <exception cref="com.arangodb.velocypack.exception.VPackKeyTypeException"/>
 /// <exception cref="com.arangodb.velocypack.exception.VPackNeedAttributeTranslatorException
 ///     "/>
 private VPackSlice getFromCompactObject(string attribute)
 {
     for (System.Collections.Generic.IEnumerator <KeyValuePair <string, VPackSlice> > iterator = this.objectIterator(); iterator
          .MoveNext();)
     {
         System.Collections.Generic.KeyValuePair <string, VPackSlice
                                                  > next = iterator.Current;
         if (next.Key.Equals(attribute))
         {
             return(next.Value);
         }
     }
     // not found
     return(new VPackSlice());
 }
示例#31
0
 private void logbut_Click(object sender, RoutedEventArgs e)
 {
     string userid = "";
     string username = "";
     string pass = "";
     string logined = "";
     System.Collections.Generic.KeyValuePair<string, string> user = new System.Collections.Generic.KeyValuePair<string, string>();
     try
     {
         user = (System.Collections.Generic.KeyValuePair<string, string>)usersbox.SelectedValue;
         userid = user.Key;
         username = user.Value;
         pass = passbox.Password.ToString();
         logined = helper.GET(helper.url, "/index.php?option=com_mtree&task=getstats&id=" + userid + "&pid=" + pass + "").ToString();
         if (logined == "1")
         {
             try
             {
                 MainWindow mwin = new MainWindow();
                 helper.username = username;
                 this.Close();
                 mwin.Show();
             }
             catch
             {
                 MessageBox.Show("Ошибка запуска программы");
             }
         }
         else
         {
             MessageBox.Show("Ошибка авторизации");
         }
     }
     catch
     {
         MessageBox.Show("Выберите пользователя.");
         return;
     }
 }
 public void Copy(IDictionary source, IDictionary destination)
 {
     if (source == null) return;
     if (destination == null) return;
     foreach (object key in source.Keys)
     {
         var value = source[key];
         var kvp
             = new System.Collections.Generic.KeyValuePair<object, object>(key, value);
         var dictionary = value as System.Collections.IDictionary;
         if (!object.ReferenceEquals(null, dictionary))
         {
             // Copy by value
             try
             {
                 var child = Create(dictionary);
                 Copy(dictionary, child);
                 destination[key] = child;
             }
             catch (Exception e)
             {
                 throw new Exception($"unable to create instance of type {dictionary.GetType().FullName}", e);
             }
         }
         else
         {
             var enumerable = value as System.Collections.IEnumerable;
             if (!object.ReferenceEquals(null, value)
                 && value.GetType() != typeof(string)
                 && value.GetType() != typeof(byte[])
                 && !object.ReferenceEquals(null, enumerable))
             {
                 System.Collections.IList arrayCopy = new System.Collections.Generic.List<dynamic>();
                 // Copy by value
                 try
                 {
                     var constructor = enumerable.GetType().GetConstructor(Type.EmptyTypes);
                     if (constructor != null)
                     {
                         arrayCopy = System.Activator.CreateInstance(enumerable.GetType()) as System.Collections.IList;
                     }
                     else { arrayCopy = new System.Collections.Generic.List<dynamic>(); }
                 }
                 catch
                 {
                     arrayCopy = new System.Collections.Generic.List<dynamic>();
                 }
                 Copy(enumerable, arrayCopy);
                 destination[key] = JsonReader.ConvertArray(arrayCopy);
                 //destination[key] = arrayCopy;
             }
             else
             {
                 destination[key] = value;
             }
         }
     }
 }
示例#33
0
        KeyValuePair<CalendarEvent, TimeLine> EvaluateEachSnugPossibiliyOfSnugPossibility(List<List<List<SubCalendarEvent>>> SnugPossibilityPermutation, TimeLine ReferenceTimeLine, CalendarEvent ReferenceCalendarEvent)
        {
            TimeLine CopyOfReferenceTimeLine;
            List<TimeLine> SnugPossibilityTimeLine = new System.Collections.Generic.List<TimeLine>();
            Dictionary<BusyTimeLine, SubCalendarEvent> MyBusyTimeLineToSubCalendarEventDict = new System.Collections.Generic.Dictionary<BusyTimeLine, SubCalendarEvent>();

            Dictionary<CalendarEvent, TimeLine> CalendarEvent_EvaluationIndexDict = new System.Collections.Generic.Dictionary<CalendarEvent, TimeLine>();

            foreach (List<List<SubCalendarEvent>> SnugPermutation in SnugPossibilityPermutation)//goes each permutation of snug possibility generated
            {
                List<SubCalendarEvent> AllSubEvents = new System.Collections.Generic.List<SubCalendarEvent>();

                foreach (List<SubCalendarEvent> eachList in SnugPermutation)
                {
                    AllSubEvents.AddRange(eachList);
                    foreach (SubCalendarEvent eachSubCalendarEvent in eachList)
                    {
                        ReferenceCalendarEvent.updateSubEvent(eachSubCalendarEvent.SubEvent_ID, eachSubCalendarEvent);
                        /*if (SubEvent != null)
                        {
                            SubEvent.updateSubEvent(SubEvent.SubEvent_ID, eachSubCalendarEvent);
                        }*/
                    }

                }

                ReferenceTimeLine = Utility.AddSubCaleventsToTimeLine(ReferenceTimeLine, AllSubEvents);
                CalendarEvent_EvaluationIndexDict.Add(ReferenceCalendarEvent, ReferenceTimeLine);

                /*
                CopyOfReferenceTimeLine = ReferenceTimeLine.CreateCopy();
                //SnugPossibilityTimeLine.Add(CopyOfReferenceTimeLine);
                List<TimeLine> ListOfFreeSpots=getOnlyPertinentTimeFrame(getAllFreeSpots_NoCompleteSchedule(CopyOfReferenceTimeLine), CopyOfReferenceTimeLine);
                List<SubCalendarEvent> ReassignedSubEvents = new System.Collections.Generic.List<SubCalendarEvent>();
                for (int i=0; i<ListOfFreeSpots.Count;i++)
                {
                    DateTime RelativeStartTime = ListOfFreeSpots[i].Start;

                    TimeLine UpdatedTimeLine=Utility.AddSubCaleventsToTimeLine(ListOfFreeSpots[i], SnugPermutation[i]);
                    ListOfFreeSpots[i].AddBusySlots(UpdatedTimeLine.OccupiedSlots);
                    
                    foreach (SubCalendarEvent MySubCalendarEvent in SnugPermutation[i])
                    {//tries to reassign each element in a snug permutation into the referencetimeLine
                        SubCalendarEvent CopyOfMySubCalendarEvent = MySubCalendarEvent.createCopy();
                        TimeSpan MySubCalendarDuration = (CopyOfMySubCalendarEvent.End - CopyOfMySubCalendarEvent.Start);
                        DateTime RelativeEndtime = RelativeStartTime + MySubCalendarDuration;
                        CopyOfMySubCalendarEvent.ReassignTime(RelativeStartTime, RelativeEndtime);
                        CopyOfMySubCalendarEvent.ActiveSlot = new BusyTimeLine(CopyOfMySubCalendarEvent.ID, RelativeStartTime, RelativeEndtime);//Note this is a hack to resolve the reassignment of time since we dont know currently know the distiction between BusyTimeLine and SubCalendarEvent(TimeLine)
                        TimeLine MyTimeLine=CopyOfMySubCalendarEvent.EventTimeLine;
                        CopyOfReferenceTimeLine.MergeTimeLines(MyTimeLine);
                        RelativeStartTime = CopyOfMySubCalendarEvent.End;
                        MyBusyTimeLineToSubCalendarEventDict.Add(CopyOfMySubCalendarEvent.ActiveSlot, CopyOfMySubCalendarEvent);
                    }
                }
                SnugPossibilityTimeLine.Add(CopyOfReferenceTimeLine);*/
            }

            Dictionary<string, double> DictionaryGraph = new System.Collections.Generic.Dictionary<string, double>();

            /*
            foreach (TimeLine MyTimeLine in SnugPossibilityTimeLine)
            {
                
                CalendarEvent MyEventCopy=ReferenceCalendarEvent.createCopy();
                
                foreach (BusyTimeLine MyBusyPeriod in MyTimeLine.OccupiedSlots)
                {
                    EventID MyEventID = new EventID(MyBusyPeriod.TimeLineID);
                    string ParentCalendarEventID = MyEventID.getLevelID(0);
                    if (MyEventCopy.ID == ParentCalendarEventID)
                    {

                        SubCalendarEvent MySubCalendarEvent=MyBusyTimeLineToSubCalendarEventDict[MyBusyPeriod];
                        for (int i = 0; i < MyEventCopy.AllEvents.Length; i++)
                        {
                            if (MyEventCopy.AllEvents[i].ID == MySubCalendarEvent.ID)
                            {
                                MyEventCopy.AllEvents[i] = MySubCalendarEvent;
                                break;
                            }
                        }
                        
                    }
                }
                
                //MyEventCopy=EvaluateTotalTimeLineAndAssignValidTimeSpotsWithReferenceTimeLine(MyEventCopy, MyTimeLine);

                
            }*/

            double HighestValue = 0;

            KeyValuePair<CalendarEvent, TimeLine> FinalSuggestion = new System.Collections.Generic.KeyValuePair<CalendarEvent, TimeLine>(CalendarEvent_EvaluationIndexDict.Keys.ToList()[0], CalendarEvent_EvaluationIndexDict.Values.ToList()[0]);

            /*TimeLine TimeLineUpdated = null;
            Dictionary<string, double> LocationVector = new System.Collections.Generic.Dictionary<string,double>();
            LocationVector.Add("sameElement", 10000000000);


            foreach (KeyValuePair<CalendarEvent, TimeLine> MyCalendarEvent_TimeLine in CalendarEvent_EvaluationIndexDict)
            {
                int RandomIndex = EvaluateRandomNetIndex(MyCalendarEvent_TimeLine.Value);
                RandomIndex = 0;
                LocationVector=BuildDictionaryDistanceEdge(MyCalendarEvent_TimeLine.Value, MyCalendarEvent_TimeLine.Key, LocationVector);
                double ClumpIndex = EvaluateClumpingIndex(MyCalendarEvent_TimeLine.Value, LocationVector);
                ClumpIndex = 1 / ClumpIndex;
                double EvaluationSum = ClumpIndex + RandomIndex;
                if (EvaluationSum < 0)
                {
                    EvaluationSum *= -1;
                }

                if ( EvaluationSum > HighestValue)
                {
                    HighestValue = EvaluationSum;
                    FinalSuggestion = MyCalendarEvent_TimeLine;
                }
            }

            if (FinalSuggestion.Equals(new KeyValuePair<CalendarEvent,TimeLine>()))
            {
                MessageBox.Show("Oh oh J, you'll need to look outside this range...Think of moving other events out of white box space");
            }
            */
            return FinalSuggestion;
        }
示例#34
0
        public void Process_Environment()
        {
            Assert.NotEqual(0, new Process().StartInfo.Environment.Count);

            ProcessStartInfo psi = new ProcessStartInfo();

            // Creating a detached ProcessStartInfo will pre-populate the environment
            // with current environmental variables.

            var Environment2 = psi.Environment;

            Assert.NotEqual(Environment2.Count, 0);

            int CountItems = Environment2.Count;

            Environment2.Add("NewKey", "NewValue");
            Environment2.Add("NewKey2", "NewValue2");

            Assert.Equal(CountItems + 2, Environment2.Count);
            Environment2.Remove("NewKey");
            Assert.Equal(CountItems + 1, Environment2.Count);

            //Exception not thrown with invalid key
            Assert.Throws<ArgumentException>(() => { Environment2.Add("NewKey2", "NewValue2"); });

            //Clear
            Environment2.Clear();
            Assert.Equal(0, Environment2.Count);

            //ContainsKey 
            Environment2.Add("NewKey", "NewValue");
            Environment2.Add("NewKey2", "NewValue2");
            Assert.True(Environment2.ContainsKey("NewKey"));
            if (global::Interop.IsWindows)
            {
                Assert.True(Environment2.ContainsKey("newkey"));
            }
            Assert.False(Environment2.ContainsKey("NewKey99"));

            //Iterating
            string result = null;
            int index = 0;
            foreach (string e1 in Environment2.Values)
            {
                index++;
                result += e1;
            }
            Assert.Equal(2, index);
            Assert.Equal("NewValueNewValue2", result);

            result = null;
            index = 0;
            foreach (string e1 in Environment2.Keys)
            {
                index++;
                result += e1;
            }
            Assert.Equal("NewKeyNewKey2", result);
            Assert.Equal(2, index);

            result = null;
            index = 0;
            foreach (System.Collections.Generic.KeyValuePair<string, string> e1 in Environment2)
            {
                index++;
                result += e1.Key;
            }
            Assert.Equal("NewKeyNewKey2", result);
            Assert.Equal(2, index);

            //Contains
            Assert.True(Environment2.Contains(new System.Collections.Generic.KeyValuePair<string, string>("NewKey", "NewValue")));
            if (global::Interop.IsWindows)
            {
                Assert.True(Environment2.Contains(new System.Collections.Generic.KeyValuePair<string, string>("nEwKeY", "NewValue")));
            }
            Assert.False(Environment2.Contains(new System.Collections.Generic.KeyValuePair<string, string>("NewKey99", "NewValue99")));

            //Exception not thrown with invalid key
            Assert.Throws<ArgumentNullException>(() =>
            {
                Environment2.Contains(new System.Collections.Generic.KeyValuePair<string, string>(null, "NewValue99"));
            }
            );

            Environment2.Add(new System.Collections.Generic.KeyValuePair<string, string>("NewKey98", "NewValue98"));

            //Indexed
            string newIndexItem = Environment2["NewKey98"];
            Assert.Equal("NewValue98", newIndexItem);

            //TryGetValue
            string stringout = null;
            bool retval = false;
            retval = Environment2.TryGetValue("NewKey", out stringout);
            Assert.True(retval);
            Assert.Equal("NewValue", stringout);
            if (global::Interop.IsWindows)
            {
                retval = Environment2.TryGetValue("NeWkEy", out stringout);
                Assert.True(retval);
                Assert.Equal("NewValue", stringout);
            }

            stringout = null;
            retval = false;
            retval = Environment2.TryGetValue("NewKey99", out stringout);
            Assert.Equal(null, stringout);
            Assert.False(retval);

            //Exception not thrown with invalid key
            Assert.Throws<ArgumentNullException>(() =>
            {
                string stringout1 = null;
                bool retval1 = false;
                retval1 = Environment2.TryGetValue(null, out stringout1);
            }
            );

            //Exception not thrown with invalid key
            Assert.Throws<ArgumentNullException>(() =>
            {
                Environment2.Add(null, "NewValue2");
            }
            );

            //Invalid Key to add
            Assert.Throws<ArgumentException>(() =>
            {
                Environment2.Add("NewKey2", "NewValue2");
            }
            );
            //Remove Item
            Environment2.Remove("NewKey98");
            Environment2.Remove("NewKey98");   //2nd occurrence should not assert

            //Exception not thrown with null key
            Assert.Throws<ArgumentNullException>(() => { Environment2.Remove(null); });

            //"Exception not thrown with null key"
            Assert.Throws<System.Collections.Generic.KeyNotFoundException>(() => { string a1 = Environment2["1bB"]; });

            Assert.True(Environment2.Contains(new System.Collections.Generic.KeyValuePair<string, string>("NewKey2", "NewValue2")));
            if (global::Interop.IsWindows)
            {
                Assert.True(Environment2.Contains(new System.Collections.Generic.KeyValuePair<string, string>("NEWKeY2", "NewValue2")));
            }
            Assert.False(Environment2.Contains(new System.Collections.Generic.KeyValuePair<string, string>("NewKey2", "newvalue2")));
            Assert.False(Environment2.Contains(new System.Collections.Generic.KeyValuePair<string, string>("newkey2", "newvalue2")));

            //Use KeyValuePair Enumerator
            var x = Environment2.GetEnumerator();
            x.MoveNext();
            var y1 = x.Current;
            Assert.Equal("NewKey NewValue", y1.Key + " " + y1.Value);
            x.MoveNext();
            y1 = x.Current;
            Assert.Equal("NewKey2 NewValue2", y1.Key + " " + y1.Value);

            //IsReadonly
            Assert.False(Environment2.IsReadOnly);

            Environment2.Add(new System.Collections.Generic.KeyValuePair<string, string>("NewKey3", "NewValue3"));
            Environment2.Add(new System.Collections.Generic.KeyValuePair<string, string>("NewKey4", "NewValue4"));


            //CopyTo
            System.Collections.Generic.KeyValuePair<String, String>[] kvpa = new System.Collections.Generic.KeyValuePair<string, string>[10];
            Environment2.CopyTo(kvpa, 0);
            Assert.Equal("NewKey", kvpa[0].Key);
            Assert.Equal("NewKey3", kvpa[2].Key);

            Environment2.CopyTo(kvpa, 6);
            Assert.Equal("NewKey", kvpa[6].Key);

            //Exception not thrown with null key
            Assert.Throws<System.ArgumentOutOfRangeException>(() => { Environment2.CopyTo(kvpa, -1); });

            //Exception not thrown with null key
            Assert.Throws<System.ArgumentException>(() => { Environment2.CopyTo(kvpa, 9); });

            //Exception not thrown with null key
            Assert.Throws<System.ArgumentNullException>(() =>
            {
                System.Collections.Generic.KeyValuePair<String, String>[] kvpanull = null;
                Environment2.CopyTo(kvpanull, 0);
            }
            );
        }
        private void MoveSelectedItemsLeft(ListBox listBox1, ListBox listBox2)
        {
            if (listBox1.Items.Count > 0 && group.Count > 0)
            {
                foreach (var item in listBox1.SelectedItems)
                {
                    keyValuePair = (KeyValuePair<long, string>)item;
                    friends.Add(keyValuePair.Key, keyValuePair.Value);
                    group.Remove(keyValuePair.Key);
                }

                listBox1.DataSource = null;
                listBox2.DataSource = null;

                listBox2.DisplayMember = "Value";
                listBox2.ValueMember = "Key";

                listBox1.DisplayMember = "Value";
                listBox1.ValueMember = "Key";

                listBox2.DataSource = new BindingSource(friends, null);
                if (group.Count > 0)
                    listBox1.DataSource = new BindingSource(group, null);
                else
                    listBox1.DataSource = null;

                if (listBox1.Items.Count > 0)
                {
                    listBox1.SelectedIndex = 0;
                }

                listBox2.SelectedIndex = listBox2.Items.Count - 1;
            }
        }
示例#36
0
        async public Task<List<MenuItem>> getMenu(string city, string state, string country, string phone)
        {
            try
            {
                menuOptions = await getMenuOptions(city, state, country, phone);
            }
            catch { }

            string url = String.Format("http://mealaroni.com/api_roni.aspx?biz_city={0}&biz_state={1}&biz_country={2}&biz_phone={3}&cmd=menus_all", city, state, country, phone.Replace(" ", ""));
            string result = await getRequest(url);
            XmlDocument xmlDoc = new XmlDocument();

            try
            {
                xmlDoc.LoadXml(result);
                menus.Clear();
                IXmlNode hours = xmlDoc.DocumentElement.SelectSingleNode("hours");
                xmlDoc.DocumentElement.SelectNodes("//Menu").All(fd => {
                    try {
                        Menu s = new Menu();
                        s.storehours = hours;
                        s.menu = fd.Attributes.GetNamedItem("name").NodeValue.ToString().ToString().Replace("_", " ");
                        s.days = fd.SelectSingleNode("ActiveDays");
                        s.items = fd.SelectNodes("MenuItem");
                        List<MenuItem> keyedMenuItems = new System.Collections.Generic.List<MenuItem>();
                        List<MenuItem> menuItemsX = new System.Collections.Generic.List<MenuItem>();
                        foreach (IXmlNode node in s.items)
                        {
                            IXmlNode options = node.SelectSingleNode("ItemOptions");
                            MenuItem newItem = new MenuItem();
                            newItem.menu = node.ParentNode.Attributes.GetNamedItem("name").NodeValue.ToString().Replace("_", " ");
                            newItem.name = node.SelectSingleNode("ItemName").InnerText;
                            newItem.decription = node.SelectSingleNode("ItemDescript").InnerText;
                            newItem.price = node.SelectSingleNode("ItemPrice").InnerText;
                            newItem.options = options;
                            menuItems.Add(newItem);  
                            menuItemsX.Add(newItem);
                        }
                        KeyValuePair<string, List<MenuItem>> keyedMenuItem = new System.Collections.Generic.KeyValuePair<string, List<MenuItem>>(s.menu, menuItemsX);
                        s.keyMenus.Add(keyedMenuItem);                    
                        menus.Add(s);
                    }
                    catch{}
                    return true;
                });


                XmlNodeList menuNodes = xmlDoc.DocumentElement.SelectNodes("//MenuItem");
                
                menuItems.Clear();
                
                foreach (IXmlNode node in menuNodes)
                {
                    IXmlNode options = node.SelectSingleNode("ItemOptions");
                   
                    MenuItem newItem = new MenuItem();                                       
                    newItem.menu = node.ParentNode.Attributes.GetNamedItem("name").NodeValue.ToString().Replace("_", " ");
                    newItem.name = node.SelectSingleNode("ItemName").InnerText;
                    newItem.decription = node.SelectSingleNode("ItemDescript").InnerText;
                    newItem.price = node.SelectSingleNode("ItemPrice").InnerText;
                    newItem.options = options;
                    menuItems.Add(newItem);                    
                }

            }
            catch
            {

            }
            return menuItems;
        }
        private void buttonCreateGroup_Click(object sender, EventArgs e)
        {
            labelFriendListStatus.Text = string.Empty;

            if (string.IsNullOrEmpty(Validations.isGroupNameValid(textBoxGroupName.Text)) && listBoxGroupList.Items.Count > 0)
            {
                messageSpecs.CreateGroupMessage createGroupMessage = new messageSpecs.CreateGroupMessage();

                createGroupMessage.GroupName = textBoxGroupName.Text;

                foreach (var item in listBoxGroupList.Items)
                {
                    keyValuePair = (KeyValuePair<long, string>)item;
                    createGroupMessage.memberList.Add(keyValuePair.Key);
                }

                createGroupMessage.memberList.Add(UserID);

                _myClient.Send(createGroupMessage.getMessageString());
                this.Close();

            }
            else
            {
                labelFriendListStatus.Text = string.IsNullOrEmpty(Validations.isGroupNameValid(textBoxGroupName.Text))
                    ? "Select friends to be added to the group" : listBoxGroupList.Items.Count > 0 ? "Enter Group Name" :
                    "Enter Group Name and select friends to be added to the group";

                labelFriendListStatus.Visible = true;
            }
        }
    private void LoadManualAliasList(string siteID)
    {
        PagingInfo req = new PagingInfo();
        System.Collections.Generic.List<UrlAliasManualData> manualAliasList;
        System.Collections.Generic.List<UrlAliasAutoData> autoAliasList;
        System.Collections.Generic.List<UrlAliasCommunityData> communityAliasList;
        Ektron.Cms.Common.EkEnumeration.UrlAliasingOrderBy orderBy = Ektron.Cms.Common.EkEnumeration.UrlAliasingOrderBy.None;
        Ektron.Cms.Common.EkEnumeration.AutoAliasOrderBy orderAutoAlias = Ektron.Cms.Common.EkEnumeration.AutoAliasOrderBy.None;
        Ektron.Cms.Common.EkEnumeration.CommunityAliasOrderBy orderCommunityAlias = Ektron.Cms.Common.EkEnumeration.CommunityAliasOrderBy.None;
        LocalizationAPI objLocalizationApi = new LocalizationAPI();
        string defaultIcon = string.Empty;
        long currentSiteKey = 0;
        bool _isRemoveAlias = false;
        string mode = string.Empty;
        SiteAPI _refsiteApi = new SiteAPI();
        LanguageData[] languageData = _refsiteApi.GetAllActiveLanguages();
        string strSelectedLanguageName = "";
        string strName;

        req = new PagingInfo(_refContentApi.RequestInformationRef.PagingSize);
        req.CurrentPage = currentPageNumber;

        if (Request.QueryString["action"] == "removealias")
        {
            _isRemoveAlias = true;
        }

        if (Request.QueryString["mode"] == "auto" && !String.IsNullOrEmpty(Request.QueryString["orderby"]))
        {
            orderAutoAlias = (EkEnumeration.AutoAliasOrderBy)Enum.Parse(typeof(EkEnumeration.AutoAliasOrderBy), Convert.ToString(Request.QueryString["orderby"]), true);
        }
        else if (Request.QueryString["mode"] == "community" && !String.IsNullOrEmpty(Request.QueryString["orderby"]))
        {
            orderCommunityAlias = (EkEnumeration.CommunityAliasOrderBy)Enum.Parse(typeof(EkEnumeration.CommunityAliasOrderBy), Convert.ToString(Request.QueryString["orderby"]), true);
        }
        else if (!String.IsNullOrEmpty(Request.QueryString["orderby"]) && Request.QueryString["mode"] != "auto")
        {
            orderBy = (EkEnumeration.UrlAliasingOrderBy)Enum.Parse(typeof(EkEnumeration.UrlAliasingOrderBy), Convert.ToString(Request.QueryString["orderby"]), true);
        }
        if (Page.IsPostBack && (Request.Form["siteSearchItem"] != null))
        {
            long.TryParse((string)(Request.Form["siteSearchItem"]), out currentSiteKey);
        }
        else if (_isRemoveAlias || siteID != "")
        {
            long.TryParse(siteID, out currentSiteKey);
        }
        else
        {
            siteDictionary = _manualAliasList.GetSiteList();
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                long.TryParse(siteList.Key.ToString(), out currentSiteKey);
                break;
            }
        }
        strKeyWords = Request.Form["txtSearch"];

        mode = Request.QueryString["mode"];

        if (mode == "auto")
        {
            if (!String.IsNullOrEmpty(Request.QueryString["searchlist"]))
            {
                _autoSelectedItem = (EkEnumeration.AutoAliasSearchField)Enum.Parse(typeof(EkEnumeration.AutoAliasSearchField), Convert.ToString(Request.QueryString["searchlist"]), true);
            }
            autoAliasList = _autoAliasList.GetList(req, currentSiteKey, Convert.ToInt32(_refContentApi.GetCookieValue("LastValidLanguageID")), _autoSelectedItem, strKeyWords, orderAutoAlias);
            totalPagesNumber = req.TotalPages;
            PageSettings();
            if ((autoAliasList != null) && autoAliasList.Count > 0)
            {
                if (_isRemoveAlias)
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DELETE", msgHelper.GetMessage("generic delete title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Active + "&action=removealias&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("LANG", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.ContentLanguage + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl language") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("SOURCENAME", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.SourceName + "&action=removealias&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl source name") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(15), Unit.Percentage(15), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Type + "&action=removealias&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("type label") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", msgHelper.GetMessage("lbl example alias"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));

                }
                else
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Active + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("LANG", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.ContentLanguage + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl language") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("SOURCENAME", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.SourceName + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl source name") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(15), Unit.Percentage(15), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Type + "&mode=auto&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("type label") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", msgHelper.GetMessage("lbl example alias"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));
                }

                DataTable dt = new DataTable();
                DataRow dr;
                if (_isRemoveAlias)
                {
                    dt.Columns.Add(new DataColumn("DELETE", typeof(string)));
                }
                dt.Columns.Add(new DataColumn("SOURCENAME", typeof(string)));
                dt.Columns.Add(new DataColumn("TYPE", typeof(string)));
                dt.Columns.Add(new DataColumn("ACTIVE", typeof(string)));
                dt.Columns.Add(new DataColumn("ALIAS", typeof(string)));
                dt.Columns.Add(new DataColumn("LANG", typeof(string)));

                for (int i = 0; i <= autoAliasList.Count - 1; i++)
                {
                    dr = dt.NewRow();
                    if (_isRemoveAlias)
                    {
                        dr["DELETE"] = "<input type=\"checkbox\" name=\"deleteAliasId\" value=\"" + (autoAliasList[i].AutoId.ToString()) + "\">";
                    }
                    dr["SOURCENAME"] = "<a href=\"urlautoaliasmaint.aspx?action=view&LangType=" + _refContentApi.GetCookieValue("LastValidLanguageID") + "&fid=" + currentSiteKey + "&id=" + autoAliasList[i].AutoId + "\">" + autoAliasList[i].SourceName + "</a>";
                    if (autoAliasList[i].AutoAliasType == Ektron.Cms.Common.EkEnumeration.AutoAliasType.Folder)
                    {
                        dr["TYPE"] = "<center><img src =\"" + _refContentApi.AppPath + "images/ui/icons/folder.png\" alt=\"" + msgHelper.GetMessage("lbl folder") + "\" title=\"" + msgHelper.GetMessage("lbl folder") + "\"/ ></center>";
                    }
                    else
                    {
                        dr["TYPE"] = "<center><img src =\"" + _refContentApi.AppPath + "images/ui/icons/taxonomy.png\" alt=\"" + msgHelper.GetMessage("generic taxonomy lbl") + "\" title=\"" + msgHelper.GetMessage("generic taxonomy lbl") + "\"/ ></center>";
                    }
                    if (autoAliasList[i].IsEnabled)
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:green\">On</span></center>"; //maliaslist(i).IsEnabled"
                    }
                    else
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:red\">Off</span></center>";
                    }

                    dr["ALIAS"] = autoAliasList[i].Example;
                    if (autoAliasList[i].AutoAliasType == Ektron.Cms.Common.EkEnumeration.AutoAliasType.Taxonomy)
                    {
                        for (int iLang = 0; iLang <= languageData.Length - 1; iLang++)
                        {
                            LanguageData with_1 = languageData[iLang];
                            strName = with_1.LocalName;
                            if (autoAliasList[i].LanguageId == with_1.Id)
                            {
                                strSelectedLanguageName = strName;
                            }
                        }
                    }
                    else
                    {
                        strSelectedLanguageName = "N/A";
                    }
                    dr["LANG"] = "<center><img src=" + objLocalizationApi.GetFlagUrlByLanguageID(System.Convert.ToInt32(autoAliasList[i].LanguageId)) + " alt=\"" + strSelectedLanguageName + "\" title=\"" + strSelectedLanguageName + "\" /></center>";
                    dt.Rows.Add(dr);
                }
                DataView dv = new DataView(dt);
                CollectionListGrid.DataSource = dv;
                CollectionListGrid.DataBind();
            }
        }
        else if (mode == "community")
        {
            communityAliasList = _communityAliasList.GetList(req, currentSiteKey, orderCommunityAlias);
            totalPagesNumber = req.TotalPages;
            PageSettings();
            if (communityAliasList != null && communityAliasList.Count > 0)
            {
                if (_isRemoveAlias)
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DELETE", msgHelper.GetMessage("generic delete title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "<center>" + msgHelper.GetMessage("lbl primary") + "</center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(2), Unit.Percentage(2), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.CommunityAliasOrderBy.Active + "&action=removealias&mode=community&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS PATH", msgHelper.GetMessage("lbl alias path"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.AutoAliasOrderBy.Type + "&action=removealias&mode=community&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("generic type") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", msgHelper.GetMessage("lbl example alias"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));

                }
                else
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "<center>" + msgHelper.GetMessage("lbl primary") + "</center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(2), Unit.Percentage(2), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.CommunityAliasOrderBy.Active + "&mode=community&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS PATH", msgHelper.GetMessage("lbl alias path"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TYPE", "<center><a href=\"urlmanualaliaslistmaint.aspx?orderby=" + EkEnumeration.CommunityAliasOrderBy.Type + "&mode=community&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("generic type") + "</a></center>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", msgHelper.GetMessage("lbl example alias"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));

                }

                DataTable dt = new DataTable();
                DataRow dr;
                if (_isRemoveAlias)
                {
                    dt.Columns.Add(new DataColumn("DELETE", typeof(string)));
                }

                dt.Columns.Add(new DataColumn("DEFAULT", typeof(string)));
                dt.Columns.Add(new DataColumn("TYPE", typeof(string)));
                dt.Columns.Add(new DataColumn("ACTIVE", typeof(string)));
                dt.Columns.Add(new DataColumn("ALIAS", typeof(string)));
                dt.Columns.Add(new DataColumn("ALIAS PATH", typeof(string)));

                for (int i = 0; i <= communityAliasList.Count - 1; i++)
                {
                    dr = dt.NewRow();
                    if (_isRemoveAlias)
                    {
                        dr["DELETE"] = "<input type=\"checkbox\" name=\"deleteAliasId\" value=\"" + (communityAliasList[i].Id.ToString()) + "\">";
                    }
                    if (communityAliasList[i].IsDefault)
                    {
                        defaultIcon = "<center><img src=\"" + _refContentApi.AppPath + "images/ui/icons/check.png\" border=\"0\" alt=\"Item is Enabled\" title=\"Item is Enabled\"/></center>";
                        dr["DEFAULT"] = defaultIcon;
                    }
                    if (communityAliasList[i].IsEnabled)
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:green\">On</span></center>";
                    }
                    else
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:red\">Off</span></center>";
                    }
                    if (communityAliasList[i].CommunityAliasType == Ektron.Cms.Common.EkEnumeration.CommunityAliasType.Group)
                    {
                        dr["TYPE"] = "<center><img src =\"" + _refContentApi.AppPath + "images/ui/icons/usersMemberGroups.png\" alt=\"" + msgHelper.GetMessage("lbl group") + "\" title=\"" + msgHelper.GetMessage("lbl group") + "\"/ ></center>";
                    }
                    else
                    {
                        dr["TYPE"] = "<center><img src =\"" + _refContentApi.AppPath + "images/ui/icons/user.png\" alt=\"" + msgHelper.GetMessage("lbl wa mkt user goals") + "\" title=\"" + msgHelper.GetMessage("lbl wa mkt user goals") + "\"/ ></center>";
                    }
                    for (int iLang = 0; iLang <= languageData.Length - 1; iLang++)
                    {
                        LanguageData with_2 = languageData[iLang];
                        strName = with_2.LocalName;
                        if (communityAliasList[i].LanguageId == with_2.Id)
                        {
                            strSelectedLanguageName = strName;
                        }
                    }
                    dr["ALIAS"] = communityAliasList[i].Example;
                    dr["ALIAS PATH"] = "<a href=\"urlcommunityaliasmaint.aspx?action=view&id=" + communityAliasList[i].Id + "&fId=" + communityAliasList[i].SiteId + "&LangType=" + _refContentApi.GetCookieValue("LastValidLanguageID") + "\">" + communityAliasList[i].AliasPath + "</a>";

                    dt.Rows.Add(dr);
                }
                DataView dv = new DataView(dt);
                CollectionListGrid.DataSource = dv;
                CollectionListGrid.DataBind();
            }
        }
        else
        {
            if (!String.IsNullOrEmpty(Request.Form["searchlist"]))
            {
                _strSelectedItem = (EkEnumeration.UrlAliasSearchField)Enum.Parse(typeof(EkEnumeration.UrlAliasSearchField), Convert.ToString((Request.Form["searchlist"])), true);
            }

            manualAliasList = _manualAliasList.GetList(req, currentSiteKey, Convert.ToInt32(_refContentApi.GetCookieValue("LastValidLanguageID")), _strSelectedItem, strKeyWords, orderBy);
            totalPagesNumber = req.TotalPages;

            PageSettings();

            if ((manualAliasList != null) && manualAliasList.Count > 0)
            {
                if (_isRemoveAlias)
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DELETE", msgHelper.GetMessage("generic delete title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=4&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl primary") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=5&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("LANG", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=2&fId=" + currentSiteKey.ToString() + "\">"+msgHelper.GetMessage("lbl language")+"</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=10&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl alias") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ORIGINAL LINK", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=6&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl original link") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(35), Unit.Percentage(40), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("CONTENT ID", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=1&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("generic content id") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(10), Unit.Percentage(10), false, false));
                }
                else
                {
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DEFAULT", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=4&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl primary") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=5&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl active") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("LANG", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=2&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl language") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(4), Unit.Percentage(4), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ALIAS", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=10&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl alias") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(25), Unit.Percentage(25), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ORIGINAL LINK", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=6&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl original link") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(35), Unit.Percentage(40), false, false));
                    CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("CONTENT ID", "<a href=\"urlmanualaliaslistmaint.aspx?orderby=1&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("generic content id") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(10), Unit.Percentage(10), false, false));
                }

                DataTable dt = new DataTable();
                DataRow dr;
                if (_isRemoveAlias)
                {
                    dt.Columns.Add(new DataColumn("DELETE", typeof(string)));
                }
                dt.Columns.Add(new DataColumn("DEFAULT", typeof(string)));
                dt.Columns.Add(new DataColumn("ACTIVE", typeof(string)));
                dt.Columns.Add(new DataColumn("LANG", typeof(string)));
                dt.Columns.Add(new DataColumn("ALIAS", typeof(string)));
                dt.Columns.Add(new DataColumn("ORIGINAL LINK", typeof(string)));
                dt.Columns.Add(new DataColumn("CONTENT ID", typeof(string)));

                for (int i = 0; i <= manualAliasList.Count - 1; i++)
                {
                    dr = dt.NewRow();
                    if (_isRemoveAlias)
                    {
                        dr["DELETE"] = "<input type=\"checkbox\" name=\"deleteAliasId\" value=\"" + (manualAliasList[i].AliasId.ToString()) + "\">";
                    }
                    if (manualAliasList[i].IsDefault)
                    {
                        defaultIcon = "<center><img src=\"" + _refContentApi.AppPath + "images/ui/icons/check.png\" border=\"0\" alt=\"Item is Enabled\" title=\"Item is Enabled\"/></center>";
                        dr["DEFAULT"] = defaultIcon;
                    }
                    if (manualAliasList[i].IsEnabled)
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:green\">On</span></center>"; //maliaslist(i).IsEnabled"
                    }
                    else
                    {
                        dr["ACTIVE"] = "<center><span style=\"color:red\">Off</span></center>";
                    }
                    for (int iLang = 0; iLang <= languageData.Length - 1; iLang++)
                    {
                        LanguageData with_3 = languageData[iLang];
                        strName = with_3.LocalName;
                        if (manualAliasList[i].ContentLanguage == with_3.Id)
                        {
                            strSelectedLanguageName = strName;
                        }
                    }
                    dr["LANG"] = "<center><img src=" + objLocalizationApi.GetFlagUrlByLanguageID(System.Convert.ToInt32(manualAliasList[i].ContentLanguage)) + " alt=\"" + strSelectedLanguageName + "\" /></center>";
                    dr["ALIAS"] = "<a href=\"urlmanualaliasmaint.aspx?action=view&id=" + manualAliasList[i].AliasId + "&fId=" + manualAliasList[i].SiteId + "&LangType=" + _refContentApi.GetCookieValue("LastValidLanguageID") + "\">" + manualAliasList[i].DisplayAlias + "</a>";
                    if (manualAliasList[i].Target.ToLower().IndexOf("downloadasset.aspx?") == -1)
                    {
                        dr["ORIGINAL LINK"] = manualAliasList[i].Target;
                    }
                    else
                    {
                        string workareaPath = string.Empty;
                        workareaPath = Strings.Replace(_refContentApi.AppPath, _refContentApi.SitePath, "", 1, 1, 0);
                        dr["ORIGINAL LINK"] = workareaPath + manualAliasList[i].Target;
                    }

                    dr["CONTENT ID"] = manualAliasList[i].ContentId;
                    dt.Rows.Add(dr);
                }
                DataView dv = new DataView(dt);
                CollectionListGrid.DataSource = dv;
                CollectionListGrid.DataBind();
            }
        }
    }
    private void AddDefaultMenuBar(string siteID)
    {
        Ektron.Cms.UrlAliasing.UrlAliasSettingsApi _aliasSettingsApi = new Ektron.Cms.UrlAliasing.UrlAliasSettingsApi();
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        result.Append("<table><tr>" + "\r\n");
        if (Request.QueryString["mode"] == "auto")
        {
            txtTitleBar.InnerHtml = _refStyle.GetTitleBar(msgHelper.GetMessage("lbl auto aliased page name maintenance"));

            if (_aliasSettingsApi.IsAutoAliasEnabled)
            {
                result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/add.png", "#", msgHelper.GetMessage("msg add alias"), msgHelper.GetMessage("msg add alias"), "onclick=\" addAlias(\'" + contentLanguage.ToString() + "\',\'auto\');\"", StyleHelper.AddButtonCssClass, true));
                result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/driveDelete.png", "#", msgHelper.GetMessage("alt clear automatic alias cache"), msgHelper.GetMessage("btn clear cache"), "onclick=\" clearCache(\'auto\');\"", StyleHelper.DeleteDriveButtonCssClass));
                result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/delete.png", "#", msgHelper.GetMessage("msg delete alias"), msgHelper.GetMessage("msg delete alias"), "onclick=\" removeAlias(\'auto\');\"", StyleHelper.DeleteButtonCssClass));
            }
        }
        else if (Request.QueryString["mode"] == "community")
        {
            txtTitleBar.InnerHtml = _refStyle.GetTitleBar(msgHelper.GetMessage("lbl community aliased page name maintenance"));

            if (_aliasSettingsApi.IsCommunityAliasingEnabled)
            {
                if (contentLanguage != -1)
                {
                    result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/add.png", "#", msgHelper.GetMessage("msg add alias"), msgHelper.GetMessage("msg add alias"), "onclick=\" addAlias(\'" + contentLanguage.ToString() + "\',\'community\');\"", StyleHelper.AddButtonCssClass, true));
                }
                result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/driveDelete.png", "#", msgHelper.GetMessage("alt clear manual alias cache"), msgHelper.GetMessage("btn clear cache"), "onclick=\" clearCache(\'community\');\"", StyleHelper.DeleteDriveButtonCssClass));
                if (contentLanguage != -1)
                {
                    result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/delete.png", "#", msgHelper.GetMessage("msg delete alias"), msgHelper.GetMessage("msg delete alias"), "onclick=\" removeAlias(\'community\');\"", StyleHelper.DeleteButtonCssClass));
                }
            }
        }
        else
        {
            txtTitleBar.InnerHtml = _refStyle.GetTitleBar(msgHelper.GetMessage("lbl manual aliased page name maintenance"));

            if (_aliasSettingsApi.IsManualAliasEnabled)
            {
                bool primaryCssApplied = false;

                if (contentLanguage != -1)
                {
                    result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/add.png", "#", msgHelper.GetMessage("msg add alias"), msgHelper.GetMessage("msg add alias"), "onclick=\" addAlias(\'" + contentLanguage.ToString() + "\',\'manual\');\"", StyleHelper.AddButtonCssClass, !primaryCssApplied));

                    primaryCssApplied = true;
                }

                result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/driveDelete.png", "#", msgHelper.GetMessage("alt clear manual alias cache"), msgHelper.GetMessage("btn clear cache"), "onclick=\" clearCache(\'manual\');\"", StyleHelper.DeleteDriveButtonCssClass, !primaryCssApplied));

                primaryCssApplied = true;

                if (contentLanguage != -1)
                {
                    result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/delete.png", "#", msgHelper.GetMessage("msg delete alias"), msgHelper.GetMessage("msg delete alias"), "onclick=\" removeAlias();\"", StyleHelper.DeleteButtonCssClass));
                }
            }
        }
        if (_aliasSettingsApi.IsAutoAliasEnabled || _aliasSettingsApi.IsManualAliasEnabled)
        {

        }
        if (Request.QueryString["mode"] != "community")
        {
            result.Append(StyleHelper.ActionBarDivider);

            result.Append("<td class=\"label\">");
            result.Append("&nbsp;" + msgHelper.GetMessage("view in label") + ":&nbsp;" + _refStyle.ShowAllActiveLanguage(true, "", "", contentLanguage.ToString()));
            result.Append("</td>");
        }
        ///' Hiding the following select dropwodn as to hide the site '''''
        if (Request.QueryString["mode"] == "community")
        {
            result.Append("<td class=\"label\" style=\"display: none !important;\">&nbsp;");
        }
        else
        {
            result.Append("<td class=\"label\">&nbsp;");
        }
        result.Append(msgHelper.GetMessage("lbl site"));
        result.Append("</td>");
        if (Request.QueryString["mode"] == "community")
        {
            result.Append("<td class=\"label\" style=\"display: none !important;\">");
        }
        else
        {
            result.Append("<td class=\"label\">");
        }
        result.Append("<select name=\"siteSearchItem\" id=\"siteSearchItem\" ONCHANGE=\"SubmitForm(\'form1\',\'\');\"/>&nbsp;");
        siteDictionary = _manualAliasList.GetSiteList();

        if (Page.IsPostBack)
        {
            long curr_sitekey = System.Convert.ToInt64(Request.Form["siteSearchItem"]);
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                if (siteList.Key == curr_sitekey)
                {
                    result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
                    break;
                }
            }
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                if (siteList.Key != curr_sitekey)
                {
                    result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
                }
            }
        }
        else if (siteID != "")
        {
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                if (siteList.Key == long.Parse(siteID))
                {
                    result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
                    break;
                }
            }
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                if (siteList.Key != long.Parse(siteID))
                {
                    result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
                }
            }
        }
        else
        {
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
            }
        }

        result.Append("</select>");
        result.Append("</td>");
        if (Request.QueryString["mode"] == "auto")
        {
            CollectSearchText();

            result.Append(StyleHelper.ActionBarDivider);

            result.Append("<td class=\"label\">");
            result.Append("<label for=\'txtSearch\'>" + msgHelper.GetMessage("btn search") + "</label>");
            result.Append("</td>");
            result.Append("<td>");
            result.Append("<input type=\"text\" class=\"ektronTextXXSmall\" id=\"txtSearch\" name=\"txtSearch\" value=\"" + strKeyWords + "\" autocomplete=\"off\" onkeydown=\"CheckForReturn(event)\">");
            result.Append("<select id=\"searchlist\" name=\"searchlist\">");
            result.Append("<option value=" + EkEnumeration.AutoAliasSearchField.All.ToString() + IsSelected("" + EkEnumeration.AutoAliasSearchField.All.ToString() + "") + ">All</option>");
            result.Append("<option value=" + EkEnumeration.AutoAliasSearchField.SourceName.ToString() + IsSelected("" + EkEnumeration.AutoAliasSearchField.SourceName.ToString() + "") + ">Source Name</option>");
            result.Append("</select>");
            result.Append("</td>");
            result.Append("<td><input type=\"image\" src=\"" + _refContentApi.AppPath + "images/ui/icons/magnifier.png\" value=" + msgHelper.GetMessage("btn search") + " alt=\"" + msgHelper.GetMessage("btn search") + "\" title=\"" + msgHelper.GetMessage("btn search") + "\" id=\"btnSearch\" name=\"btnSearch\" onclick=\"searchuser();return false;\" style=\"margin-left: .25em\" title=\"Search Users\" /></td>");
        }
        else if (Request.QueryString["mode"] == "community")
        {

        }
        else
        {
            CollectSearchText();

            result.Append(StyleHelper.ActionBarDivider);

            result.Append("<td class=\"label\">");
            result.Append("<label for=\'txtSearch\'>" + msgHelper.GetMessage("btn search") + "</label>");
            result.Append("</td>");
            result.Append("<td>");
            result.Append("<input type=\"text\" id=\"txtSearch\" class=\"ektronTextXXSmall\" name=\"txtSearch\" value=\"" + strKeyWords + "\" autocomplete=\"off\" onkeydown=\"CheckForReturn(event)\">");
            result.Append("<select id=\"searchlist\" name=\"searchlist\">");
            result.Append("<option value=" + EkEnumeration.UrlAliasSearchField.All.ToString() + IsSelected("" + EkEnumeration.UrlAliasSearchField.All.ToString() + "") + ">All</option>");
            result.Append("<option value=" + EkEnumeration.UrlAliasSearchField.Alias.ToString() + IsSelected("" + EkEnumeration.UrlAliasSearchField.Alias.ToString() + "") + ">Alias</option>");
            result.Append("<option value=" + EkEnumeration.UrlAliasSearchField.ContentId.ToString() + IsSelected("" + EkEnumeration.UrlAliasSearchField.ContentId.ToString() + "") + ">Content ID</option>");
            result.Append("<option value=" + EkEnumeration.UrlAliasSearchField.ContentTitle.ToString() + IsSelected("" + EkEnumeration.UrlAliasSearchField.ContentTitle.ToString() + "") + ">Content Title</option>");
            result.Append("<option value=" + EkEnumeration.UrlAliasSearchField.Target.ToString() + IsSelected("" + EkEnumeration.UrlAliasSearchField.Target.ToString() + "") + ">Original Link</option>");
            result.Append("</select>");
            result.Append("</td>");
            result.Append("<td><input type=\"image\" src=\"" + _refContentApi.AppPath + "images/ui/icons/magnifier.png\" value=" + msgHelper.GetMessage("btn search") + " alt=\"" + msgHelper.GetMessage("btn search") + "\" title=\"" + msgHelper.GetMessage("btn search") + "\" id=\"btnSearch\" name=\"btnSearch\" onclick=\"searchuser();return false;\" style=\"margin-left: .25em\" title=\"Search Users\" /></td>");
        }

        result.Append(StyleHelper.ActionBarDivider);

        if (Request.QueryString["mode"] == "auto")
        {
            result.Append("<td>" + _refStyle.GetHelpButton("AutoAliasPageMaint", "") + "</td>");
        }
        else if (Request.QueryString["mode"] == "community")
        {
            result.Append("<td>" + _refStyle.GetHelpButton("CommunityAliasPageMaint", "") + "</td>");
        }
        else
        {
            result.Append("<td>" + _refStyle.GetHelpButton("ManAliasPageMaint", "") + "</td>");
        }
        result.Append("</tr></table>");
        htmToolBar.InnerHtml = result.ToString();
        result = null;
        StyleSheetJS.Text = (new StyleHelper()).GetClientScript();
    }
    private void LoadRegExlAliasList(string siteID)
    {
        string defaultIcon = string.Empty;
        PagingInfo req = new PagingInfo();
        bool _isRemoveAlias = false;
        long currentSiteKey = 0;
        System.Collections.Generic.List<UrlAliasRegExData> mregexaliaslist;
        Ektron.Cms.Common.EkEnumeration.RegExOrderBy orderBy = Ektron.Cms.Common.EkEnumeration.RegExOrderBy.None;

        req = new PagingInfo(_refContentApi.RequestInformationRef.PagingSize);
        req.CurrentPage = _currentPageNumber;

        if (!String.IsNullOrEmpty(Request.QueryString["orderby"]))
        {
            orderBy = (EkEnumeration.RegExOrderBy)Enum.Parse(typeof(EkEnumeration.RegExOrderBy), Convert.ToString(Request.Form["orderby"]), true);
        }

        if (Request.QueryString["action"] == "removealias")
        {
            _isRemoveAlias = true;
        }

        if (Page.IsPostBack)
        {
            long.TryParse((string)(Request.Form["siteSearchItem"]), out currentSiteKey);
        }
        else if (_isRemoveAlias || siteID != "")
        {
            long.TryParse(siteID, out currentSiteKey);
        }
        else
        {
            siteDictionary = _manualAliaslist.GetSiteList();
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                long.TryParse(siteList.Key.ToString(), out currentSiteKey);
                break;
            }
        }

        strKeyWords = String.IsNullOrEmpty(Request.Form["txtSearch"]) ? "" : Request.Form["txtSearch"];
        if (!String.IsNullOrEmpty(Request.Form["searchlist"]))
        {
            strSelectedItem = (EkEnumeration.RegExAliasSearchField)Enum.Parse(typeof(EkEnumeration.RegExAliasSearchField), Convert.ToString(Request.Form["searchlist"]), true);
        }

        mregexaliaslist = _regexAliaslist.GetList(req, currentSiteKey, false, strSelectedItem, strKeyWords, orderBy);
        TotalPagesNumber = req.TotalPages;
        PageSettings();

        if ((mregexaliaslist != null) && mregexaliaslist.Count > 0)
        {
            if (_isRemoveAlias)
            {
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("DELETE", "Delete", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(3), Unit.Percentage(3), false, false));
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<a href=\"urlregexaliaslistmaint.aspx?orderby=" + EkEnumeration.RegExOrderBy.Active + "&action=removealias&fId=" + currentSiteKey.ToString() + "\">Active</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ORDER", "<a href=\"urlregexaliaslistmaint.aspx?orderby=" + EkEnumeration.RegExOrderBy.Priority + "&action=removealias&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl priority") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("EXPRESSION", "<a href=\"urlregexaliaslistmaint.aspx?orderby=" + EkEnumeration.RegExOrderBy.ExpressionName + "&action=removealias&fId=" + currentSiteKey.ToString() + "\">Expression Name</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(35), Unit.Percentage(35), false, false));
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TARGET", "Example URL", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(35), Unit.Percentage(35), false, false));
            }
            else
            {
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ACTIVE", "<a href=\"urlregexaliaslistmaint.aspx?orderby=" + EkEnumeration.RegExOrderBy.Active + "&fId=" + currentSiteKey.ToString() + "\">Active</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("ORDER", "<a href=\"urlregexaliaslistmaint.aspx?orderby=" + EkEnumeration.RegExOrderBy.Priority + "&&fId=" + currentSiteKey.ToString() + "\">" + msgHelper.GetMessage("lbl priority") + "</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("EXPRESSION", "<a href=\"urlregexaliaslistmaint.aspx?orderby=" + EkEnumeration.RegExOrderBy.ExpressionName + "&fId=" + currentSiteKey.ToString() + "\">Expression Name</a>", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(35), Unit.Percentage(35), false, false));
                CollectionListGrid.Columns.Add(_refStyle.CreateBoundField("TARGET", "Example URL", "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(35), Unit.Percentage(35), false, false));
            }

            DataTable dt = new DataTable();
            DataRow dr;
            if (_isRemoveAlias)
            {
                dt.Columns.Add(new DataColumn("DELETE", typeof(string)));
            }
            dt.Columns.Add(new DataColumn("EXPRESSION", typeof(string)));
            dt.Columns.Add(new DataColumn("TARGET", typeof(string)));
            dt.Columns.Add(new DataColumn("ACTIVE", typeof(string)));
            dt.Columns.Add(new DataColumn("ORDER", typeof(string)));

            for (int i = 0; i <= mregexaliaslist.Count - 1; i++)
            {
                dr = dt.NewRow();
                if (_isRemoveAlias)
                {
                    dr["DELETE"] = "<input type=\"checkbox\" name=\"deleteRegexId\" value=\"" + mregexaliaslist[i].RegExId.ToString() + "\">";
                }
                dr["EXPRESSION"] = "<a href=\"urlregexaliasmaint.aspx?action=view&id=" + mregexaliaslist[i].RegExId.ToString() + "&fId=" + currentSiteKey.ToString() + "\">" + mregexaliaslist[i].ExpressionName + "</a>";
                dr["TARGET"] = mregexaliaslist[i].TransformedUrl;
                if (mregexaliaslist[i].IsEnabled)
                {
                    dr["ACTIVE"] = "<center style=\"color:green\">On</center>"; //maliaslist(i).IsEnabled"
                }
                else
                {
                    dr["ACTIVE"] = "<center style=\"color:red\">Off</center>";
                }
                dr["ORDER"] = "<center>" + mregexaliaslist[i].Priority.ToString() + "</center>";

                dt.Rows.Add(dr);
            }
            DataView dv = new DataView(dt);
            CollectionListGrid.DataSource = dv;
            CollectionListGrid.DataBind();
        }
    }
    private void AddDefaultMenuBar(string siteID)
    {
        bool canAddMenu = true;
        divTitleBar.InnerHtml = _refStyle.GetTitleBar(msgHelper.GetMessage("lbl regex aliased page name maintenance"));
        System.Text.StringBuilder result = new System.Text.StringBuilder();
        long curr_sitekey;

        result.Append("<table><tr>" + "\r\n");
        if (canAddMenu)
        {
            if (_aliasSettingsApi.IsRegExAliasEnabled)
            {
                result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/UI/Icons/add.png", "#", msgHelper.GetMessage("msg add regex"), msgHelper.GetMessage("msg add regex"), "Onclick=\"javascript: addRegex();\"", StyleHelper.AddButtonCssClass, true));
                result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/UI/Icons/delete.png", "#", msgHelper.GetMessage("msg delete regex"), msgHelper.GetMessage("msg remove regex"), "Onclick=\"javascript: removeRegex();\"", StyleHelper.DeleteButtonCssClass));
                result.Append(_refStyle.GetButtonEventsWCaption(_refCommonApi.AppPath + "images/ui/icons/driveDelete.png", "#", msgHelper.GetMessage("alt clear regex cache"), msgHelper.GetMessage("btn clear cache"), "Onclick=\"javascript: clearCache();\"", StyleHelper.DeleteDriveButtonCssClass));
            }
        }

        result.Append(StyleHelper.ActionBarDivider);
        result.Append("<td class=\"label\">&#160;" + msgHelper.GetMessage("lbl site") + ":&nbsp;<select name=\"siteSearchItem\" id=\"siteSearchItem\" ONCHANGE=\"SubmitForm(\'form1\',\'\');\"/>&nbsp;<br>");

        siteDictionary = _manualAliaslist.GetSiteList();
        if (Page.IsPostBack)
        {
            long.TryParse(Request.Form["siteSearchItem"], out curr_sitekey);
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                if (siteList.Key == curr_sitekey)
                {
                    result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
                    break;
                }
            }
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                if (siteList.Key != curr_sitekey)
                {
                    result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
                }
            }
        }
        else if (siteID != "")
        {
            long.TryParse(siteID, out curr_sitekey);
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                if (siteList.Key == curr_sitekey)
                {
                    result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
                    break;
                }
            }
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                if (siteList.Key != curr_sitekey)
                {
                    result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
                }
            }
        }
        else
        {
            foreach (System.Collections.Generic.KeyValuePair<long, string> tempLoopVar_siteList in siteDictionary)
            {
                siteList = tempLoopVar_siteList;
                result.Append("<option value=\"" + siteList.Key.ToString() + "\">" + siteList.Value + "</option>");
            }
        }
        result.Append(StyleHelper.ActionBarDivider);
        CollectSearchText();
        result.Append("<td class=\"label\"><label for=\"txtSearch\">" + msgHelper.GetMessage("generic search") + "</label>");
        result.Append("<input type=\"text\" size=\"25\" class=\"ektronTextXXSmall\" id=\"txtSearch\" name=\"txtSearch\" value=\"" + strKeyWords + "\" onkeydown=\"CheckForReturn(event)\" autocomplete=\"off\">");
        result.Append("<select id=\"searchlist\" name=\"searchlist\">");
        result.Append("<option value=" + EkEnumeration.RegExAliasSearchField.All.ToString() + IsSelected("" + EkEnumeration.RegExAliasSearchField.All.ToString() + "") + ">All</option>");
        result.Append("<option value=" + EkEnumeration.RegExAliasSearchField.ExpressionName.ToString() + IsSelected("" + EkEnumeration.RegExAliasSearchField.ExpressionName.ToString() + "") + ">Expression Name</option>");
        result.Append("</select><input type=button value=" + msgHelper.GetMessage("btn search") + " title=" + msgHelper.GetMessage("btn search") + " id=\"btnSearch\" name=\"btnSearch\" onclick=\"searchuser();\" class=\"ektronWorkareaSearch\" title=\"Search Users\" />");
        result.Append("</td>");
        result.Append(StyleHelper.ActionBarDivider);
        result.Append("<td>" + _refStyle.GetHelpButton("RegExMaint", "") + "</td>");
        result.Append("</tr></table>");
        divToolBar.InnerHtml = result.ToString();
        result = null;
        StyleSheetJS.Text = (new StyleHelper()).GetClientScript();
    }