BFS.Clipboard.SetText(BFS.ClipboardFusion.GetLocalPinnedText(0));
using System; using System.Collections.Generic; public static class ClipboardFusionHelper { public static string ProcessText(string text) { int daysToAdd = 4; DateTime currentDateTime = DateTime.Now; text = currentDateTime.AddDays(daysToAdd).ToString("dd.MM.yyyy hh.mm.ss"); BFS.Clipboard.PasteText(text); return text; } }
using System; using System.Collections.Generic; public static class ClipboardFusionHelper { public static string ProcessText(string text) { // Set the days to add and get the current date/time int daysToAdd = 7; DateTime currentDateTime = DateTime.Now; // Set the potential new date/time DateTime newDate = currentDateTime.AddDays(daysToAdd); // Check if the new date is a Saturday or Sunday, if so, add some more days if (newDate.DayOfWeek == DayOfWeek.Saturday) newDate = newDate.AddDays(2); else if (newDate.DayOfWeek == DayOfWeek.Sunday) newDate = newDate.AddDays(1); // Convert the date/time to text text = newDate.ToString("dd.MM.yyyy hh.mm.ss"); // Paste and return the text to the clipboard BFS.Clipboard.PasteText(text); return text; } }
using System; using System.Collections.Generic; public static class ClipboardFusionHelper { public static string ProcessText(string text) { // Set the days to add and get the current date/time int daysToAdd = 7; // Get the date DateTime date = DateTime.Now; // Fix the date in case it's a weekend if (date.DayOfWeek == DayOfWeek.Saturday) date = date.AddDays(2); else if (date.DayOfWeek == DayOfWeek.Sunday) date = date.AddDays(1); // Add the days one at a time, and check for a weekend after each time for(int i = 0; i < daysToAdd; i++) { // Add one day date = date.AddDays(1); // Check if the new date is a Saturday or Sunday, if so, add some more days if (date.DayOfWeek == DayOfWeek.Saturday) date = date.AddDays(2); else if (date.DayOfWeek == DayOfWeek.Sunday) date = date.AddDays(1); } // Convert the date/time to text text = date.ToString("dd.MM.yyyy hh.mm.ss"); // Paste and return the text to the clipboard BFS.Clipboard.PasteText(text); return text; } }