public static SelectList GetSelectList(this DeleteOption deleteOption)
        {
            var options = deleteOption.GetOptions();

            options.Remove(((int)DeleteOption.AskUser).ToString());

            return(new SelectList(options, "Key", "Value", (int)deleteOption));
        }
示例#2
0
 public void CleanUpFilesAndFolders(DeleteOption deleteOption, string currentDirectory)
 {
     if (deleteOption == DeleteOption.No)
     {
         return;
     }
     RemoveCreatedFolderAndContents(currentDirectory);
 }
示例#3
0
        public IActionResult Delete(DeleteOption option)
        {
            var filePath = Path.Combine(Environment.CurrentDirectory, option.ToString());

            foreach (FileInfo file in new DirectoryInfo(filePath).GetFiles())
            {
                file.Delete();
            }
            return(Ok());
        }
示例#4
0
        public static void CardDelete(long id, YgoPath ygopath, DeleteOption option)
        {
            string[] files    = ygopath.GetCardfiles(id);
            string[] bakfiles = ygopath.GetCardfiles(id, true);
            switch (option)
            {
            case DeleteOption.BACKUP:
                for (int i = 0; i < files.Length; i++)
                {
                    if (File.Exists(bakfiles[i]))
                    {
                        File.Delete(bakfiles[i]);
                    }
                    if (File.Exists(files[i]))
                    {
                        File.Move(files[i], files[i] + ".bak");
                    }
                }
                break;

            case DeleteOption.RESTORE:
                for (int i = 0; i < bakfiles.Length; i++)
                {
                    if (File.Exists(files[i]))
                    {
                        File.Delete(files[i]);
                    }
                    if (File.Exists(bakfiles[i]))
                    {
                        File.Move(bakfiles[i], bakfiles[i].Replace("bak", ""));
                    }
                }
                break;

            case DeleteOption.CLEAN:
                for (int i = 0; i < bakfiles.Length; i++)
                {
                    if (File.Exists(bakfiles[i]))
                    {
                        File.Delete(bakfiles[i]);
                    }
                }
                break;

            case DeleteOption.NONE:
                for (int i = 0; i < files.Length; i++)
                {
                    if (File.Exists(files[i]))
                    {
                        File.Delete(files[i]);
                    }
                }
                break;
            }
        }
示例#5
0
        public void DeleteSelectionRecords(int selectionId, string token)
        {
            DeleteOption option = new DeleteOption();

            option.Action = DeleteAction.Delete;
            DeleteOption[] options = new DeleteOption[]
            {
                option
            };

            VoidCall(token, platformClient => platformClient.DeleteSelectionRecords(selectionId, options));
        }
示例#6
0
        public DeleteResponse Delete(ByteSequence key, DeleteOption option)
        {
            Etcdserverpb.DeleteRangeRequest request = new Etcdserverpb.DeleteRangeRequest();
            request.Key      = key.GetByteString();
            request.PrevKv   = option.IsPrevKV;
            request.RangeEnd = option.EndKey.GetByteString();
            var            rsp      = kVClient.DeleteRange(request);
            DeleteResponse response = new DeleteResponse(rsp);

            return(response);
            //return Util.ToCompletableFutureWithRetry(
            //    stub.DeleteRange(request),
            //   new FunctionResponse<Etcdserverpb.DeleteRangeRequest, DeleteResponse>()
            //);
        }
示例#7
0
文件: OwnerProperty.cs 项目: hnlord/A
        //Delete a property
        internal void DeleteAProperty()
        {
            try
            {
                //Calling the common methods
                Common_methods();

                //property name before delete
                string PropertyName_BeforeDelete = Driver.driver.FindElement(By.XPath("//*[@id='main-content']/section/div[1]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/a/h3")).Text;

                //Click on the right side menu of the first property
                RightSideMenu.Click();
                Thread.Sleep(1000);

                //Click on the "Delete" option
                DeleteOption.Click();
                Thread.Sleep(1000);

                //Click on the "Confirm" button on RemoveProperty page
                // Create an class and object to call the method
                RemoveProperty obj = new RemoveProperty();
                obj.ConfirmDelete();
                Thread.Sleep(2000);

                //Verification

                bool isPropertyDeleted = Driver.driver.PageSource.Contains(PropertyName_BeforeDelete);
                Assert.IsTrue(!isPropertyDeleted);

                SaveScreenShotClass.SaveScreenshot(Driver.driver, "Delete");

                //property name after delete
                string PropertyName_AfterDelete = Driver.driver.FindElement(By.XPath("//*[@id='main-content']/section/div[1]/div/div[3]/div/div[1]/div[2]/div[1]/div[1]/a/h3")).Text;
                if (PropertyName_AfterDelete != PropertyName_BeforeDelete)
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Pass, "Test Passed, Delete successfull");
                }

                else
                {
                    Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Test Failed, Delete Unsuccessfull");
                }
            }
            catch (Exception e)
            {
                Base.test.Log(RelevantCodes.ExtentReports.LogStatus.Fail, "Test Failed, Delete Unsuccessfull", e.Message);
            }
        }
示例#8
0
        public void FinishSendMessageFromDonor(int donationId, bool succeeded)
        {
            // this code sets the status of a pending message to donor to ready to send, once there's a successful donation
            // stripe webhook returned - JPC 2/25/2016
            var donationCommunicationRecords = _ministryPlatformService.GetRecordsDict(_donationCommunicationsPageId, ApiLogin(), string.Format("\"{0}\"", donationId), "");
            var donationCommunicationRecord  = donationCommunicationRecords.FirstOrDefault();

            // a message from the donor is optional, so there's nothing to do if no message is available
            if (donationCommunicationRecord == null)
            {
                return;
            }

            var communicationId = Int32.Parse(donationCommunicationRecord["Communication_ID"].ToString());
            var recordId        = Int32.Parse(donationCommunicationRecord["dp_RecordID"].ToString());

            Dictionary <string, object> communicationUpdateValues = new Dictionary <string, object>();

            communicationUpdateValues.Add("Communication_ID", communicationId);

            if (succeeded == true)
            {
                communicationUpdateValues.Add("Communication_Status_ID", 3);
                _ministryPlatformService.UpdateRecord(_messagesPageId, communicationUpdateValues, ApiLogin());
            }

            DeleteOption[] deleteOptions = new DeleteOption[]
            {
                new DeleteOption
                {
                    Action = DeleteAction.Delete
                }
            };

            try
            {
                _ministryPlatformService.DeleteRecord(_donationCommunicationsPageId, recordId, deleteOptions, ApiLogin());
            }
            catch (Exception e)
            {
                throw new ApplicationException(string.Format("RemoveDonationCommunication failed.  DonationCommunicationId: {0}", recordId), e);
            }
        }
示例#9
0
        static async Task DeleteTweetsCommand(DeleteOption opts)
        {
            long user_id;

            if (opts.user_id.HasValue)
            {
                user_id = opts.user_id.Value;
            }
            else
            {
                var id = await LookupUserId(opts.screen_name).ConfigureAwait(false);

                if (id.HasValue)
                {
                    user_id = id.Value;
                }
                else
                {
                    Console.WriteLine("Account not found."); return;
                }
            }
            await LookupCommand(new LookupOption()
            {
                user_id = user_id
            }).ConfigureAwait(false);

            if (!opts.yes)
            {
                Console.Write("Delete this account? [type \"y\" to delete]: ");
                string yn = Console.ReadLine();
                if (yn.Trim() != "y")
                {
                    Console.WriteLine("Canceled.");
                    return;
                }
                Console.WriteLine("OK. Deleting...");
            }
            Counter.AutoRefresh();
            await DB.DeleteUser(user_id).ConfigureAwait(false);

            Counter.PrintReset();
            Console.WriteLine("\(^o^)/");
        }
示例#10
0
        public void Delete(DeleteOption opt, bool force = false)
        {
            if (force)
            {
                CloseProcess();
            }
            switch (opt)
            {
            case DeleteOption.Cache:
                deleteCache(force);
                break;

            case DeleteOption.Cookies:
                deleteCookies(force);
                break;

            case DeleteOption.Downloads:
                deleteDownloads(force);
                break;

            case DeleteOption.FormData:
                deleteFormData(force);
                break;

            case DeleteOption.History:
                deleteHistory(force);
                break;

            case DeleteOption.Passwords:
                deletePasswords(force);
                break;

            default:
                break;
            }
        }
示例#11
0
        /// <summary>
        /// Set delete behavior of foreign property on deleting
        /// </summary>
        public PropertyOf <TEntity> OnDelete(DeleteOption deleteOption)
        {
            _property.DeleteOption = deleteOption;

            return(this);
        }
示例#12
0
 public OnDeleteAttribute(DeleteOption deleteOption)
 {
     DeleteOption = deleteOption;
 }
示例#13
0
 private async void TSB_DeleteOption_Click(object sender, EventArgs e)
 {
     await DeleteOption?.Invoke();
 }
示例#14
0
 public static DeleteOp delete(ByteSequence key, DeleteOption option)
 {
     return(new DeleteOp(ByteString.CopyFrom(key.GetBytes()), option));
 }
		public OnDeleteAttribute(DeleteOption deleteOption)
		{
			DeleteOption = deleteOption;
		}
示例#16
0
 public static async Task DeleteFileAsync(string item, DeleteOption option)
 {
     await Task.Run(() => FileSystem.DeleteFile(item, UIOption.OnlyErrorDialogs,
                                                option == DeleteOption.PermanentDelete ? RecycleOption.DeletePermanently : RecycleOption.SendToRecycleBin,
                                                UICancelOption.DoNothing));
 }
示例#17
0
 public DeleteOp(ByteString key, DeleteOption option) : base(Type.DELETE_RANGE, key)
 {
     this.option = option;
 }