public JsonController()
 {
     Result              = new Result();
     countryUtil         = new CountryUtil();
     stateUtil           = new StateUtil();
     areaUtil            = new AreaUtil();
     userUtil            = new UserUtil();
     subareaUtil         = new SubAreaUtil();
     appointmentTypeUtil = new AppointmentTypeUtil();
     currencyUtil        = new CurrencyUtil();
     dateFormatUtil      = new DateFormatUtil();
     languageUtil        = new LanguageUtil();
     religionUtil        = new ReligionUtil();
     durationDaysUtil    = new DurationDaysUtil();
     sourceUtil          = new SourceUtil();
     packageUtil         = new PackageUtil();
     cityUtil            = new CityUtil();
     //scoreColumnUtil = new ScoreColumnUtil();
     nationalityUtil = new NationalityUtil();
     timeFormatUtil  = new TimeFormatUtil();
     industryUtil    = new IndustryUtil();
     paymentModeUtil = new PaymentModeUtil();
     applicationTemplatePlaceHolderUtil = new ApplicationTemplatePlaceHolderUtil();
     jobTypeUtill        = new JobTypeUtill();
     jobStatusUtill      = new JobStatusUtill();
     packageTypeUtill    = new PackageTypeUtill();
     paperTypeUtill      = new PaperTypeUtill();
     paperSubTypeUtill   = new PaperSubTypeUtill();
     paymentStatusUtill  = new PaymentStatusUtill();
     currencyUtil        = new CurrencyUtil();
     leminationTypeUtill = new LeminationTypeUtill();
 }
 private static void saveAsTXT(StreamWriter streamWriter, Video video, Subtitle subtitle)
 {
     foreach (var item in subtitle.Items)
     {
         streamWriter.WriteLine("[{0}] {1}", TimeFormatUtil.GetHHMMSSOrMMSS(item.StartSeconds, item.IsOneHourExcessed), item.Text);
     }
 }
Beispiel #3
0
        protected override void onDispose()
        {
            base.onDispose();
            handler.PostDelayed(new Runnable(() =>
            {
                ThreadProxy.getInstance().execute(new Runnable(() =>
                {
                    if (session.receiveByteNum == 0 && session.bytesSent == 0)
                    {
                        return;
                    }

                    string configFileDir = $"{VPNConstants.CONFIG_DIR}{TimeFormatUtil.formatYYMMDDHHMMSS(session.vpnStartTime)}";
                    var parentFile       = new File(configFileDir);

                    if (!parentFile.Exists())
                    {
                        parentFile.Mkdirs();
                    }

                    var file = new File(parentFile, session.getUniqueName());

                    if (file.Exists())
                    {
                        return;
                    }

                    ACache configACache = ACache.get(parentFile);

                    configACache.put(session.getUniqueName(), session);
                }));
            }), 1000);
        }
        public MastersController()
        {
            result              = new Result();
            countryUtil         = new CountryUtil();
            stateUtil           = new StateUtil();
            cityUtil            = new CityUtil();
            areaUtil            = new AreaUtil();
            subareaUtil         = new SubAreaUtil();
            appointmentTypeUtil = new AppointmentTypeUtil();
            currencyUtil        = new CurrencyUtil();
            dateFormatUtil      = new DateFormatUtil();
            documentTypeUtil    = new DocumentTypeUtil();
            languageUtil        = new LanguageUtil();
            religionUtil        = new ReligionUtil();
            nationalityUtil     = new NationalityUtil();
            sourceUtil          = new SourceUtil();
            durationDaysUtil    = new DurationDaysUtil();
            packageUtil         = new PackageUtil();

            // scoreColumnUtil = new ScoreColumnUtil();
            timeFormatUtil  = new TimeFormatUtil();
            industryUtil    = new IndustryUtil();
            paymentModeUtil = new PaymentModeUtil();
            applicationTemplatePlaceHolderUtil = new ApplicationTemplatePlaceHolderUtil();
        }
 public override object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
 {
     if (values == null || !(values[0] is bool) || !(values[1] is double))
     {
         return(TimeFormatUtil.INVALID_HHMMSS);
     }
     return(TimeFormatUtil.GetHHMMSSOrMMSS((double)values[1], (bool)values[0]));
 }
 public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value == null)
     {
         return(TimeFormatUtil.INVALID_HHMMSS);
     }
     return(TimeFormatUtil.GetHHMMSSOrMMSSPrecision((double)value, true));
 }
        private static void saveAsSRT(StreamWriter streamWriter, Video video, Subtitle subtitle)
        {
            for (int i = 0; i < subtitle.Items.Count; i++)
            {
                var item = subtitle.Items[i];

                streamWriter.WriteLine(i);
                streamWriter.WriteLine("{0} --> {1}",
                                       TimeFormatUtil.GetHHMMSSOrMMSSPrecision(item.StartSeconds, item.IsOneHourExcessed),
                                       TimeFormatUtil.GetHHMMSSOrMMSSPrecision(item.StartSeconds + item.DurationSeconds, item.IsOneHourExcessed));
                streamWriter.WriteLine(subtitle.Items[i].Text);
                streamWriter.WriteLine();
            }
        }
Beispiel #8
0
        public RemoteTcpTunnel(InetSocketAddress serverAddress, Selector selector, short portKey, Context context) : base(serverAddress, selector, portKey)
        {
            this.context = context;
            session      = NatSessionManager.getSession(portKey);
            string helperDir = new StringBuilder()
                               .Append(VPNConstants.DATA_DIR)
                               .Append(TimeFormatUtil.formatYYMMDDHHMMSS(session.vpnStartTime))
                               .Append("/")
                               .Append(session.getUniqueName())
                               .ToString();

            helper  = new TcpDataSaveHelper(helperDir, context);
            handler = new Handler(Looper.MainLooper);
        }
        private static void saveAsHTML(StreamWriter streamWriter, Video video, Subtitle subtitle)
        {
            streamWriter.WriteLine("<!DOCTYPE HTML>");
            streamWriter.WriteLine("<HTML>");
            streamWriter.WriteLine("<HEAD>");
            streamWriter.WriteLine("<TITLE>" + video.Title + "</TITLE>");
            streamWriter.WriteLine("</HEAD>");
            streamWriter.WriteLine("<BODY>");

            foreach (var item in subtitle.Items)
            {
                streamWriter.WriteLine("<P>[{0}] {1}</P>",
                                       TimeFormatUtil.GetHHMMSSOrMMSS(item.StartSeconds, item.IsOneHourExcessed),
                                       item.Text);
                streamWriter.WriteLine("\r\n");
            }

            streamWriter.WriteLine("</BODY>");
            streamWriter.WriteLine("</HTML>");
        }
        public void Execute(object parameter)
        {
            IEnumerable enumerable = parameter as IEnumerable;

            if (enumerable != null)
            {
                var subtitleItems = enumerable.OfType <SubtitleItem>().OrderBy(s => s.StartSeconds).ToList();

                var sb = new StringBuilder();
                foreach (var item in subtitleItems)
                {
                    sb.Append(TimeFormatUtil.GetHHMMSSOrMMSS(item.StartSeconds, item.IsOneHourExcessed));
                    sb.Append(' ');
                    sb.Append(item.Text);
                    sb.Append(Environment.NewLine);
                    sb.Append(Environment.NewLine);
                }
                sb.Length -= Environment.NewLine.Length;

                Clipboard.SetText(sb.ToString());
            }
        }
Beispiel #11
0
        public async void Execute(object parameter)
        {
            var item = parameter as BookmarkItem;

            if (item == null)
            {
                return;
            }

            var msg = new RemoveBookmarkDialog();

            msg.Title = item.Memo;
            if (msg.Title.Length > 10)
            {
                msg.Title = item.Memo.Substring(0, 10) + "...";
            }
            msg.Message = string.Format("시간: {0}\n\n이 북마크를 삭제합니까?", TimeFormatUtil.GetHHMMSSOrMMSSPrecision(item.Seconds, true));

            if ((bool)await DialogHost.Show(msg, "BookmarkDialog"))
            {
                MainWindowViewModel.TargetVideo.BookmarkTray.RemoveItem(item);
            }
        }