Exemple #1
0
        public void RO_Remove()
        {
            CommaDelimitedStringCollection c = new CommaDelimitedStringCollection();

            c.SetReadOnly();
            c.Clear();
        }
Exemple #2
0
        public void RO_Insert()
        {
            CommaDelimitedStringCollection c = new CommaDelimitedStringCollection();

            c.Add("hi");
            c.SetReadOnly();
            c.Insert(0, "bye");
        }
Exemple #3
0
        static void Main(string[] args)
        {
            CommaDelimitedStringCollection commaStr = new CommaDelimitedStringCollection();

            string[] itemList = { "Test1", "Test2", "Test3" };
            commaStr.AddRange(itemList);
            Console.WriteLine(commaStr.ToString());     //Outputs Test1,Test2,Test3
            Console.ReadLine();
        }
Exemple #4
0
        public static string ConvertStringListToCommaSeparatedString(this List <string> list)
        {
            var coll = new CommaDelimitedStringCollection();

            foreach (var s in list)
            {
                coll.Add(s);
            }
            return(coll.ToString());
        }
 internal RecentConnectionConfigElement(RecentQueueManagerConnection rc) : this()
 {
     QueueManagerName = rc.QueueManagerName;
     FilterPrefix     = rc.ObjectNamePrefix;
     if (rc.QueueList != null && rc.QueueList.Count > 0)
     {
         QueueList = new CommaDelimitedStringCollection();
         QueueList.AddRange(rc.QueueList.ToArray());
     }
 }
Exemple #6
0
                public bool IsOrgChartEnabledForUser(User user)
                {
                    bool isenabled = false;

                    //System administrator should have access to this tab regarless of the region

                    if (user.IsSystemAdministrator)
                    {
                        isenabled = true;
                    }
                    else
                    {
                        // Only show Org Chart tab to users in specific region with specific role (in web.config/appSettings)
                        OrgChartExpressSettings settings = (OrgChartExpressSettings)ConfigurationManager.GetSection("OrgChartExpressSettings");
                        if (settings != null)
                        {
                            OrgExElementCollection oelements = settings.Elements;
                            foreach (OrgExElement element in oelements)
                            {
                                if (user.RegionID == element.RegionID)
                                {
                                    CommaDelimitedStringCollection allowedroles = element.AllowedRoles;
                                    if (allowedroles.Contains("*") || allowedroles.Contains(user.RoleID.ToString()))
                                    {
                                        isenabled = true;
                                        break;
                                    }
                                }
                            }
                        }
                        else
                        {
                            throw new ApplicationException("Configuration section - OrgChartExpressSettings is missing from the Portal.Web.Config");
                        }
                    }


                    return(isenabled);



                    //var orgChartRegionalAccess = ConfigurationManager.AppSettings["OrgChartRegionalAccess"];
                    //if (orgChartRegionalAccess == null) throw new Exception("Portal web.config appSettings does not contain key 'OrgChartRegionalAccess'. This key should be a comma separated list of Region Ids that need access to the Organization Chart tab.");

                    //// Look in list of Org Chart region Ids for this user's region Id
                    //foreach (var OrgChartRegionID in orgChartRegionalAccess.ToString().Trim().Split(new char[] { ',' }))
                    //{
                    //    if (user.RegionID == Convert.ToInt32(OrgChartRegionID.Trim())) return true;
                    //}
                    //return false;
                }
 internal RecentRemoteConnectionConfigElement(RecentRemoteQueueManagerConnection rc) : this()
 {
     QueueManagerName = rc.QueueManagerName;
     FilterPrefix     = rc.ObjectNamePrefix;
     if (rc.QueueList != null && rc.QueueList.Count > 0)
     {
         QueueList = new CommaDelimitedStringCollection();
         QueueList.AddRange(rc.QueueList.ToArray());
     }
     Host    = rc.HostName;
     Port    = rc.Port;
     Channel = rc.Channel;
     UserId  = rc.UserId;
 }
Exemple #8
0
        public static string ConvertBookmakListToCommaSeparatedString(this ReadOnlyCollection <BookmarkInfo> bookmarks)
        {
            var coll = new CommaDelimitedStringCollection();

            //var actioncoll = new CommaDelimitedStringCollection();
            foreach (var b in bookmarks)
            {
                //actioncoll.Clear();
                //foreach (string s in b.BookMarkActions)
                //{
                //    actioncoll.Add(s);
                //}
                //var output = b.Name + (actioncoll.Count > 0 ? "-" + actioncoll.ToString() : "");
                coll.Add(b.BookmarkName);
            }
            return(coll.ToString());
        }
Exemple #9
0
        public static string Encode(string[] values, bool surround)
        {
            if ((values == null) || (values.Length < 1))
            {
                return(NULL);
            }
            CommaDelimitedStringCollection strings = new CommaDelimitedStringCollection();

            foreach (string text in values)
            {
                if (!string.IsNullOrEmpty(text))
                {
                    strings.Add(Encode(text.Trim(), surround));
                }
            }
            return(strings.ToString());
        }
Exemple #10
0
        private CommaDelimitedStringCollection MemorySavingDoubleBufferCheck()
        {
            CommaDelimitedStringCollection memSaving = new CommaDelimitedStringCollection();

            if (cbMemoryAppList.Checked)
            {
                memSaving.Add("dgvAppList");
            }
            if (cbMemoryAppListRules.Checked)
            {
                memSaving.Add("dgvAppListRules");
            }
            if (cbMemoryUnassignedAppList.Checked)
            {
                memSaving.Add("dgvUnassignedList");
            }
            return(memSaving);
        }