コード例 #1
0
        static void Main()
        {
            //檢查是否有即時更新程式的換版檔案
            if (File.Exists("LiveUpdate.ex_"))
            {
                File.Delete("LiveUpdate.exe");                  //先刪除舊版本
                File.Move("LiveUpdate.ex_", "LiveUpdate.exe");  //再將新的程式更名
            }

            XmlConfigurator.ConfigureAndWatch(new System.IO.FileInfo("log4net_config.xml"));

            ProductManager.Load("exchanges");
            GlobalSettings.Load("options.set");

            SeriesManager.LoadSettings();
            ScriptManager.LoadSettings();

            OrderManager.Manager.Refresh("plugins\\orders");
            QuoteManager.Manager.Refresh("plugins\\quotes");
            PaintManager.Manager.Refresh("plugins\\charts");

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            frmWelcome frmWelcome = new frmWelcome();

            frmWelcome.ShowDialog();
            frmWelcome.Dispose();

            Application.Run(new frmMain());
        }
コード例 #2
0
        public async Task <bool> AutoCompleteAsync(SeriesManager manager, Series series)
        {
            var haschanged = false;

            if (series.TheTVDBId.IsNullOrWhiteSpace())
            {
                var imdbId = series.GetValidImdbId();
                var client = JryVideoCore.Current.GetTheTVDBClient();
                if (client != null && imdbId != null)
                {
                    var item = (await client.GetSeriesByImdbIdAsync(imdbId)).FirstOrDefault();
                    if (item != null)
                    {
                        series.TheTVDBId = item.SeriesId;
                        haschanged       = true;
                    }
                }
            }

            if (haschanged)
            {
                return(await manager.UpdateAsync(series));
            }
            return(false);
        }
コード例 #3
0
        /// <summary>
        /// fill fields with series saved data
        /// </summary>
        private void seriesLstBx_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (seriesLstBx.SelectedItem == null)
            {
                return;
            }
            string        selectedSeries = seriesLstBx.SelectedItem.ToString();
            SeriesManager seriesManager  = ChartManager.Inst.GetSeries(selectedSeries);

            EnableOnlyTypeFields(seriesManager.DataType);
            switch (seriesManager.DataType)
            {
            case SeriesManager.Type.INCOMING_DATA:
                seriesTypeCmBx.Text = "Data";
                nameTxt.Text        = seriesManager.NameId;
                dataIndexTxt.Text   = seriesManager.DataIndex.ToString();
                break;

            case SeriesManager.Type.SETPOINT:
                seriesTypeCmBx.Text = "Setpoint";
                nameTxt.Text        = seriesManager.NameId;
                dataIndexTxt.Text   = seriesManager.DataIndex.ToString();
                setpointTxt.Text    = seriesManager.Setpoint.ToString();
                break;

            case SeriesManager.Type.BYTES_RATE:
                seriesTypeCmBx.Text = "Bytes Rate";
                dataIndexTxt.Text   = seriesManager.DataIndex.ToString();
                break;
            }
        }
コード例 #4
0
 public IEnumerable <Serie> Get()
 {
     using (new TimeMonitor(HttpContext))
     {
         return(SeriesManager.GetSeries());
     }
 }
コード例 #5
0
        public async Task<bool> AutoCompleteAsync(SeriesManager manager, Series series)
        {
            var haschanged = false;

            if (series.TheTVDBId.IsNullOrWhiteSpace())
            {
                var imdbId = series.GetValidImdbId();
                var client = JryVideoCore.Current.GetTheTVDBClient();
                if (client != null && imdbId != null)
                {
                    var item = (await client.GetSeriesByImdbIdAsync(imdbId)).FirstOrDefault();
                    if (item != null)
                    {
                        series.TheTVDBId = item.SeriesId;
                        haschanged = true;
                    }
                }
            }

            if (haschanged)
            {
                return await manager.UpdateAsync(series);
            }
            return false;
        }
コード例 #6
0
            public async Task LoadAsync(SeriesManager manager)
            {
                var items = await this.QuerySeriesAsync(manager);

                this.HasNext = !this.IsOnlyTracking && items.Count > this.PageSize;
                if (this.HasNext)
                {
                    items.RemoveAt(items.Count - 1);
                }

                this.Items = items;
            }
コード例 #7
0
ファイル: Program.cs プロジェクト: mirror222/ZeroSystem
        static void Main()
        {
            ProductManager.Load("exchanges");
            SeriesManager.LoadSettings();
            OrderManager.Manager.Refresh("plugins\\orders");
            QuoteManager.Manager.Refresh("plugins\\quotes");
            PaintManager.Manager.Refresh("plugins\\charts");
            QuoteManager.Manager.StartQuoteService(QuoteManager.Manager.GetQuoteServiceInformations()[0]);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmChart());
        }
コード例 #8
0
        public IEnumerable <Round> Get()
        {
            using (new TimeMonitor(HttpContext))
            {
                var result = new List <Round>();
                var series = SeriesManager.GetSerieInfos();

                foreach (var item in series)
                {
                    result.AddRange(RoundManager.GetRounds(item));
                }

                return(result.OrderByDescending(x => x.RoundTime));
            }
        }
コード例 #9
0
        public async Task <Series> CommitAsync()
        {
            var series = this.GetCommitObject();

            Debug.Assert(series != null);
            if (this.Action == ObjectChangedAction.Create)
            {
                series.Version = Upgrader <Series> .MaxVersion;
            }
            this.WriteToObject(series);

            SeriesManager.BuildSeriesMetaData(series);

            return(await this.CommitAsync(this.GetManagers().SeriesManager, series));
        }
コード例 #10
0
        public Serie GetByName(string name)
        {
            using (new TimeMonitor(HttpContext))
            {
                var serieInfos = SeriesManager.GetSerieInfos();
                var serieInfo  = serieInfos.FirstOrDefault(x => x.Name == name);

                if (serieInfo != null)
                {
                    return(SeriesManager.GetSerie(serieInfo));
                }

                Response.StatusCode = 404;
                return(null);
            }
        }
コード例 #11
0
            private async Task InitializeQueryAsync(SeriesManager manager)
            {
                JasilyDebug.Pointer();
                var items = this.isOnlyTracking
                    ? await Task.Run(async() => (await manager.ListTrackingAsync()).ToList())
                    : await Task.Run(async() => (await this.BuildQueryAsync(manager)).ToList());

                JasilyDebug.Pointer();

                this.HasNext = !this.isOnlyTracking && items.Count > this.pageSize;
                if (this.HasNext)
                {
                    items.RemoveAt(items.Count - 1);
                }

                this.Items = items;
            }
コード例 #12
0
        public Round GetByName(string name)
        {
            using (new TimeMonitor(HttpContext))
            {
                var serieInfos = SeriesManager.GetSerieInfos();
                var roundInfos = RoundManager.GetRoundInformations(serieInfos);

                var roundInfo = roundInfos.FirstOrDefault(x => x.Name == name);

                if (roundInfo != null)
                {
                    return(RoundManager.GetRound(roundInfo));
                }

                Response.StatusCode = 404;
                return(null);
            }
        }
コード例 #13
0
            private async Task <List <JrySeries> > QuerySeriesAsync(SeriesManager manager)
            {
                if (this.IsOnlyTracking)
                {
                    return(await Task.Run(async() => (
                                              await manager.ListTrackingAsync()).ToList()));
                }

                if (this.SearchText.IsNullOrWhiteSpace())
                {
                    return(await Task.Run(async() => (
                                              await manager.LoadAsync(this.PageIndex * this.PageSize, this.PageSize + 1)).ToList()));
                }
                else
                {
                    return(await Task.Run(async() => (
                                              await manager.QueryAsync(this.SearchText, this.PageIndex * this.PageSize, this.PageSize + 1)).ToList()));
                }
            }
コード例 #14
0
        public IEnumerable <CtpLeaderboard> GetCtpLeaderboards()
        {
            using (new TimeMonitor(HttpContext))
            {
                var result = new List <CtpLeaderboard>();
                var series = SeriesManager.GetSeries();

                foreach (var serie in series)
                {
                    result.Add(new CtpLeaderboard
                    {
                        SerieName  = serie.Name,
                        Placements = LeaderboardManager.GetCtpLeaderboard(serie).ToList()
                    });
                }

                return(result.ToList().OrderByDescending(x => x.SerieName));
            }
        }
コード例 #15
0
        public async Task <JrySeries> CommitAsync()
        {
            var series = this.GetCommitObject().ThrowIfNull("series");

            series.Names.Clear();

            if (!String.IsNullOrWhiteSpace(this.Names))
            {
                series.Names.AddRange(
                    this.Names.AsLines()
                    .Select(z => z.Trim())
                    .Where(z => !String.IsNullOrWhiteSpace(z)));
                series.Names = series.Names.Distinct().ToList();
            }

            SeriesManager.BuildSeriesMetaData(series);

            var seriesManager = JryVideoCore.Current.CurrentDataCenter.SeriesManager;

            return(await this.CommitAsync(seriesManager, series));
        }
コード例 #16
0
        /// <summary>
        /// 새로운 창을 실행합니다.
        /// </summary>
        /// <param name="args"></param>
        static void ProcessWindow(string[] args)
        {
            switch (args[0])
            {
            case "artist_viewer":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ArtistViewerWindow avw = new ArtistViewerWindow();
                    avw.Show();
                }));
                break;

            case "test":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    TestWindow tw = new TestWindow();
                    tw.Show();
                }));
                break;

            case "finder":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    FinderWindow fw = new FinderWindow();
                    fw.Show();
                }));
                break;

            case "article_info":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ArticleInfoWindow aiw = new ArticleInfoWindow();
                    aiw.Show();
                }));
                break;

            case "patch_note":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    PatchNoteWindow pnw = new PatchNoteWindow();
                    pnw.Show();
                }));
                break;

            case "car":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    CustomArtistsRecommendWindow carw = new CustomArtistsRecommendWindow();
                    carw.Show();
                }));
                break;

            case "zip_viewer":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ZipViewer zv = new ZipViewer();
                    zv.Show();
                }));
                break;

            case "series_manager":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    SeriesManager sm = new SeriesManager();
                    sm.Show();
                }));
                break;

            case "crawler":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    MangaCrawler mc = new MangaCrawler();
                    mc.Show();
                }));
                break;

            case "zip-listing":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ZipListing zl = new ZipListing();
                    zl.Show();
                }));
                break;

            case "cc":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    CustomCrawler cc = new CustomCrawler();
                    cc.Show();
                }));
                break;

            case "editor":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ScriptEditor ed = new ScriptEditor();
                    ed.Show();
                }));
                break;

            case "elo":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    RankSimulator rs = new RankSimulator();
                    rs.Show();
                }));
                break;

            case "ft":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ForbiddenTester ft = new ForbiddenTester();
                    ft.Show();
                }));
                break;

            case "zip-artists":

                Application.Current.Dispatcher.BeginInvoke(new System.Action(
                                                               delegate
                {
                    ZipArtists za = new ZipArtists();
                    za.Show();
                }));
                break;

            default:
                Console.Instance.WriteLine($"'{args[0]}' window is not found.");
                break;
            }
        }
コード例 #17
0
            public async Task LoadAsync(SeriesManager manager)
            {
                var items = await this.QuerySeriesAsync(manager);

                this.HasNext = !this.IsOnlyTracking && items.Count > this.PageSize;
                if (this.HasNext) items.RemoveAt(items.Count - 1);

                this.Items = items;
            }
コード例 #18
0
            private async Task<List<JrySeries>> QuerySeriesAsync(SeriesManager manager)
            {
                if (this.IsOnlyTracking)
                    return await Task.Run(async () => (
                        await manager.ListTrackingAsync()).ToList());

                if (this.SearchText.IsNullOrWhiteSpace())
                    return await Task.Run(async () => (
                        await manager.LoadAsync(this.PageIndex * this.PageSize, this.PageSize + 1)).ToList());
                else
                    return await Task.Run(async () => (
                        await manager.QueryAsync(this.SearchText, this.PageIndex * this.PageSize, this.PageSize + 1)).ToList());
            }
コード例 #19
0
 private async Task <IEnumerable <Series> > BuildQueryAsync(SeriesManager manager)
 {
     this.query = manager.GetQuery(this.searchText);
     return(await this.query.StartQuery(this.pageIndex *this.pageSize, this.pageSize + 1));
 }
コード例 #20
0
 public SeriesController(SeriesManager series, IHostingEnvironment hostingEnvironment, QuestionsManager questions)
 {
     _Questions          = questions;
     _Series             = series;
     _hostingEnvironment = hostingEnvironment;
 }