private void DataGrid_OnAutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)
        {
            switch (e.PropertyName)
            {
                case "Bitrate":
                    e.Column.Header = Properties.Resources.columnBitrate;
                    e.Column.IsReadOnly = true;
                    e.Column.CanUserSort = true;
                    
                    break;
                case "ContentType":
                    e.Column.Header = "MIME(ContentType)";
                    e.Column.IsReadOnly = true;
                    break;

                case "Url":
                    var style = new Style(typeof (TextBlock));
                    style.Setters.Add(new EventSetter(Hyperlink.ClickEvent,(RoutedEventHandler)Hyperlink_Clickhandler));
                    var c = new DataGridHyperlinkColumn()
                    {
                        Header = Properties.Resources.columnUrl,
                        ElementStyle = style,
                        Binding = new Binding("Url"),
                        CanUserSort = true,
                        IsReadOnly = true
                    };
                    e.Column = c;
                    
                    
                    break;
            }
        }
Exemple #2
0
        /// <summary>
        /// Helper Method which creates a default DataGridColumn object for the specified property type.
        /// </summary>
        /// <param name="itemProperty"></param>
        /// <returns></returns>
        internal static DataGridColumn CreateDefaultColumn(ItemPropertyInfo itemProperty)
        {
            Debug.Assert(itemProperty != null && itemProperty.PropertyType != null, "itemProperty and/or its PropertyType member cannot be null");

            DataGridColumn dataGridColumn = null;
            DataGridComboBoxColumn comboBoxColumn = null;
            Type propertyType = itemProperty.PropertyType;

            // determine the type of column to be created and create one
            if (propertyType.IsEnum)
            {
                comboBoxColumn = new DataGridComboBoxColumn();
                comboBoxColumn.ItemsSource = Enum.GetValues(propertyType);
                dataGridColumn = comboBoxColumn;
            }
            else if (typeof(string).IsAssignableFrom(propertyType))
            {
                dataGridColumn = new DataGridTextColumn();
            }
            else if (typeof(bool).IsAssignableFrom(propertyType))
            {
                dataGridColumn = new DataGridCheckBoxColumn();
            }
            else if (typeof(Uri).IsAssignableFrom(propertyType))
            {
                dataGridColumn = new DataGridHyperlinkColumn();
            }
            else
            {
                dataGridColumn = new DataGridTextColumn();
            }

            // determine if the datagrid can sort on the column or not
            if (!typeof(IComparable).IsAssignableFrom(propertyType))
            {
                dataGridColumn.CanUserSort = false;
            }

            dataGridColumn.Header = itemProperty.Name;

            // Set the data field binding for such created columns and
            // choose the BindingMode based on editability of the property.
            DataGridBoundColumn boundColumn = dataGridColumn as DataGridBoundColumn;
            if (boundColumn != null || comboBoxColumn != null)
            {
                Binding binding = new Binding(itemProperty.Name);
                if (comboBoxColumn != null)
                {
                    comboBoxColumn.SelectedItemBinding = binding;
                }
                else
                {
                    boundColumn.Binding = binding;
                }

                PropertyDescriptor pd = itemProperty.Descriptor as PropertyDescriptor;
                if (pd != null)
                {
                    if (pd.IsReadOnly)
                    {
                        binding.Mode = BindingMode.OneWay;
                        dataGridColumn.IsReadOnly = true;
                    }
                }
                else
                {
                    PropertyInfo pi = itemProperty.Descriptor as PropertyInfo;
                    if (pi != null)
                    {
                        if (!pi.CanWrite)
                        {
                            binding.Mode = BindingMode.OneWay;
                            dataGridColumn.IsReadOnly = true;
                        }
                    }
                }
            }

            return dataGridColumn;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:

            #line 5 "..\..\..\Statistics.xaml"
                ((ScreenRecordPlusChrome.Statistics)(target)).SizeChanged += new System.Windows.SizeChangedEventHandler(this.Window_SizeChanged);

            #line default
            #line hidden

            #line 5 "..\..\..\Statistics.xaml"
                ((ScreenRecordPlusChrome.Statistics)(target)).Loaded += new System.Windows.RoutedEventHandler(this.Window_Loaded);

            #line default
            #line hidden

            #line 5 "..\..\..\Statistics.xaml"
                ((ScreenRecordPlusChrome.Statistics)(target)).Closed += new System.EventHandler(this.Window_Closed);

            #line default
            #line hidden
                return;

            case 2:
                this.g_statistics_top = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.tc_statistics_main = ((System.Windows.Controls.TabControl)(target));
                return;

            case 4:
                this.clb_statistics_subjectname = ((Xceed.Wpf.Toolkit.CheckListBox)(target));
                return;

            case 5:
                this.bt_statistics_subject_analysis = ((System.Windows.Controls.Button)(target));

            #line 26 "..\..\..\Statistics.xaml"
                this.bt_statistics_subject_analysis.Click += new System.Windows.RoutedEventHandler(this.bt_statistics_subject_analysis_Click);

            #line default
            #line hidden
                return;

            case 6:
                this.cb_statistics_gaze_fixation1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 7:
                this.cb_statistics_gaze_fixation2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 8:
                this.cb_statistics_gaze_fixation3 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 9:
                this.cb_statistics_gaze_fixation4 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 10:
                this.cb_statistics_gaze_fixation5 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 11:
                this.cb_statistics_gaze_fixation6 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 12:
                this.cb_statistics_gaze_saccade1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 13:
                this.cb_statistics_gaze_saccade2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 14:
                this.cb_statistics_gaze_saccade3 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 15:
                this.cb_statistics_gaze_path1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 16:
                this.cb_statistics_gaze_path2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 17:
                this.cb_statistics_gaze_interaction1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 18:
                this.cb_statistics_gaze_interaction2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 19:
                this.cb_statistics_mouse_fixation1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 20:
                this.cb_statistics_mouse_fixation2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 21:
                this.cb_statistics_mouse_fixation3 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 22:
                this.cb_statistics_mouse_fixation4 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 23:
                this.cb_statistics_mouse_fixation5 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 24:
                this.cb_statistics_mouse_fixation6 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 25:
                this.cb_statistics_mouse_saccade1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 26:
                this.cb_statistics_mouse_saccade2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 27:
                this.cb_statistics_mouse_saccade3 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 28:
                this.cb_statistics_mouse_path1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 29:
                this.cb_statistics_mouse_path2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 30:
                this.cb_statistics_mouse_click_1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 31:
                this.cb_statistics_mouse_click_2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 32:
                this.cb_statistics_mouse_click_3 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 33:
                this.cb_statistics_mouse_clicks_1 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 34:
                this.cb_statistics_mouse_clicks_2 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 35:
                this.cb_statistics_mouse_clicks_3 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 36:
                this.cb_statistics_mouse_clicks_4 = ((System.Windows.Controls.CheckBox)(target));
                return;

            case 37:
                this.bt_statistics_export = ((System.Windows.Controls.Button)(target));

            #line 333 "..\..\..\Statistics.xaml"
                this.bt_statistics_export.Click += new System.Windows.RoutedEventHandler(this.bt_statistics_export_Click);

            #line default
            #line hidden
                return;

            case 38:
                this.bt_statistics_calculatefixation = ((System.Windows.Controls.Button)(target));

            #line 343 "..\..\..\Statistics.xaml"
                this.bt_statistics_calculatefixation.Click += new System.Windows.RoutedEventHandler(this.bt_statistics_calculatefixation_Click);

            #line default
            #line hidden
                return;

            case 39:
                this.bt_statistics_calculate = ((System.Windows.Controls.Button)(target));

            #line 353 "..\..\..\Statistics.xaml"
                this.bt_statistics_calculate.Click += new System.Windows.RoutedEventHandler(this.bt_statistics_calculate_Click);

            #line default
            #line hidden
                return;

            case 40:
                this.g_statistics_bottom = ((System.Windows.Controls.Grid)(target));
                return;

            case 41:
                this.dg_statistics_datagrid = ((System.Windows.Controls.DataGrid)(target));
                return;

            case 42:
                this.dgtc_statistics_subject = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 43:
                this.dgtc_statistics_id = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 44:
                this.dgtc_statistics_webpage = ((System.Windows.Controls.DataGridHyperlinkColumn)(target));
                return;

            case 45:
                this.dgtc_statistics_keyword = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 46:
                this.dgtc_statistics_gaze_fixation1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 47:
                this.dgtc_statistics_gaze_fixation2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 48:
                this.dgtc_statistics_gaze_fixation3 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 49:
                this.dgtc_statistics_gaze_fixation4 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 50:
                this.dgtc_statistics_gaze_fixation5 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 51:
                this.dgtc_statistics_gaze_fixation6 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 52:
                this.dgtc_statistics_gaze_saccade1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 53:
                this.dgtc_statistics_gaze_saccade2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 54:
                this.dgtc_statistics_gaze_saccade3 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 55:
                this.dgtc_statistics_gaze_path1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 56:
                this.dgtc_statistics_gaze_path2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 57:
                this.dgtc_statistics_gaze_interaction1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 58:
                this.dgtc_statistics_gaze_interaction2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 59:
                this.dgtc_statistics_mouse_fixation1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 60:
                this.dgtc_statistics_mouse_fixation2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 61:
                this.dgtc_statistics_mouse_fixation3 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 62:
                this.dgtc_statistics_mouse_fixation4 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 63:
                this.dgtc_statistics_mouse_fixation5 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 64:
                this.dgtc_statistics_mouse_fixation6 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 65:
                this.dgtc_statistics_mouse_saccade1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 66:
                this.dgtc_statistics_mouse_saccade2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 67:
                this.dgtc_statistics_mouse_saccade3 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 68:
                this.dgtc_statistics_mouse_path1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 69:
                this.dgtc_statistics_mouse_path2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 70:
                this.dgtc_statistics_mouse_lclick1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 71:
                this.dgtc_statistics_mouse_lclick2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 72:
                this.dgtc_statistics_mouse_lclick3 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 73:
                this.dgtc_statistics_mouse_lclick4 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 74:
                this.dgtc_statistics_mouse_rclick1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 75:
                this.dgtc_statistics_mouse_rclick2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 76:
                this.dgtc_statistics_mouse_rclick3 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 77:
                this.dgtc_statistics_mouse_rclick4 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 78:
                this.dgtc_statistics_mouse_mclick1 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 79:
                this.dgtc_statistics_mouse_mclick2 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 80:
                this.dgtc_statistics_mouse_mclick3 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 81:
                this.dgtc_statistics_mouse_mclick4 = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;
            }
            this._contentLoaded = true;
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.ContactDgd = ((System.Windows.Controls.DataGrid)(target));

            #line 32 "..\..\Contacts.xaml"
                this.ContactDgd.Loaded += new System.Windows.RoutedEventHandler(this.ContactDgd_Loaded);

            #line default
            #line hidden

            #line 32 "..\..\Contacts.xaml"
                this.ContactDgd.MouseDoubleClick += new System.Windows.Input.MouseButtonEventHandler(this.ContactDgd_MouseDoubleClick);

            #line default
            #line hidden
                return;

            case 2:
                this.ContactName = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 3:
                this.Account = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 4:
                this.Company = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 5:
                this.JobTitle = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 6:
                this.Industry = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 7:
                this.Email = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 8:
                this.ContactNo = ((System.Windows.Controls.DataGridHyperlinkColumn)(target));
                return;

            case 9:
                this.Address = ((System.Windows.Controls.DataGridTextColumn)(target));
                return;

            case 10:
                this.AddContact = ((System.Windows.Controls.Button)(target));

            #line 47 "..\..\Contacts.xaml"
                this.AddContact.Click += new System.Windows.RoutedEventHandler(this.AddContact_Click);

            #line default
            #line hidden
                return;

            case 11:
                this.btnDelete = ((System.Windows.Controls.Button)(target));

            #line 48 "..\..\Contacts.xaml"
                this.btnDelete.Click += new System.Windows.RoutedEventHandler(this.BtnDelete_Click);

            #line default
            #line hidden
                return;
            }
            this._contentLoaded = true;
        }
 private void SetBooksData()
 {
     DataGridTextColumn name = new DataGridTextColumn();
     name.Header = "Name";
     name.Binding = new Binding("Name");
     DataGridTextColumn description = new DataGridTextColumn();
     description.Header = "Description";
     description.Binding = new Binding("Description");
     var style = new Style();
     style.Setters.Add(new EventSetter(Hyperlink.ClickEvent, (RoutedEventHandler)EventSetter_OnHandler));
     DataGridHyperlinkColumn website = new DataGridHyperlinkColumn();
     website.Header = "Website";
     website.Binding = new Binding("Website");
     website.ElementStyle = style;
     Results_level1.Columns.Add(name);
     Results_level1.Columns.Add(description);
     Results_level1.Columns.Add(website);
     Results_level1.Items.Add(new Books() { Name = "Python Programming: An Introduction to Computer Science 2nd Edition", Description = "This is the second edition of John Zelle's Python Programming, updated for Python 3. This book is designed to be used as the primary textbook in a college-level first course in computing. It takes a fairly traditional approach, emphasizing problem solving, design, and programming as the core skills of computer science. However, these ideas are illustrated using a non-traditional language, namely Python.", Website = "https://www.fbeedle.com/" });
     Results_level1.Items.Add(new Books() { Name = "Computer Systems: A Programmer's Perspective", Description = "For Computer Organization and Architecture and Computer Systems courses in CS and EE and ECE departments. Developed out of an introductory course at Carnegie Mellon University, this text explains the important and enduring concepts underlying all computer systems, and shows the concrete ways that these ideas affect the correctness, performance, and utility of application programs. The text's concrete and hands-on approach will help students understand what is going on under the hood of a computer system.", Website = "http://prenticehall.com/" });
 }
        public ModsConfirmation()
        {
            InitializeComponent();

            DataGridTextColumn idcol = new DataGridTextColumn();
            DataGridTextColumn Namecol = new DataGridTextColumn();
            DataGridTextColumn Authorcol = new DataGridTextColumn();
            DataGridTextColumn MScol = new DataGridTextColumn();
            DataGridTextColumn Categorycol = new DataGridTextColumn();
            DataGridHyperlinkColumn linkcol = new DataGridHyperlinkColumn();
            idcol.Binding = new Binding("id");
            Namecol.Binding = new Binding("Name");
            Authorcol.Binding = new Binding("Author");
            MScol.Binding = new Binding("MS");
            Categorycol.Binding = new Binding("Category");
            linkcol.Binding = new Binding("link");
            idcol.Header = "ID";
            Namecol.Header = "Name";
            Authorcol.Header = "Author";
            MScol.Header = "Multiplayer/Singleplayer Compatibility";
            Categorycol.Header = "Category";
            linkcol.Header = "Link";
            idcol.Width = 30 ;
            Namecol.Width = 100;
            Authorcol.Width = 100;
            MScol.Width = 300;
            Categorycol.Width = 75;
            linkcol.Width = 50;
            datagridconfirmation.Columns.Add(idcol);
            datagridconfirmation.Columns.Add(Namecol);
            datagridconfirmation.Columns.Add(Authorcol);
            datagridconfirmation.Columns.Add(MScol);
            datagridconfirmation.Columns.Add(Categorycol);
            datagridconfirmation.Columns.Add(linkcol);
            StreamReader s1 = new StreamReader(@"./Install/install.ini");
             gencat = s1.ReadLine();
             genblood = s1.ReadLine();
             genFaceImrpovmentProject = s1.ReadLine();
             expandedHorizon = s1.ReadLine();
             gencolors = s1.ReadLine();

             s1.Close();

             if (gencat == "True")
             {
                 DatagridAdderAfterSelection("0", "Combat Animation Enhancement", "Papa Lazarou", "http://forums.taleworlds.com/index.php/topic,134185.0.html", "Animations", "Both");

             }
             if (genblood == "True")
             {
                 DatagridAdderAfterSelection("1", "Blood enhancement tweak v0.5", "neil_v", "http://forums.taleworlds.com/index.php/topic,143179.0.html", "Particles", "Both");
             }
               if (genFaceImrpovmentProject == "True")
                 {
                     DatagridAdderAfterSelection("2", "Face Improvement Project", "Iboltax", "http://forums.taleworlds.com/index.php/topic,163242.0.html", "Skin", "Both");
                 }
              if (expandedHorizon == "True")
             {
              DatagridAdderAfterSelection("3", "Expanded Horizon", "Openshaw", "http://forums.taleworlds.com/index.php/topic,145948.0.html", "Billboards", "Both");
              }
              if (gencolors == "True")
              {
              DatagridAdderAfterSelection("4", "Realistic Colors", "Lucke189", "http://forums.taleworlds.com/index.php?topic=120098.0", "Visuals", "Both");
              }
        }
        public void LoadAccountsFromDataBase()
        {
            try
            {
                this.Dispatcher.Invoke(new Action(delegate
                {
                    AccountViewModel._listOfAccount.Clear();
                }));
                IGGlobals.loadedAccountsDictionary.Clear();
                IGGlobals.listAccounts.Clear();

                DataTable dt = new DataTable();

                dt.Columns.Add("UserName");
                dt.Columns.Add("Password");
                dt.Columns.Add("proxyAddress");
                dt.Columns.Add("proxyPort");
                dt.Columns.Add("proxyUsername");
                dt.Columns.Add("proxyPassword");
                dt.Columns.Add("LogInStatus");
                dt.Columns.Add("Posts");
                dt.Columns.Add("Followers");
                dt.Columns.Add("Followings");
                dt.Columns.Add("Authorized");
                  dt.Columns.Add("Status");
                dt.Columns.Add("Path");






                int counter = 0;
                DataSet ds = null;
                try
                {
                    ds = Qm.SelectAccounts();
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                }



                foreach (DataRow ds_item in ds.Tables[0].Rows)
                {
                    if (Globals.CheckLicenseManager == "fdfreetrial" && counter == 5)
                    {
                        break;
                    }
                    counter = counter + 1;
                    try
                    {
                        string item = ds_item[1].ToString() + ":" + ds_item[2].ToString() + ":" + ds_item[3].ToString() + ":" + ds_item[4].ToString() + ":" + ds_item[5].ToString() + ":" + ds_item[6].ToString() + ":" + ds_item[7].ToString() + ":" + ds_item[8].ToString() + ":" + ds_item[9].ToString() + ":" + ds_item[10].ToString() + ":" + ds_item[11].ToString() + ":" + ds_item[12].ToString() + ":" + ds_item[13].ToString();
                        string account = item;
                        string[] AccArr = account.Split(':');
                        if (AccArr.Count() > 1)
                        {
                            string accountUser = account.Split(':')[0];
                            string accountPass = account.Split(':')[1];

                            string proxyAddress = string.Empty;
                            string proxyPort = string.Empty;
                            string proxyUsername = string.Empty;
                            string proxyPassword = string.Empty;
                            string LogInStatus = string.Empty;
                            string Posts = string.Empty;
                            string Followers = string.Empty;
                            string Followings = string.Empty;
                            string Authorized = string.Empty;
                            string Status = string.Empty;
                            string Path = string.Empty;

                            DataGridColumn newcolumn = new DataGridHyperlinkColumn();


                            int DataCount = account.Split(':').Length;
                            if (DataCount == 2)
                            {
                                //Globals.accountMode = AccountMode.NoProxy;

                            }
                            else if (DataCount == 4)
                            {

                                proxyAddress = account.Split(':')[2];
                                proxyPort = account.Split(':')[3];
                            }
                            else if (DataCount > 5 && DataCount < 7)
                            {

                                proxyAddress = account.Split(':')[2];
                                proxyPort = account.Split(':')[3];
                                proxyUsername = account.Split(':')[4];
                                proxyPassword = account.Split(':')[5];

                            }
                            else if (DataCount >= 7)
                            {
                                proxyAddress = account.Split(':')[2];
                                proxyPort = account.Split(':')[3];
                                proxyUsername = account.Split(':')[4];
                                proxyPassword = account.Split(':')[5];
                                // Path = account.Split(':')[6];
                                LogInStatus = account.Split(':')[9];
                                if (LogInStatus == "")
                                {
                                    LogInStatus = "Not Checked";
                                }
                                // Posts = account.Split(':')[8];
                                // Followers = account.Split(':')[9];
                                // Followings = account.Split(':')[10];
                                Authorized = account.Split(':')[11];
                                Status = account.Split(':')[12];


                            }

                            dt.Rows.Add(accountUser, accountPass, proxyAddress, proxyPort, proxyUsername, proxyPassword, Path, LogInStatus, Posts, Followers, Followings, Authorized, Status);


                            try
                            {
                                InstagramUser obj_InstagramUser = new InstagramUser("", "", "", "");
                                obj_InstagramUser.username = accountUser;
                                obj_InstagramUser.password = accountPass;
                                obj_InstagramUser.proxyip = proxyAddress;
                                obj_InstagramUser.proxyport = proxyPort;
                                obj_InstagramUser.proxyusername = proxyUsername;
                                obj_InstagramUser.proxypassword = proxyPassword;
                                obj_InstagramUser.LogInStatus = LogInStatus;
                                obj_InstagramUser.globusHttpHelper = new GlobusHttpHelper();
                                obj_InstagramUser.globusHttpHelper.proxyAddress = proxyAddress;
                                try
                                {
                                    obj_InstagramUser.globusHttpHelper.port = int.Parse(proxyPort);
                                }
                                catch
                                {
                                    obj_InstagramUser.globusHttpHelper.port = 80;

                                };
                                obj_InstagramUser.globusHttpHelper.proxyUsername = proxyUsername;
                                obj_InstagramUser.globusHttpHelper.proxyPassword = proxyPassword;


                                IGGlobals.loadedAccountsDictionary.Add(obj_InstagramUser.username, obj_InstagramUser);

                                #region MyRegion
                                //try
                                //{
                                //    if (cmbGroups_GroupCampaignManager_Accounts.InvokeRequired)
                                //    {
                                //        cmbScraper__fanscraper_Accounts.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbScraper__fanscraper_Accounts.Items.Add(accountUser);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //}

                                //try
                                //{
                                //    if (cmbScraper__CustomAudiencesScraper_Accounts.InvokeRequired)
                                //    {
                                //        cmbScraper__CustomAudiencesScraper_Accounts.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbScraper__CustomAudiencesScraper_Accounts.Items.Add(accountUser);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //}
                                //try
                                //{
                                //    //cmbCommentsOnPostSelectAccount
                                //    if (cmbCommentsOnPostSelectAccount.InvokeRequired)
                                //    {
                                //        cmbCommentsOnPostSelectAccount.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbCommentsOnPostSelectAccount.Items.Add(accountUser + ":" + accountPass);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error(ex.Message);
                                //}
                                //try
                                //{
                                //    if (cmbGroups_GroupCampaignManager_Accounts.InvokeRequired)
                                //    {
                                //        cmbGroups_GroupCampaignManager_Accounts.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbGroups_GroupCampaignManager_Accounts.Items.Add(accountUser);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //}

                                //try
                                //{
                                //    if (cmbScraper__GroupMemberScraper_Accounts.InvokeRequired)
                                //    {
                                //        cmbScraper__GroupMemberScraper_Accounts.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbScraper__GroupMemberScraper_Accounts.Items.Add(accountUser);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //} 
                                #endregion

                                IGGlobals.listAccounts.Add(obj_InstagramUser.username + ":" + obj_InstagramUser.password + ":" + obj_InstagramUser.proxyip + ":" + obj_InstagramUser.proxyport + ":" + obj_InstagramUser.proxyusername + ":" + obj_InstagramUser.proxypassword);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                            ///Set this to "0" if loading unprofiled accounts
                            ///
                            string profileStatus = "0";
                            try
                            {
                                GramDominator.ViewModule.AccountNotifyPropertyChanged objAccountNotifyPropertyChanged = new GramDominator.ViewModule.AccountNotifyPropertyChanged();

                                objAccountNotifyPropertyChanged.Username = accountUser;
                                objAccountNotifyPropertyChanged.Password = accountPass;
                                objAccountNotifyPropertyChanged.LoginStatus = LogInStatus;
                                // objAccountNotifyPropertyChanged.FollowerCount = FollowerCount;
                                // objAccountNotifyPropertyChanged.FollowingCount = FollwingCount;
                                objAccountNotifyPropertyChanged.ProxyAddress = proxyAddress;
                                objAccountNotifyPropertyChanged.ProxyPassword = proxyPassword;
                                objAccountNotifyPropertyChanged.ProxyPort = proxyPort;
                                objAccountNotifyPropertyChanged.ProxyUserName = proxyUsername;
                                objAccountNotifyPropertyChanged.Status = status;
                                // objAccountNotifyPropertyChanged.Authorized = GroupName;

                                if (LogInStatus.Contains("Success"))
                                {
                                    objAccountNotifyPropertyChanged.LoginStatus = "Success";
                                    objAccountNotifyPropertyChanged.BackgroundColor = "Green";
                                    this.Dispatcher.Invoke(new Action(delegate
                                    {
                                        AccountViewModel._listOfAccount.Add(objAccountNotifyPropertyChanged);
                                    }));
                                }
                                else if (LogInStatus.Contains("Fail"))
                                {
                                    objAccountNotifyPropertyChanged.LoginStatus = "Fail";
                                    objAccountNotifyPropertyChanged.BackgroundColor = "Red";
                                    this.Dispatcher.Invoke(new Action(delegate
                                    {
                                        AccountViewModel._listOfAccount.Add(objAccountNotifyPropertyChanged);
                                    }));
                                }
                                else if (LogInStatus.Contains("Not"))
                                {
                                    objAccountNotifyPropertyChanged.LoginStatus = "Not Checked";
                                    objAccountNotifyPropertyChanged.BackgroundColor = "Red";
                                    this.Dispatcher.Invoke(new Action(delegate
                                    {
                                        AccountViewModel._listOfAccount.Add(objAccountNotifyPropertyChanged);
                                    }));
                                }
                            }
                            catch (Exception ex)
                            {

                            }


                        }
                        else
                        {
                            GlobusLogHelper.log.Info("Account has some problem : " + item);
                            GlobusLogHelper.log.Debug("Account has some problem : " + item);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                }
                //DataView dv = ds.Tables[0].DefaultView;
                //dv.AllowNew = false;

                this.Dispatcher.Invoke(new Action(delegate
                {
                    grvAccounts_AccountCreator_AccountDetails.ItemsSource = AccountViewModel._listOfAccount;

                }));

                //GlobusLogHelper.log.Debug("Accounts Loaded : " + dt.Rows.Count);
            //    GlobusLogHelper.log.Info("Accounts Loaded : " + dt.Rows.Count);

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }
        public void LoadAccountsFromDataBase()
        {
            try
            {
                LDGlobals.loadedAccountsDictionary.Clear();
                LDGlobals.listAccounts.Clear();

                DataTable dt = new DataTable();

                dt.Columns.Add("UserName");
                dt.Columns.Add("Password");
               // dt.Columns.Add("ScreenName");
               //// dt.Columns.Add("FollowerCount");
               // dt.Columns.Add("FollwingCount");
                dt.Columns.Add("proxyAddress");
                dt.Columns.Add("proxyPort");
                dt.Columns.Add("ProxyUserName");
                dt.Columns.Add("ProxyPassword");
             //   dt.Columns.Add("GroupName");
              //  dt.Columns.Add("AccountStatus");



                int counter = 0;
                DataSet ds = null;
                try
                {
                    ds = Qm.SelectAccounts();
                }
                catch (Exception ex)
                {
                    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                }


                foreach (DataRow ds_item in ds.Tables[0].Rows)
                {
                    if (Globals.CheckLicenseManager == "fdfreetrial" && counter == 5)
                    {
                        break;
                    }
                    counter = counter + 1;
                    try
                    {
                        string item = ds_item[0].ToString() + ":" + ds_item[1].ToString() + ":" + ds_item[2].ToString() + ":" + ds_item[3].ToString() + ":" + ds_item[4].ToString() + ":" + ds_item[5].ToString();
                        string account = item;
                        string[] AccArr = account.Split(':');
                        if (AccArr.Count() > 1)
                        {
                            string accountUser = account.Split(':')[0];
                            string accountPass = account.Split(':')[1];

                            string ScreenName = string.Empty;
                            string FollowerCount = string.Empty;
                            string FollwingCount = string.Empty;
                            string proxyAddress = string.Empty;
                            string proxyPort = string.Empty;
                            string proxyUserName = string.Empty;
                            string proxyPassword = string.Empty;
                            string GroupName = string.Empty;
                            string AccountStatus = string.Empty;
                            string status = string.Empty;

                            DataGridColumn newcolumn = new DataGridHyperlinkColumn();


                            int DataCount = account.Split(':').Length;
                            if (DataCount == 2)
                            {
                                //Globals.accountMode = AccountMode.NoProxy;

                            }
                            else if (DataCount == 4)
                            {

                                proxyAddress = account.Split(':')[2];
                                proxyPort = account.Split(':')[3];
                            }
                            else if (DataCount ==6)
                            {

                                proxyAddress = account.Split(':')[2];
                                proxyPort = account.Split(':')[3];
                                proxyUserName = account.Split(':')[4];
                                proxyPassword = account.Split(':')[5];

                            }
                          

                            dt.Rows.Add(accountUser, accountPass,proxyAddress, proxyPort, proxyUserName, proxyPassword);


                            try
                            {
                                LinkedinUser objLD_Users = new LinkedinUser();
                               // TWTUsers objTwtUser = new TWTUsers();
                                objLD_Users.username = accountUser;
                                objLD_Users.password = accountPass;
                                objLD_Users.proxyip = proxyAddress;
                                objLD_Users.proxyport = proxyPort;
                                objLD_Users.proxyusername = proxyUserName;
                                objLD_Users.proxypassword = proxyPassword;

                                LDGlobals.loadedAccountsDictionary.Add(objLD_Users.username, objLD_Users);
//                                TWTGlobals.loadedAccountsDictionary.Add(objTwtUser.username, objTwtUser);

                                #region MyRegion
                                //try
                                //{
                                //    if (cmbGroups_GroupCampaignManager_Accounts.InvokeRequired)
                                //    {
                                //        cmbScraper__fanscraper_Accounts.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbScraper__fanscraper_Accounts.Items.Add(accountUser);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //}

                                //try
                                //{
                                //    if (cmbScraper__CustomAudiencesScraper_Accounts.InvokeRequired)
                                //    {
                                //        cmbScraper__CustomAudiencesScraper_Accounts.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbScraper__CustomAudiencesScraper_Accounts.Items.Add(accountUser);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //}
                                //try
                                //{
                                //    //cmbCommentsOnPostSelectAccount
                                //    if (cmbCommentsOnPostSelectAccount.InvokeRequired)
                                //    {
                                //        cmbCommentsOnPostSelectAccount.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbCommentsOnPostSelectAccount.Items.Add(accountUser + ":" + accountPass);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error(ex.Message);
                                //}
                                //try
                                //{
                                //    if (cmbGroups_GroupCampaignManager_Accounts.InvokeRequired)
                                //    {
                                //        cmbGroups_GroupCampaignManager_Accounts.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbGroups_GroupCampaignManager_Accounts.Items.Add(accountUser);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //}

                                //try
                                //{
                                //    if (cmbScraper__GroupMemberScraper_Accounts.InvokeRequired)
                                //    {
                                //        cmbScraper__GroupMemberScraper_Accounts.Invoke(new MethodInvoker(delegate
                                //        {
                                //            cmbScraper__GroupMemberScraper_Accounts.Items.Add(accountUser);
                                //        }));
                                //    }
                                //}
                                //catch (Exception ex)
                                //{
                                //    GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                                //} 
                                #endregion

                                LDGlobals.listAccounts.Add(objLD_Users.username + ":" + objLD_Users.password + ":" + objLD_Users.proxyip + ":" + objLD_Users.proxyport + ":" + objLD_Users.proxyusername + ":" + objLD_Users.proxypassword);
                              //  TWTGlobals.listAccounts.Add(objTwtUser.username + ":" + objTwtUser.password + ":" + objTwtUser.proxyip + ":" + objTwtUser.proxyport + ":" + objTwtUser.proxyusername + ":" + objTwtUser.proxypassword);
                            }
                            catch (Exception ex)
                            {
                                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                            }

                            ///Set this to "0" if loading unprofiled accounts
                            ///
                            string profileStatus = "0";


                        }
                        else
                        {
                            GlobusLogHelper.log.Info("Account has some problem : " + item);
                            GlobusLogHelper.log.Debug("Account has some problem : " + item);
                        }
                    }
                    catch (Exception ex)
                    {
                        GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
                    }

                }
                DataView dv = dt.DefaultView;
                dv.AllowNew = false;

           
                
                this.Dispatcher.Invoke(new Action(delegate
                {
                   // grvAccounts_AccountCreator_AccountDetails.ItemsSource = dv;

                }));

                try
                {
                    grvAccounts_AccountCreator_AccountDetails.ItemsSource = dt.DefaultView;
                }
                catch { }


                GlobusLogHelper.log.Debug("Accounts Loaded : " + dt.Rows.Count);
                GlobusLogHelper.log.Info("Accounts Loaded : " + dt.Rows.Count);

            }
            catch (Exception ex)
            {
                GlobusLogHelper.log.Error("Error : " + ex.StackTrace);
            }
        }