Example #1
0
 public ScrollableRecentHashtagPostUc()
 {
     this.InitializeComponent();
     Loaded              += UcLoaded;
     _compositor          = ElementCompositionPreview.GetElementVisual(this).Compositor;
     _goUpButtonVisual    = GoUpButton.GetVisual();
     _refreshButtonVisual = RefreshButton.GetVisual();
     SetUpPageAnimation();
 }
Example #2
0
        public FollowRequestsView()
        {
            this.InitializeComponent();
            Current              = this;
            _compositor          = ElementCompositionPreview.GetElementVisual(this).Compositor;
            _refreshButtonVisual = RefreshButton.GetVisual();

            Loaded += FollowRequestsViewLoaded;
        }
        public CloseFriendsView()
        {
            this.InitializeComponent();

            Current              = this;
            _compositor          = ElementCompositionPreview.GetElementVisual(this).Compositor;
            _refreshButtonVisual = RefreshButton.GetVisual();
            Loaded += BlockedViewLoaded;
        }
Example #4
0
 public MainViewInboxUc()
 {
     this.InitializeComponent();
     _compositor          = ElementCompositionPreview.GetElementVisual(this).Compositor;
     _refreshButtonVisual = RefreshButton.GetVisual();
     Current          = this;
     DataContext      = InboxVM;
     Loaded          += InboxViewLoaded;
     InboxVM.Updated += InboxVM_Updated;
 }
Example #5
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            RefreshButton.SetCommand("Click", ViewModel.RefreshCommand);
            PeopleList.Adapter             = ViewModel.People.GetAdapter(GetAdapter);
            PeopleList.OnItemClickListener = this;
        }
Example #6
0
 public InboxView()
 {
     this.InitializeComponent();
     _compositor          = ElementCompositionPreview.GetElementVisual(this).Compositor;
     _refreshButtonVisual = RefreshButton.GetVisual();
     Current        = this;
     DataContext    = InboxVM;
     Loaded        += InboxViewLoaded;
     Timer.Interval = TimeSpan.FromSeconds(30);
     Timer.Tick    += TimerTick;
 }
        public RecentFollowersView()
        {
            this.InitializeComponent();
            Current              = this;
            _compositor          = ElementCompositionPreview.GetElementVisual(this).Compositor;
            _refreshButtonVisual = RefreshButton.GetVisual();

            //DataContext = RecentFollowersVM;
            //NavigationCacheMode = NavigationCacheMode.Enabled;
            Loaded += RecentFollowersViewLoaded;
        }
Example #8
0
        /// <summary>
        ///     Creates a new captcha using the specified <see cref="IBuildInfoModel" />.
        /// </summary>
        /// <param name="buildInfoModel">
        ///     The specified <see cref="IBuildInfoModel" />.
        /// </param>
        /// <returns>An instance of <see cref="ICaptcha"/>.</returns>
        public virtual ICaptcha Build(IBuildInfoModel buildInfoModel)
        {
            string        captchaFormat        = GenerateCaptchaImage(buildInfoModel);
            string        generateTokenElement = GenerateTokenElement(buildInfoModel);
            string        inputElement         = GenerateInputElement(buildInfoModel);
            RefreshButton refreshButton        = GenerateRefreshButton(buildInfoModel);
            string        markup = string.Format("{0}{1} <br/>{2}<br/>{3}<br/>{4}", captchaFormat,
                                                 generateTokenElement, refreshButton.Markup,
                                                 buildInfoModel.InputText, inputElement);

            return(new CaptchaModel(buildInfoModel, markup, refreshButton.Script));
        }
Example #9
0
        public override void LayoutChanged( )
        {
            base.LayoutChanged( );

            // get the orientation state. WE consider unknown- 1, profile 0, landscape 1,
            int orientationState = SpringboardViewController.IsDeviceLandscape( ) == true ? 1 : 0;

            // if the states are in disagreement, correct it
            if (OrientationState != orientationState)
            {
                OrientationState = orientationState;

                // get the offset scrolled before changing our frame (which will cause us to lose it)
                nfloat scrollOffsetPercent = UIScrollView.ContentOffset.Y / ( nfloat )Math.Max(1, UIScrollView.ContentSize.Height);

                //note: the frame height of the nav bar is what it CURRENTLY is, not what it WILL be after we rotate. So, when we go from Portrait to Landscape,
                // it says 40, but it's gonna be 32. Conversely, going back, we use 32 and it's actually 40, which causes us to start this view 8px too high.
                if (MobileApp.Shared.Network.RockLaunchData.Instance.Data.DeveloperModeEnabled == true)
                {
                    // add the refresh button if necessary
                    if (RefreshButton.Superview == null)
                    {
                        View.AddSubview(RefreshButton);
                    }

                    RefreshButton.Layer.Position = new CGPoint(View.Bounds.Width / 2, (RefreshButton.Frame.Height / 2));

                    UIScrollView.Frame          = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height - RefreshButton.Frame.Height);
                    UIScrollView.Layer.Position = new CGPoint(UIScrollView.Layer.Position.X, UIScrollView.Layer.Position.Y + RefreshButton.Frame.Bottom);
                }
                else
                {
                    // remove the refresh button if necessary
                    if (RefreshButton.Superview != null)
                    {
                        RefreshButton.RemoveFromSuperview( );
                    }

                    UIScrollView.Frame          = new CGRect(0, 0, View.Bounds.Width, View.Bounds.Height);
                    UIScrollView.Layer.Position = new CGPoint(UIScrollView.Layer.Position.X, UIScrollView.Layer.Position.Y);
                }

                Indicator.Layer.Position = new CGPoint(View.Bounds.Width / 2, View.Bounds.Height / 2);

                // re-create our notes with the new dimensions
                PrepareCreateNotes(scrollOffsetPercent, false);

                // since we're changing orientations, hide the tutorial screen
                AnimateTutorialScreen(false);

                ResultView.SetBounds(View.Bounds.ToRectF( ));
            }
        }
Example #10
0
        public HashtagView()
        {
            InitializeComponent();
            Current     = this;
            _compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;

            _elementImplicitAnimation = _compositor.CreateImplicitAnimationCollection();

            _refreshButtonVisual = RefreshButton.GetVisual();
            _goUpButtonVisual    = GoUpButton.GetVisual();
            _elementImplicitAnimation["Opacity"] = CreateOpacityAnimation();
            Loaded += HashtagViewLoaded;
        }
Example #11
0
        public void Click_To_Button(ButtonName _buttonName)
        {
            switch (_buttonName.ToString())
            {
            case "Refresh":
                RefreshButton.Click();
                break;

            case "Login":
                LoginButton.Click();
                break;
            }
        }
Example #12
0
        public ArchiveView()
        {
            this.InitializeComponent();
            Current = this;

            _compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;

            _elementImplicitAnimation = _compositor.CreateImplicitAnimationCollection();

            _elementImplicitAnimation["Opacity"] = CreateOpacityAnimation();
            _refreshButtonVisual = RefreshButton.GetVisual();

            Loaded += SavedPostsViewLoaded;
        }
Example #13
0
        public LikedPostView()
        {
            this.InitializeComponent();
            Current     = this;
            _compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;

            _elementImplicitAnimation = _compositor.CreateImplicitAnimationCollection();

            //_elementImplicitAnimation["Offset"] = CreateOffsetAnimation();
            _elementImplicitAnimation["Opacity"] = CreateOpacityAnimation();
            _refreshButtonVisual = RefreshButton.GetVisual();

            //_headerGridVisual = HeaderGrid.GetVisual();
            Loaded += LikedPostViewLoaded;
        }
Example #14
0
 private async Task BlackButtons()
 {
     MenuButton.ImageSource("menu.png");
     MenuButton.RippleColor(Colors.Black);
     Back.ImageSource("back.png");
     Back.RippleColor(Colors.Black);
     Forward.ImageSource("forward.png");
     Forward.RippleColor(Colors.Black);
     RefreshButton.ImageSource("reload.png");
     RefreshButton.RippleColor(Colors.Black);
     BookmarkButton.ImageSource("bookmark.png");
     BookmarkButton.RippleColor(Colors.Black);
     StopButton = "stop.png";
     mainWindow.TabBar.getTabFromForm(this).CloseTab.ImageSource("close_Tab.png");
 }
Example #15
0
        /// <summary>
        ///     Creates a new captcha using the specified <see cref="IBuildInfoModel" />.
        /// </summary>
        /// <param name="buildInfoModel">
        ///     The specified <see cref="IBuildInfoModel" />.
        /// </param>
        /// <returns>An instance of <see cref="ICaptcha"/>.</returns>
        public virtual ICaptcha Build(IBuildInfoModel buildInfoModel)
        {
            RefreshButton captchaFormat        = GenerateCaptchaImage(buildInfoModel);
            string        generateTokenElement = GenerateTokenElement(buildInfoModel);
            string        inputElement         = GenerateInputElement(buildInfoModel);
            //  RefreshButton refreshButton = GenerateRefreshButton(buildInfoModel);
            //string markup = string.Format("{0}{1} <br/>{2}<br/>{3}<br/>{4}", captchaFormat,
            //                              generateTokenElement, refreshButton.Markup,
            //                              buildInfoModel.InputText, inputElement);
            string markup = string.Format("<div class=\"row\"><div class=\"col-md-6\">{4}</div><div class=\"col-md-6\">{0}{1}{2}{3}</div></div>", captchaFormat.Markup,
                                          generateTokenElement, "",
                                          buildInfoModel.InputText, inputElement);

            return(new CaptchaModel(buildInfoModel, markup, captchaFormat.Script));
        }
Example #16
0
        public ProfileDetailsView()
        {
            this.InitializeComponent();
            Current     = this;
            _compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;

            _elementImplicitAnimation = _compositor.CreateImplicitAnimationCollection();

            _elementImplicitAnimation["Opacity"] = CreateOpacityAnimation();

            _goUpButtonVisual    = GoUpButton.GetVisual();
            _refreshButtonVisual = RefreshButton.GetVisual();
            Loaded += ProfileDetailsViewLoaded;
            EditProfileUc.OnCompleted += EditProfileUc_OnCompleted;
        }
Example #17
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            SetContentView(Resource.Layout.Main);

            RefreshButton.SetCommand(
                "Click",
                Vm.RefreshCommand);

            _lastLoadedBinding = this.SetBinding(
                () => Vm.LastLoadedFormatted,
                () => LastLoadedText.Text);

            FlowersList.Adapter             = Vm.Flowers.GetAdapter(GetFlowerAdapter);
            FlowersList.OnItemClickListener = this;
        }
Example #18
0
 private async void WebView_FrameLoadStart(object sender, FrameLoadStartEventArgs e)
 {
     await Dispatcher.BeginInvoke((Action)(() =>
     {
         try
         {
             RefreshButton.ImageSource(StopButton);
             refreshing = true;
             startPage.Visibility = Visibility.Hidden;
         }
         catch (Exception ex)
         {
             Console.WriteLine("WebView framestart error: " + ex.Message + " " + ex.Data);
         }
     }));
 }
Example #19
0
        public StatusForm(string header, string summary, bool isPlaying)
        {
            InitializeComponent();

            this.Text = header;

            SummaryLabel.Text = summary;

            if (isPlaying == true)
            {
                ResumeButton.Hide();
            }
            else
            {
                RefreshButton.Hide();
            }
        }
Example #20
0
 public void JoinRoom(MatchInfoSnapshot _match)
 {
     if (!HostGame.creatingRoom && !JoiningGame)
     {
         JoiningGame = true;
         HostButton.SetActive(false);
         NicknameText.SetActive(false);
         RoomNameText.SetActive(false);
         RefreshButton.SetActive(false);
         Status.text = "Joining...";
         networkManager.matchMaker.JoinMatch(_match.networkId, "", "", "", 0, 0, networkManager.OnMatchJoined);
         ClearRoomList();
     }
     else
     {
         Status.text = "Wait for the room to be created";
     }
 }
Example #21
0
 private void UnHideMainComp()
 {
     dataGridView1.Show();
     LoggedInfLabel.Show();
     LoggedEmailInf.Show();
     LogoutButton.Show();
     UpdateLabel.Show();
     SubjectLabel.Show();
     SubjectTextB.Show();
     RecipientLabel.Show();
     RecipientTextBox.Show();
     BodyLabel.Show();
     BodyTextBox.Show();
     SendButton.Show();
     MailSaveButton.Show();
     DeserializeButton.Show();
     RefreshButton.Show();
 }
Example #22
0
        void ReleaseDesignerOutlets()
        {
            if (DarkModeButton != null)
            {
                DarkModeButton.Dispose();
                DarkModeButton = null;
            }

            if (MainToolbar != null)
            {
                MainToolbar.Dispose();
                MainToolbar = null;
            }

            if (PagePopUpButton != null)
            {
                PagePopUpButton.Dispose();
                PagePopUpButton = null;
            }

            if (RefreshButton != null)
            {
                RefreshButton.Dispose();
                RefreshButton = null;
            }

            if (ToolbarSpinner != null)
            {
                ToolbarSpinner.Dispose();
                ToolbarSpinner = null;
            }

            if (Spinner != null)
            {
                Spinner.Dispose();
                Spinner = null;
            }

            if (TitleTextField != null)
            {
                TitleTextField.Dispose();
                TitleTextField = null;
            }
        }
Example #23
0
        public ExploreView()
        {
            this.InitializeComponent();
            Current = this;
            //DataContext = ExploreVM;

            //NavigationCacheMode = NavigationCacheMode.Enabled;

            _compositor = ElementCompositionPreview.GetElementVisual(this).Compositor;

            _elementImplicitAnimation = _compositor.CreateImplicitAnimationCollection();

            //_elementImplicitAnimation["Offset"] = CreateOffsetAnimation();
            _elementImplicitAnimation["Opacity"] = CreateOpacityAnimation();
            _refreshButtonVisual = RefreshButton.GetVisual();

            //_headerGridVisual = HeaderGrid.GetVisual();
            Loaded += ExploreViewLoaded;
        }
Example #24
0
        private void ContentPivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (ContentPivot.SelectedIndex)
            {
            case 0:
                RefreshButton.SetBinding(ButtonBase.CommandProperty,
                                         new Binding {
                    Path = new PropertyPath("Refresh")
                });
                break;

            case 1:
                RefreshButton.SetBinding(ButtonBase.CommandProperty,
                                         new Binding {
                    Path = new PropertyPath("RefreshAlbums")
                });
                break;
            }
        }
Example #25
0
 private void DisconnectButton_Click(object sender, EventArgs e)
 {
     try
     {
         connectSp = false;
         sp.Close();
         ConnectButton.Show();
         DisconnectButton.Hide();
         RefreshButton.Show();
     }
     catch (System.Exception ex)
     {
         connectSp = true;
         MessageBox.Show("faild to close serial port");
         ConnectButton.Hide();
         DisconnectButton.Show();
         RefreshButton.Hide();
     }
 }
        private void addToolStripMenuItem_Click(object sender, EventArgs e)
        {
            addToolStripMenuItem.Enabled     = false;
            exitAddToolStripMenuItem.Enabled = true;

            this.Height = 600;
            StudentGridView.Hide();
            SearchButton.Hide();
            StudentSearctBox.Hide(); label10.Hide();
            StudentAddForm.Show();
            StudentDeleteButton.Hide();
            label11.Hide();
            label12.Hide();
            FirstPageButton.Hide();
            NextPageButton.Hide();
            PreviousButton.Hide();
            LastPageButton.Hide();
            RefreshButton.Hide();
        }
        public override void ViewDidLoad()
        {
            try
            {
                #region Hidden

                // See https://developer.xamarin.com/guides/android/advanced_topics/linking/#falseflag

                var falseFlag = false;

                // ReSharper disable once ConditionIsAlwaysTrueOrFalse
                if (falseFlag)
                // ReSharper disable HeuristicUnreachableCode
                {
                    RefreshButton.Clicked += (s, e) => { };
                }
                // ReSharper restore HeuristicUnreachableCode

                #endregion

                _bindings.Add(this.SetBinding(
                                  () => Vm.LastLoadedFormatted,
                                  () => LastLoadedText.Text));

                RefreshButton.SetCommand(Vm.RefreshCommand);

                _source = Vm.Flowers.GetTableViewSource(
                    BindFlowerCell,
                    ReuseId);

                FlowersTableView.RegisterClassForCellReuse(typeof(UITableViewCell), new NSString(ReuseId));
                FlowersTableView.Source = _source;

                _source.SelectionChanged +=
                    (s, e) => Vm.ShowDetailsCommand.Execute(_source.SelectedItem);

                base.ViewDidLoad();
            }
            catch (Exception ex)
            {
            }
        }
Example #28
0
        private void ChangeLocationButton_Click(object sender, EventArgs e)
        {
            float  lat     = float.Parse(LatitudeTextBox.Text, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat);
            float  lon     = float.Parse(LongitudeTextBox.Text, NumberStyles.Float, CultureInfo.InvariantCulture.NumberFormat);
            string message = "";

            if (lat >= -90 && lat <= 90 && lon >= -180 && lon <= 180)
            {
                int r = tinderAPI.changeLocation(LatitudeTextBox.Text, LongitudeTextBox.Text);

                switch (r)
                {
                case 0:
                    message = "Empty response";
                    break;

                case 1:
                    RefreshButton.PerformClick();
                    message = "Location changed";
                    break;

                case 2:
                    message = "Request error";
                    break;

                case 3:
                    message = "Request status not 200";
                    break;

                case 4:
                    message = "Location change not accepted";
                    break;

                default:
                    message = "What's going on";
                    break;
                }
                LocalStatusLabel.Text = message;
            }
            LatitudeTextBox.Text  = "Latitude";
            LongitudeTextBox.Text = "Longitude";
        }
        void ReleaseDesignerOutlets()
        {
            if (RefreshButton != null)
            {
                RefreshButton.Dispose();
                RefreshButton = null;
            }

            if (TimelineTableView != null)
            {
                TimelineTableView.Dispose();
                TimelineTableView = null;
            }

            if (WelcomeText != null)
            {
                WelcomeText.Dispose();
                WelcomeText = null;
            }
        }
Example #30
0
        void ReleaseDesignerOutlets()
        {
            if (RefreshButton != null)
            {
                RefreshButton.Dispose();
                RefreshButton = null;
            }

            if (ShutDownButton != null)
            {
                ShutDownButton.Dispose();
                ShutDownButton = null;
            }

            if (ApplicationsView != null)
            {
                ApplicationsView.Dispose();
                ApplicationsView = null;
            }
        }
Example #31
0
        /// <summary>
        /// 如果線程都結束就讓BUTTON生效
        /// </summary>
        private void EnableButton()
        {
            if (this.butOntime.InvokeRequired)
            {
                RefreshButton myUI = new RefreshButton(EnableButton);
                this.butOntime.Invoke(myUI);
            }
            else
            {
                ThreadCount--;
                //都結束了
                if (ThreadCount <= 0)
                {
                    #region 備份后刪除操作過的文件
                    CMDCommad Cmd = new CMDCommad();
                    for (int j = 0; j < FileList.Items.Count; j++)
                    {
                        try
                        {
                            if (File.Exists(FileList.Items[j].ToString()))
                            {
                                #region 備份操作過的文件
                                try
                                {
                                    FileInfo fi = new FileInfo(FileList.Items[j].ToString());
                                    string sfile = fi.Name;
                                    string sPath = "FileCenterBackup\\" + FileList.Items[j].ToString().Replace("\\" + sfile, "");
                                    if (Cmd.CreateDir(sPath))
                                    {
                                        File.Copy(FileList.Items[j].ToString(), sPath + "\\" + sfile, true);
                                        //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "備份文件" + FileList.Items[j].ToString() + "成功!", "Y");
                                    }
                                    else
                                    {
                                        //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "備份文件" + FileList.Items[j].ToString() + "失敗!", "Y");
                                    }
                                    //RowNum = RowNum + 1;
                                }
                                catch
                                {

                                }
                                #endregion
                                File.Delete(FileList.Items[j].ToString());
                            }
                        }
                        catch
                        {
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "刪除文件" + FileList.Items[j].ToString() + "失敗!", "N");
                        }
                    }
                    #endregion

                    #region 刷新列表
                    FileList.Items.Clear();
                    GetFile(FilePath);
                    #endregion

                    this.butOntime.Enabled = true;
                    this.butQuit.Enabled = true;
                    this.butRefersh.Enabled = true;
                }
            }
        }
Example #32
0
        /// <summary>
        /// 子線程更新文件
        /// </summary>
        /// <param name="GroupNo">進程號</param>
        private void RunSendFileByThread(object tbGroup)
        {
            DataTable dtList = (DataTable)tbGroup;

            RefreshUI UI = new RefreshUI(ShowProgress); //創建委託實例
            RefreshView UI_View = new RefreshView(UpdateDone); //創建委託實例
            RefreshButton UI_Button = new RefreshButton(EnableButton);

            //開始遠程拷貝程式
            //多臺ap
            CMDCommad Cmd = new CMDCommad();
            XMLReadWrite xml = new XMLReadWrite();
            int RowNum = 0;

            try
            {
                foreach (DataRow _dr in dtList.Rows)
                {
                    string RemoteHost = _dr["ap_name"].ToString();
                    string UserName = _dr["user_name"].ToString();
                    string PassWord = _dr["pwd"].ToString();
                    string RootPath = _dr["root"].ToString();
                    string AllPath = "\\\\" + RemoteHost + "\\" + _dr["ap_dir"].ToString().Trim().Replace(":", "$") + "\\" + RootPath;
                    string curPath = "";
                    if (FileList.Items.Count != 0)
                    {
                        #region 傳送文件

                        this.BeginInvoke(UI_View, new object[] { _dr["ap_seq"].ToString(), "0" });

                        if (Cmd.Connect(RemoteHost, UserName, PassWord))
                        {
                            this.BeginInvoke(UI_View, new object[] { _dr["ap_seq"].ToString(), "1" });

                            for (int j = 0; j < FileList.Items.Count; j++)
                            {
                                FileInfo fi = new FileInfo(FileList.Items[j].ToString());
                                curPath = AllPath;
                                // 取出子目錄
                                if (fi.DirectoryName.Length > fi.DirectoryName.LastIndexOf(FilePath) + FilePath.Length)
                                    curPath = AllPath + "\\" + fi.DirectoryName.Substring(fi.DirectoryName.LastIndexOf(FilePath) + FilePath.Length + 1, fi.DirectoryName.Length - (fi.DirectoryName.LastIndexOf(FilePath) + FilePath.Length + 1));
                                //創建目錄
                                if (Cmd.CreateDir(curPath))
                                {
                                    //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "檢查或創建" + AllPath + "目錄成功!", "Y");
                                }
                                else
                                {
                                    //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "檢查或創建" + AllPath + "目錄失敗!", "N");
                                    continue;
                                }
                                RowNum = RowNum + 1;
                                //開始拷貝文件
                                try
                                {
                                    File.Copy(FileList.Items[j].ToString(), curPath + "\\" + fi.Name, true);
                                    //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 成功!", "Y");
                                }
                                catch(Exception ex)
                                {
                                    WriteLog("RunSendFileByThread", "複製文件:" + FileList.Items[j].ToString() + "到" + curPath + "\\" + fi.Name + "時出錯:" + (ex != null ? ex.Message : ""));
                                    //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 失敗!", "N");
                                    continue;
                                }
                                RowNum = RowNum + 1;
                                this.BeginInvoke(UI);//UI線程上異步調用委託
                                //this.BeginInvoke(new ThreadStart(UI));
                            }
                        }
                        else
                        {
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "聯接" + RemoteHost + " AP失敗!", "N");
                            RowNum = RowNum + 1;
                            continue;
                        }
                        #endregion
                    }

                    if (ConfigFiles.Count != 0)
                    {
                        #region "生成配置文件"
                        //ToDoManager.Launcher.exe.config -> [WCF-IP] [LX-IP] [UP-MODE] [AT-MODE] [AD-MODE]
                        //Update.xml -> [UP-IP]
                        //Manifest.ini -> [ROOTDIR] [VERKEY]

                        // 產生當前服務器文件夾
                        string cfPath = ConfigPath + "\\" + _dr["ap_seq"].ToString();
                        if (!Directory.Exists(cfPath))
                        {
                            Directory.CreateDirectory(cfPath);
                        }

                        string cfile = "";

                        #region " 1.處理ToDoManager.Launcher.exe.config "

                        cfile = ConfigFiles.Find(f => f.IndexOf("ToDoManager.Launcher.exe.config") > -1);
                        FileInfo fi = new FileInfo(cfile);
                        //複製到服務器文件夾
                        File.Copy(fi.FullName, cfPath + "\\tmp.config", true);
                        //替換參數
                        string FileContext = "";
                        using (StreamReader reader = new StreamReader(cfPath + "\\tmp.config", Encoding.UTF8))
                        {
                            //[WCF-IP] [LX-IP] [UP-MODE] [AT-MODE] [AD-MODE]
                            FileContext = reader.ReadToEnd();
                            FileContext = FileContext.Replace("[WCF-IP]", _dr["wcf_ip"].ToString());
                            FileContext = FileContext.Replace("[LX-IP]", _dr["lx_ip"].ToString());
                            FileContext = FileContext.Replace("[UP-MODE]", _dr["update_mode"].ToString());
                            FileContext = FileContext.Replace("[AT-MODE]", _dr["attach_mode"].ToString());
                            FileContext = FileContext.Replace("[AD-MODE]", _dr["addin_mode"].ToString());
                        }
                        using (StreamWriter writer = new StreamWriter(cfPath + "\\" + fi.Name, false, Encoding.UTF8))
                        {
                            writer.Write(FileContext);
                            writer.Flush();
                        }
                        //複製到目標
                        //開始拷貝文件
                        try
                        {
                            File.Copy(fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name, AllPath + "\\" + fi.Name, true);
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 成功!", "Y");
                        }
                        catch(Exception ex)
                        {
                            WriteLog("RunSendFileByThread", "複製文件:" + fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name + "到" + AllPath + "\\" + fi.Name + "時出錯:" + (ex != null ? ex.Message : ""));
                        }

                        #endregion

                        #region " 2.處理Update.xml "

                        cfile = ConfigFiles.Find(f => f.IndexOf("Update.xml") > -1);
                        fi = new FileInfo(cfile);
                        //複製到服務器文件夾
                        File.Copy(fi.FullName, cfPath + "\\tmp.xml", true);
                        //替換參數
                        FileContext = "";
                        using (StreamReader reader = new StreamReader(cfPath + "\\tmp.xml", Encoding.UTF8))
                        {
                            //[UP-IP]
                            FileContext = reader.ReadToEnd();
                            FileContext = FileContext.Replace("[UP-IP]", _dr["upsrv_ip"].ToString());
                        }
                        using (StreamWriter writer = new StreamWriter(cfPath + "\\" + fi.Name, false, Encoding.UTF8))
                        {
                            writer.Write(FileContext);
                            writer.Flush();
                        }
                        //複製到目標
                        //開始拷貝文件
                        try
                        {
                            File.Copy(fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name, AllPath + "\\" + fi.Name, true);
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 成功!", "Y");
                        }
                        catch (Exception ex)
                        {
                            WriteLog("RunSendFileByThread", "複製文件:" + fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name + "到" + AllPath + "\\" + fi.Name + "時出錯:" + (ex != null ? ex.Message : ""));
                        }

                        #endregion

                        #region " 3.處理Manifest.ini "

                        cfile = ConfigFiles.Find(f => f.IndexOf("Manifest.ini") > -1);
                        fi = new FileInfo(cfile);
                        //複製到服務器文件夾
                        string m_path = System.IO.Path.Combine(cfPath, fi.Name);
                        File.Copy(fi.FullName, m_path, true);
                        NativeMethods.WritePrivateProfileString("UpdateRootPath", "VALUE", _dr["root"].ToString() + "/", m_path);
                        NativeMethods.WritePrivateProfileString("GUID", "VALUE", VerKey, m_path);

                        ////替換參數
                        //FileContext = "";
                        //using (StreamReader reader = new StreamReader(cfPath + "\\tmp.ini", Encoding.UTF8))
                        //{
                        //    //[ROOTDIR] [VERKEY]
                        //    FileContext = reader.ReadToEnd();
                        //    FileContext = FileContext.Replace("[ROOTDIR]", _dr["root"].ToString());
                        //    FileContext = FileContext.Replace("[VERKEY]", VerKey);
                        //}
                        //using (StreamWriter writer = new StreamWriter(cfPath + "\\" + fi.Name, false, Encoding.UTF8))
                        //{
                        //    writer.Write(FileContext);
                        //    writer.Flush();
                        //}
                        //複製到目標
                        //開始拷貝文件
                        try
                        {
                            File.Copy(fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name, AllPath + "\\" + fi.Name, true);
                            //xml.WriteXmlRow(LogFile, "Row" + RowNum.ToString().Trim() + string.Format("{0:HHmmssms}", DateTime.Now), "Copy File " + FileList.Items[j].ToString() + " -- " + AllPath + " 成功!", "Y");
                        }
                        catch (Exception ex)
                        {
                            WriteLog("RunSendFileByThread", "複製文件:" + fi.DirectoryName + "\\" + _dr["ap_seq"].ToString() + "\\" + fi.Name + "到" + AllPath + "\\" + fi.Name + "時出錯:" + (ex != null ? ex.Message : ""));
                        }

                        #endregion

                        #endregion
                    }

                    this.BeginInvoke(UI_View, new object[] { _dr["ap_seq"].ToString(), "2" });
                }
            }
            catch (Exception ex)
            {
                WriteLog("RunSendFileByThread", "出錯了:" + (ex != null ? ex.Message : ""));
            }
            finally
            {
                // 通知主線程,當前子線程結束
                this.BeginInvoke(UI_Button);

                UI = null;
                UI_View = null;
                UI_Button = null;
            }
        }