Example #1
0
        void SelectSite()
        {
            DiceBot.CompileSites();
            string Sites   = "";
            int    counter = 1;

            foreach (SitesList x in Doormat.Sites)
            {
                Sites += string.Format("{0}) {1}\n", counter++, x.Name);
            }
            while (true)
            {
                Console.WriteLine("Which site would you like to use? Enter the correspondiong number.");
                Console.WriteLine(Sites);
                string input       = Console.ReadLine();
                int    selectedval = 0;
                if (int.TryParse(input, out selectedval))
                {
                    if (selectedval > 0 && selectedval <= Doormat.Sites.Count)
                    {
                        SitesList selected = Doormat.Sites[selectedval - 1];
                        DiceBot.CurrentSite = Activator.CreateInstance(selected.SiteType()) as DoormatCore.Sites.BaseSite;


                        SelectCurrency();
                        break;
                    }
                }
            }
        }
        void GetFilteredAndSortedSites()
        {
            SitesList.Clear();

            var localSitesDic  = OnlineVideoSettings.Instance.SiteSettingsList.ToDictionary(s => s.Name, s => s);
            var onlyLocalSites = OnlineVideoSettings.Instance.SiteSettingsList.ToDictionary(s => s.Name, s => s);
            List <OnlineVideosWebservice.Site> filteredsortedSites = new List <OnlineVideos.OnlineVideosWebservice.Site>(Sites.Updater.OnlineSites);

            filteredsortedSites.ForEach(os => { if (localSitesDic.ContainsKey(os.Name))
                                                {
                                                    onlyLocalSites.Remove(os.Name);
                                                }
                                        });
            filteredsortedSites.AddRange(onlyLocalSites.Select(ls => new OnlineVideosWebservice.Site()
            {
                Name = ls.Value.Name, IsAdult = ls.Value.ConfirmAge, Description = ls.Value.Description, Language = ls.Value.Language, LastUpdated = ls.Value.LastUpdated
            }));
            filteredsortedSites = filteredsortedSites.FindAll(SitePassesFilter);
            filteredsortedSites.Sort(CompareSiteForSort);

            foreach (OnlineVideosWebservice.Site site in filteredsortedSites)
            {
                if (!site.IsAdult || !OnlineVideoSettings.Instance.UseAgeConfirmation || OnlineVideoSettings.Instance.AgeConfirmed)
                {
                    SiteSettings localSite = null;
                    localSitesDic.TryGetValue(site.Name, out localSite);
                    var loListItem = new OnlineSiteViewModel(site, localSite);
                    SitesList.Add(loListItem);
                }
            }

            SitesList.FireChange();
        }
Example #3
0
        private void BindData()
        {
            SitesList.PageSize = int.Parse(PageSizeList.SelectedValue);

            SitesList.DataSource = GetDataView();
            SitesList.DataBind();
        }
        void OnlineVideosSettingsChanged(object sender, EventArgs e)
        {
            var settings = (sender as SettingsChangeWatcher <Configuration.Settings>).Settings;

            if (settings.UseAgeConfirmation != OnlineVideoSettings.Instance.UseAgeConfirmation)
            {
                SitesList.Clear();
            }
        }
Example #5
0
        private void btnSelect_Click(object sender, RoutedEventArgs e)
        {
            SitesList selectedsite = SiteDetailControl.Content as SitesList;

            //Site has been selected
            OnSiteSelected?.Invoke(this, new SiteSelectedEventArgs {
                SelectedSite = selectedsite
            });
        }
 private void Init()
 {
     FromDate       = DateTime.Now.AddDays(-14);
     ToDate         = DateTime.Now.AddDays(14);
     StatusesList   = DataBaseClient.ReadStatuses().Where(s => s.id < 5).ToList();
     SelectedStatus = StatusesList[3];
     TradersList    = DataBaseClient.ReadTraders();//.Where(t => t.id < 10).ToList();
     SelectedTrader = TradersList[0];
     SitesList      = DataBaseClient.ReadSites().Where(s => s.id == 1 || s.id > 3).ToList();
     SelectedSite   = SitesList.FirstOrDefault(s => s.id == 4);
 }
 void RebuildSitesList()
 {
     SitesList.Clear();
     foreach (var site in OnlineVideoSettings.Instance.SiteUtilsList)
     {
         if (site.Value.Settings.IsEnabled &&
             (!site.Value.Settings.ConfirmAge || !OnlineVideoSettings.Instance.UseAgeConfirmation || OnlineVideoSettings.Instance.AgeConfirmed))
         {
             SitesList.Add(new SiteViewModel(site.Value));
         }
     }
     SitesList.FireChange();
 }
 void OnlineVideosMessageReceived(AsynchronousMessageQueue queue, SystemMessage message)
 {
     if (message.ChannelName == OnlineVideosMessaging.CHANNEL)
     {
         OnlineVideosMessaging.MessageType messageType = (OnlineVideosMessaging.MessageType)message.MessageType;
         switch (messageType)
         {
         case OnlineVideosMessaging.MessageType.RebuildSites:
             SiteGroupsList.Clear();
             SitesList.Clear();
             sitesListHasAllSites = false;
             break;
         }
     }
 }
Example #9
0
        private void BindTable()
        {
            SitesList.Columns[0].HeaderText = LocRM.GetString("Title");
            SitesList.Columns[1].HeaderText = LocRM.GetString("Domain");
            SitesList.Columns[2].HeaderText = LocRM.GetString("CName");
            SitesList.Columns[3].HeaderText = LocRM.GetString("eMail");
            SitesList.Columns[4].HeaderText = LocRM.GetString("Phone");
            SitesList.Columns[5].HeaderText = "Reseller";
            DataTable dt = DBTrialRequest.GetDataTable();
            DataView  dv = dt.DefaultView;

            dv.Sort = ViewState[ConstRequestSortingKey].ToString();
            string sFilter = "";

            if (ddReseller.SelectedItem.Value != "0")
            {
                sFilter = "ResellerTitle='" + ddReseller.SelectedItem.Text + "'";
            }
            if (ddStatus.SelectedItem.Value == "1")
            {
                if (sFilter.Length > 0)
                {
                    sFilter += "AND IsActive='True'";
                }
                else
                {
                    sFilter = "IsActive='True'";
                }
            }
            if (ddStatus.SelectedItem.Value == "-1")
            {
                if (sFilter.Length > 0)
                {
                    sFilter += "AND IsActive='False'";
                }
                else
                {
                    sFilter = "IsActive='False'";
                }
            }
            if (sFilter.Length > 0)
            {
                dv.RowFilter = sFilter;
            }
            SitesList.DataSource = dv;
            SitesList.DataBind();
        }
Example #10
0
        private void btnOK_Click(object sender, RoutedEventArgs e)
        {
            BodySite           selSite     = SitesList.SingleOrDefault(s => s.IsSelected);
            SitesConfiguration sitesConfig = RapidPlanEvaluation.Myconfig.GetSitesConfiguration();

            foreach (Site site in sitesConfig.Sites)
            {
                if (site.Name == selSite.Name)
                {
                    AlphaBeta = site.AlphaBeta;
                    LKBn      = site.LKBn;
                    LKBm      = site.LKBm;
                    LKBD50    = site.LKBd50;
                    break;
                }
            }

            DialogResult = true;
        }
        public void SelectSiteGroup(SiteGroupViewModel siteGroupModel)
        {
            if (BackgroundTask.Instance.IsExecuting)
            {
                return;
            }
            SitesList.Clear();
            foreach (string siteName in siteGroupModel.Sites)
            {
                var siteutils = OnlineVideoSettings.Instance.SiteUtilsList;
                SitesList.Add(new SiteViewModel(siteutils[siteName]));
            }
            sitesListHasAllSites = false;
            SitesList.FireChange();
            IWorkflowManager workflowManager = ServiceRegistration.Get <IWorkflowManager>();

            workflowManager.NavigatePushAsync(Guids.WorkflowStateSites, new NavigationContextConfig()
            {
                NavigationContextDisplayLabel = siteGroupModel.Labels["Name"].ToString()
            });
        }
        internal override void AfterLoad(World world)
        {
            base.AfterLoad(world);

            _worldConstructionSearch = new WorldConstructionsList(World);
            _structureSearch         = new StructuresList(World);

            var structures = from structure in World.Structures
                             orderby structure.Type.GetDescription()
                             group structure by structure.Type.GetDescription() into structuretype
                             select structuretype;

            var worldconstructions = from construction in World.WorldConstructions
                                     orderby construction.Type.GetDescription()
                                     group construction by construction.Type.GetDescription() into constructiontype
                                     select constructiontype;

            cmbStructureType.Items.Add("All"); cmbStructureType.SelectedIndex = 0;
            foreach (var structure in structures)
            {
                cmbStructureType.Items.Add(structure.Key);
            }

            cmbConstructionType.Items.Add("All"); cmbConstructionType.SelectedIndex = 0;
            foreach (var construction in worldconstructions)
            {
                cmbConstructionType.Items.Add(construction.Key);
            }

            var worldConstructionEvents = from eventType in World.WorldConstructions.SelectMany(element => element.Events)
                                          group eventType by eventType.Type into type
                                          select type.Key;

            var structureEvents = from eventType in World.Structures.SelectMany(element => element.Events)
                                  group eventType by eventType.Type into type
                                  select type.Key;

            _siteSearch = new SitesList(World);

            var sites = from site in World.Sites
                        where !string.IsNullOrWhiteSpace(site.Name)
                        orderby site.Type
                        group site by site.Type into sitetype
                        select sitetype;

            var populationTypes = from population in World.SitePopulations
                                  orderby population.Race
                                  group population by population.Race into type
                                  select type;

            cmbSiteType.Items.Add("All");
            cmbSiteType.SelectedIndex = 0;

            foreach (var site in sites)
            {
                cmbSiteType.Items.Add(site.Key);
            }

            cmbSitePopulation.Items.Add("All"); cmbSitePopulation.SelectedIndex = 0;
            foreach (var populationType in populationTypes)
            {
                cmbSitePopulation.Items.Add(populationType.Key);
            }

            var siteEvents = from eventType in World.Sites.SelectMany(site => site.Events)
                             group eventType by eventType.Type into type
                             select type.Key;

            TabEvents.Clear();
            TabEvents.Add(siteEvents.ToList());
            TabEvents.Add(structureEvents.ToList());
            TabEvents.Add(worldConstructionEvents.ToList());
        }