public ConfigurationDataPhxBit() : base() { PassKey = new HiddenItem { Name = "PassKey", Value = "" }; CredentialsWarning = new DisplayItem("<b>Credentials Configuration</b> (<i>Private Tracker</i>),<br /><br /> <ul><li><b>Username</b> is your account name on this tracker.</li><li><b>Password</b> is your password associated to your account name.</li></ul>") { Name = "Credentials" }; Username = new StringItem { Name = "Username (Required)", Value = "" }; Password = new StringItem { Name = "Password (Required)", Value = "" }; PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Max Pages to Process</b> let you specify how many page (max) Jackett can process when doing a search. Setting a value <b>higher than 4 is dangerous</b> for you account ! (<b>Result of too many requests to tracker...that <u>will be suspect</u></b>).</li></ul>") { Name = "Preferences" }; Pages = new StringItem { Name = "Max Pages to Process (Required)", Value = "4" }; SecurityWarning = new DisplayItem("<b>Security Configuration</b> (<i>Read this area carefully !</i>),<br /><br /> <ul><li><b>Latency Simulation</b> will simulate human browsing with Jacket by pausing Jacket for an random time between each request, to fake a real content browsing.</li><li><b>Browser Simulation</b> will simulate a real human browser by injecting additionals headers when doing requests to tracker.</li></ul>") { Name = "Security" }; Latency = new BoolItem() { Name = "Latency Simulation (Optional)", Value = false }; Browser = new BoolItem() { Name = "Browser Simulation (Optional)", Value = true }; LatencyWarning = new DisplayItem("<b>Latency Configuration</b> (<i>Required if latency simulation enabled</i>),<br /><br/> <ul><li>By filling this range, <b>Jackett will make a random timed pause</b> <u>between requests</u> to tracker <u>to simulate a real browser</u>.</li><li>MilliSeconds <b>only</b></li></ul>") { Name = "Simulate Latency" }; LatencyStart = new StringItem { Name = "Minimum Latency (ms)", Value = "1589" }; LatencyEnd = new StringItem { Name = "Maximum Latency (ms)", Value = "3674" }; HeadersWarning = new DisplayItem("<b>Browser Headers Configuration</b> (<i>Required if browser simulation enabled</i>),<br /><br /> <ul><li>By filling these fields, <b>Jackett will inject headers</b> with your values <u>to simulate a real browser</u>.</li><li>You can get <b>your browser values</b> here: <a href='https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending' target='blank'>www.whatismybrowser.com</a></li></ul><br /><i><b>Note that</b> some headers are not necessary because they are injected automatically by this provider such as Accept_Encoding, Connection, Host or X-Requested-With</i>") { Name = "Injecting headers" }; HeaderAccept = new StringItem { Name = "Accept", Value = "" }; HeaderAcceptLang = new StringItem { Name = "Accept-Language", Value = "" }; HeaderDNT = new BoolItem { Name = "DNT", Value = false }; HeaderUpgradeInsecure = new BoolItem { Name = "Upgrade-Insecure-Requests", Value = false }; HeaderUserAgent = new StringItem { Name = "User-Agent", Value = "" }; DevWarning = new DisplayItem("<b>Development Facility</b> (<i>For Developers ONLY</i>),<br /><br /> <ul><li>By enabling development mode, <b>Jackett will bypass his cache</b> and will <u>output debug messages to console</u> instead of his log file.</li><li>By enabling Hard Drive Cache, <b>This provider</b> will <u>save each query answers from tracker</u> in temp directory, in fact this reduce drastically HTTP requests when building a provider at parsing step for example. So, <b> Jackett will search for a cached query answer on hard drive before executing query on tracker side !</b> <i>DEV MODE must be enabled to use it !</li></ul>") { Name = "Development" }; DevMode = new BoolItem { Name = "Enable DEV MODE (Developers ONLY)", Value = false }; HardDriveCache = new BoolItem { Name = "Enable HARD DRIVE CACHE (Developers ONLY)", Value = false }; HardDriveCacheKeepTime = new StringItem { Name = "Keep Cached files for (ms)", Value = "300000" }; }
public ConfigurationDataAnimeBytes() : base() { IncludeRaw = new BoolItem() { Name = "IncludeRaw", Value = false }; DateWarning = new DisplayItem("This tracker does not supply upload dates so they are based off year of release.") { Name = "DateWarning" }; InsertSeason = new BoolItem() { Name = "Prefix episode number with S01 for Sonarr Compatability", Value = false }; }
public ConfigurationSonarr() { Host = new StringItem { Name = "Host", Value = "http://localhost" }; Port = new StringItem { Name = "Port", Value = "8989" }; ApiKey = new StringItem { Name = "API Key" }; ApiInfo = new DisplayItem("API Key can be found in Sonarr > Settings > General > Security") { Name = "API Info" }; }
public ConfigurationDataBasicLoginWithAlternateLink(string instructionMessageOptional = null) { Username = new StringItem { Name = "Username" }; Password = new StringItem { Name = "Password" }; Instructions = new DisplayItem(instructionMessageOptional) { Name = "" }; AlternateLink = new StringItem { Name = "Alternate Link" }; }
public ConfigurationDataBasicLoginWithRSSAndDisplay() { Username = new StringItem { Name = "Username" }; Password = new StringItem { Name = "Password" }; RSSKey = new HiddenItem { Name = "RSSKey" }; DisplayText = new DisplayItem(""){ Name = "" }; }
public ConfigurationDataRecaptchaLogin(string instructionMessageOptional = null) { Username = new StringItem { Name = "Username" }; Password = new StringItem { Name = "Password" }; Captcha = new RecaptchaItem() { Name = "Recaptcha" }; Instructions = new DisplayItem(instructionMessageOptional) { Name = "" }; }
public ConfigurationDataWiHD() : base() { CredentialsWarning = new DisplayItem("<b>Credentials Configuration</b> (<i>Private Tracker</i>),<br /><br /> <ul><li><b>Username</b> is your account name on this tracker.</li><li><b>Password</b> is your password associated to your account name.</li></ul>") { Name = "Credentials" }; Username = new StringItem { Name = "Username (Required)", Value = "" }; Password = new StringItem { Name = "Password (Required)", Value = "" }; PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Max Pages to Process</b> let you specify how many page (max) Jackett can process when doing a search. Setting a value <b>higher than 4 is dangerous</b> for you account ! (<b>Result of too many requests to tracker...that <u>will be suspect</u></b>).</li><li><b>Exclusive Only</b> let you search <u>only</u> for torrents which are marked Exclusive.</li><li><b>Freeleech Only</b> let you search <u>only</u> for torrents which are marked Freeleech.</li><li><b>Reseed Only</b> let you search <u>only</u> for torrents which need to be seeded.</li></ul>") { Name = "Preferences" }; Pages = new StringItem { Name = "Max Pages to Process (Required)", Value = "4" }; Exclusive = new BoolItem() { Name = "Exclusive Only (Optional)", Value = false }; Freeleech = new BoolItem() { Name = "Freeleech Only (Optional)", Value = false }; Reseed = new BoolItem() { Name = "Reseed Needed Only (Optional)", Value = false }; SecurityWarning = new DisplayItem("<b>Security Configuration</b> (<i>Read this area carefully !</i>),<br /><br /> <ul><li><b>Latency Simulation</b> will simulate human browsing with Jacket by pausing Jacket for an random time between each request, to fake a real content browsing.</li><li><b>Browser Simulation</b> will simulate a real human browser by injecting additionals headers when doing requests to tracker.</li></ul>") { Name = "Security" }; Latency = new BoolItem() { Name = "Latency Simulation (Optional)", Value = true }; Browser = new BoolItem() { Name = "Browser Simulation (Optional)", Value = true }; LatencyWarning = new DisplayItem("<b>Latency Configuration</b> (<i>Required if latency simulation enabled</i>),<br /><br/> <ul><li>By filling this range, <b>Jackett will make a random timed pause</b> <u>between requests</u> to tracker <u>to simulate a real browser</u>.</li><li>MilliSeconds <b>only</b></li></ul>") { Name = "Simulate Latency" }; LatencyStart = new StringItem { Name = "Minimum Latency (ms)", Value = "1589" }; LatencyEnd = new StringItem { Name = "Maximum Latency (ms)", Value = "3674" }; HeadersWarning = new DisplayItem("<b>Browser Headers Configuration</b> (<i>Required if browser simulation enabled</i>),<br /><br /> <ul><li>By filling these fields, <b>Jackett will inject headers</b> with your values <u>to simulate a real browser</u>.</li><li>You can get <b>your browser values</b> here: <a href='https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending' target='blank'>www.whatismybrowser.com</a></li></ul><br /><i><b>Note that</b> some headers are not necessary because they are injected automatically by this provider such as Accept_Encoding, Connection, Host or X-Requested-With</i>") { Name = "Injecting headers" }; HeaderAccept = new StringItem { Name = "Accept", Value = "" }; HeaderAcceptLang = new StringItem { Name = "Accept-Language", Value = "" }; HeaderDNT = new BoolItem { Name = "DNT", Value = false }; HeaderUpgradeInsecure = new BoolItem { Name = "Upgrade-Insecure-Requests", Value = false }; HeaderUserAgent = new StringItem { Name = "User-Agent", Value = "" }; DevWarning = new DisplayItem("<b>Devlopement Facility</b> (<i>For Developers ONLY</i>),<br /><br /> <ul><li>By enabling devlopement mode, <b>Jackett will bypass his cache</b> and will <u>output debug messages to console</u> instead of his log file.</li></ul>") { Name = "Devlopement" }; DevMode = new BoolItem { Name = "Enable DEV MODE (Developers ONLY)", Value = false }; }
/// <param name="instructionMessageOptional">Enter any instructions the user will need to setup the tracker</param> public ConfigurationDataCaptchaLogin(string instructionMessageOptional = null) { Username = new StringItem { Name = "Username" }; Password = new StringItem { Name = "Password" }; CaptchaImage = new ImageItem { Name = "Captcha Image" }; CaptchaText = new StringItem { Name = "Captcha Text" }; CaptchaCookie = new HiddenItem("") { Name = "Captcha Cookie" }; Instructions = new DisplayItem(instructionMessageOptional) { Name = "" }; }
public ConfigurationDataBlueTigers(string displayInstructions) { Username = new StringItem { Name = "Username", Value = "" }; Password = new StringItem { Name = "Password", Value = "" }; Instructions = new DisplayItem(displayInstructions) { Name = "" }; French = new BoolItem { Name = "French", Value = true }; English = new BoolItem { Name = "English", Value = true }; Spanish = new BoolItem { Name = "Spanish", Value = true }; }
public ConfigurationDataBasicLoginWithFilter(string FilterInstructions) { Username = new StringItem { Name = "Username" }; Password = new StringItem { Name = "Password" }; FilterExample = new DisplayItem(FilterInstructions) { Name = "" }; FilterString = new StringItem { Name = "Filters (optional)" }; }
public ConfigurationDataFileList() : base("Note this is <b>not</b> your <i>password</i>.<ul><li>Login to the FileList Website</li><li>Click on the <b>Profile</b> link</li><li>Scroll down to the <b>Reset Passkey</b> section</li><li>Copy the <b>passkey</b>.</li><li>Also be aware of not leaving a trailing blank at the end of the passkey after pasting it here.</li></ul>") { IncludeRomanianReleases = new BoolItem { Name = "IncludeRomanianReleases", Value = false }; CatWarning = new DisplayItem("When mapping TV ensure you add category 5000 in addition to 5030, 5040.") { Name = "CatWarning" }; }
public ConfigurationDataGazelleTracker(bool has2Fa = false, bool supportsFreeleechToken = false, bool useApiKey = false, string instructionMessageOptional = null) { if (useApiKey) { ApiKey = new StringItem { Name = "APIKey" } } ; else { Username = new StringItem { Name = "Username" }; Password = new StringItem { Name = "Password" }; } if (has2Fa) { CookieHint = new DisplayItem( @"Use the Cookie field only if 2FA is enabled for your account, let it empty otherwise. <ol><li>Login to this tracker with your browser <li>Open the <b>DevTools</b> panel by pressing <b>F12</b> <li>Select the <b>Network</b> tab <li>Click on the <b>Doc</b> button <li>Refresh the page by pressing <b>F5</b> <li>Select the <b>Headers</b> tab <li>Find 'cookie:' in the <b>Request Headers</b> section <li>Copy & paste the whole cookie string to here.</ol>") { Name = "CookieHint" }; CookieItem = new StringItem { Name = "Cookie", Value = "" }; } if (supportsFreeleechToken) { UseTokenItem = new BoolItem { Name = "Use Freeleech Tokens when Available", Value = false } } ; Instructions = new DisplayItem(instructionMessageOptional) { Name = "" }; } }
public ConfigurationDataXthor() : base() { CredentialsWarning = new DisplayItem("<b>Credentials Configuration</b> (<i>Private Tracker</i>),<br /><br /> <ul><li><b>PassKey</b> is your private key on your account</li></ul>") { Name = "Credentials" }; PassKey = new StringItem { Name = "PassKey", Value = "" }; PagesWarning = new DisplayItem("<b>Preferences Configuration</b> (<i>Tweak your search settings</i>),<br /><br /> <ul><li><b>Freeleech Only</b> let you search <u>only</u> for torrents which are marked Freeleech.</li></ul>") { Name = "Preferences" }; Freeleech = new BoolItem() { Name = "Freeleech Only (Optional)", Value = false }; DevWarning = new DisplayItem("<b>Development Facility</b> (<i>For Developers ONLY</i>),<br /><br /> <ul><li>By enabling development mode, <b>Jackett will bypass his cache</b> and will <u>output debug messages to console</u> instead of his log file.</li><li>By enabling Hard Drive Cache, <b>This provider</b> will <u>save each query answers from tracker</u> in temp directory, in fact this reduce drastically HTTP requests when building a provider at parsing step for example. So, <b> Jackett will search for a cached query answer on hard drive before executing query on tracker side !</b> <i>DEV MODE must be enabled to use it !</li></ul>") { Name = "Development" }; DevMode = new BoolItem { Name = "Enable DEV MODE (Developers ONLY)", Value = false }; HardDriveCache = new BoolItem { Name = "Enable HARD DRIVE CACHE (Developers ONLY)", Value = false }; HardDriveCacheKeepTime = new StringItem { Name = "Keep Cached files for (ms)", Value = "300000" }; }
public void deleteSlot() { displayInfo = null; imageIcon.SetActive(false); priceShower.SetActive(false); if (toolTip) { toolTip.SetActive(false); } PlayerProperties.artifactToolTip.gameObject.SetActive(false); PlayerProperties.consumableToolTip.gameObject.SetActive(false); }
// Use this for initialization void Start() { itemDetails = GetComponent <DisplayItem>(); //weapSlot = equipGo.transform.GetChild(3).gameObject; //bodySlot = equipGo.transform.GetChild(2).gameObject; //headSlot = equipGo.transform.GetChild(1).gameObject; //accSlot = equipGo.transform.GetChild(0).gameObject; //selectedItemDescrip = itemDescription.transform.GetChild(0).GetComponent<Text>(); //equippedItemDescrip = itemDescription.transform.GetChild(1).GetComponent<Text>(); }
public override async System.Threading.Tasks.Task ExecuteLoadSchedulesCommand() { if (IsBusy) { return; } if (!IsRefreshing) { IsBusy = true; } try { if (!Users.Any()) { var lookups = await DataService.GetLookups(1000); lookups.Users.ForEach(u => Users.Add(u)); } ScheduleDateFormatted = ScheduleDate.ToShortDateString(); OnPropertyChanged("ScheduleDateFormatted"); Schedules.Clear(); var items = await DataService.GetItemsAsync <Schedule>($"schedules?start={ScheduleDate.ToString("MM-dd-yyyy")}&end={ScheduleDate.ToString("MM-dd-yyyy")}{(CanManageSchedule ? "" : "&assigned=true")}"); NoSchedules = !items.Data.Any(); OnPropertyChanged("NoSchedules"); this.WeekUnpublished = false; foreach (var item in items.Data.OrderBy(d => d.User == null ? "zzzzzz" : d.User.FirstName)) { if (item.UserId != null && !item.PublishedValue) { this.WeekUnpublished = true; } var displayItem = new DisplayItem(); scheduleToDisplayItem(displayItem, item); Schedules.Add(displayItem); } } catch (Exception ex) { IsBusy = false; IsRefreshing = false; ExceptionHelper.ShowException(ex); } finally { IsBusy = false; IsRefreshing = false; } }
public void gamble() { targetItem = gambleItem(); if (targetItem == null) { StartCoroutine(fail()); } else { StartCoroutine(success()); } }
protected override void scheduleToDisplayItem(DisplayItem displayItem, Schedule schedule) { displayItem.Line1 = schedule.User == null ? "Unassigned" : schedule.User.DisplayName; displayItem.Line2 = $"{CultureInfo.CurrentCulture.DateTimeFormat.AbbreviatedDayNames[schedule.DayOfWeekValue]}, {schedule.ScheduleDateValue.ToString("MM/dd")} - {schedule.StartTimeTimezonedValue.ToShortTimeString()} - {schedule.EndTimeTimezonedValue.ToShortTimeString()}"; displayItem.Line3 = $"{schedule.Shift.ShiftName} - {schedule.Task.TaskName}"; displayItem.Tag = schedule; displayItem.Tag2 = string.IsNullOrEmpty(schedule.Task.TextColor) ? Color.LightGray : Color.FromHex(schedule.Task.TextColor); displayItem.Tag3 = schedule.User == null ? Color.Maroon : Color.Black; displayItem.Tag4 = schedule.User == null; displayItem.Tag5 = schedule.User != null; displayItem.Tag6 = schedule.User == null && !schedule.ScheduleTrades.Any(); }
public ConfigurationDataAnimeBytes() : base() { IncludeRaw = new BoolItem() { Name = "IncludeRaw", Value = false }; DateWarning = new DisplayItem("This tracker does not supply upload dates so they are based off year of release.") { Name = "DateWarning" }; }
public ConfigurationDataCookie() { Cookie = new StringItem { Name = "Cookie" }; CookieInstructions = new DisplayItem( "Please enter the cookie for the site manually. <a href=\"https://github.com/Jackett/Jackett/wiki/Finding-cookies\" target=\"_blank\">See here</a> on how get the cookies." + "<br>Example cookie header (usually longer than this):<br><code>PHPSESSID=8rk27odm; ipsconnect_63ad9c=1; more_stuff=etc;</code>") { Name = "Cookie Instructions" }; }
public ConfigurationDataRutracker() : base() { StripRussianLetters = new BoolItem() { Name = "Strip Russian Letters", Value = true }; CaptchaWarning = new DisplayItem("<b>About Captcha:</b> If the Captcha Image is missing then leave the Captcha Text empty.") { Name = "Captcha Info" }; }
public ConfigurationDataFileList() : base() { IncludeRomanianReleases = new BoolItem() { Name = "IncludeRomanianReleases", Value = false }; CatWarning = new DisplayItem("When mapping TV ensure you add category 5000 in addition to 5030,5040.") { Name = "CatWarning" }; }
private async System.Threading.Tasks.Task editInventoryItem(DisplayItem item) { var editViewModel = new InventoryEditViewModel(_viewModel.OriginalVendors.ToList(), _viewModel.OriginalCategories.ToList(), item.Tag as InventoryItem); editViewModel.ItemSaved += (object sender, EventArgs e) => { _viewModel.InventoryItemSaved(item.Tag as InventoryItem, item); }; var page = new InventoryEditPage(); page.BindingContext = editViewModel; await((MainPage)App.Current.MainPage).NavigateTo(page, true); }
private void setComplete(DisplayItem userProgressDisplayItem) { var usr = LoginHelper.GetLoggedInUser(); var userProgressItem = userProgressDisplayItem.Tag as UserProgressItem; userProgressItem.CompletedDate = DateTime.Now; userProgressItem.CompletedBy = usr.User; userProgressItem.CompletedByIdValue = usr.User.UserIdValue; //if (IsNotNew) // await saveChecklist(false); itemToDisplayItem(userProgressItem, userProgressDisplayItem); userProgressDisplayItem.Refresh(); }
private void SetImageVisibility() { if (_imgTop.CssClass == VISIBLE) { _imgBottom = _nextItem; _imgBottom.CssClass = TRANSPARENT; } else { _imgTop = _nextItem; _imgTop.CssClass = TRANSPARENT; } }
public ConfigurationDataLoginLink() { LoginLink = new StringItem { Name = "Login Link" }; RSSKey = new HiddenItem { Name = "RSSKey" }; DisplayText = new DisplayItem("") { Name = "" }; }
private async System.Threading.Tasks.Task editMaintenanceItem(DisplayItem item) { var editViewModel = new MaintenanceRequestEditViewModel(item.Tag as MaintenanceRequest, _viewModel.Lookups); editViewModel.ItemSaved += (object sender, EventArgs e) => { _viewModel.MaintenanceRequestSaved(item.Tag as MaintenanceRequest, item); }; var page = new MaintenanceRequestEditPage(); page.BindingContext = editViewModel; await((MainPage)App.Current.MainPage).NavigateTo(page, true); }
public ConfigurationDataBasicLogin(string instructionMessageOptional = null) { Username = new StringItem { Name = "Username" }; Password = new StringItem { Name = "Password" }; Instructions = new DisplayItem(instructionMessageOptional) { Name = "" }; }
public ConfigurationDataUserPasskey(string instructionMessageOptional = null) { Username = new StringItem { Name = "Username" }; Passkey = new StringItem { Name = "Passkey" }; Instructions = new DisplayItem(instructionMessageOptional) { Name = "" }; }
public void Initialize(GameObject artifact, ArticraftingConfirmationModal modal, ArticraftingCraftingMenu menu) { targetArtifact = artifact; artifactBonus = artifact.GetComponent <ArtifactBonus>(); artifactText = artifact.GetComponent <Text>(); artifactDisplayItem = artifact.GetComponent <DisplayItem>(); tileImage.sprite = artifactDisplayItem.displayIcon; tileImage.preserveAspect = true; toolTip = PlayerProperties.playerInventory.toolTip; confirmModal = modal; UpdatePrice(); this.craftingMenu = menu; }
private void AddDisplayItem(IDisplayItem displayItem) { var item = new DisplayItem(displayItem); item.Visibility = System.Windows.Visibility.Hidden; ScrollCanvas.Children.Add(item); Canvas.SetTop(item, 0); Canvas.SetLeft(item, 0); displayItems.AddLast(item); }
public ConfigurationDataBasicLoginWithEmail(string instructionMessageOptional = null) { Email = new StringItem { Name = "Email" }; Password = new StringItem { Name = "Password" }; Instructions = new DisplayItem(instructionMessageOptional) { Name = "" }; }
void Update() { if (0 == _displayItems.Count) { return; } float deltaTime = Time.deltaTime; DisplayItem item = _displayItems[_curDisplayIndex]; if (item.stage == FadeStage.IN) { item.alpha += 1.0f / fadeInDuration * deltaTime; if (item.alpha >= 1.0f) { item.alpha = 1.0f; item.stage = FadeStage.KEEP; } } else if (item.stage == FadeStage.KEEP) { item.elapsedOnKeep += deltaTime; if (item.elapsedOnKeep >= keepDuration) { item.stage = FadeStage.OUT; } } else if (item.stage == FadeStage.OUT) { item.alpha -= 1.0f / fadeOutDuration * deltaTime; if (item.alpha < 0.0f) { item.alpha = 0; _curDisplayIndex++; } } //Debug.Log("tip alpha " + item.alpha); _tipText.text = item.text; Color c = _tipText.color; c.a = item.alpha; _tipText.color = c; if (_curDisplayIndex >= _displayItems.Count) { _displayItems.Clear(); StartCoroutine("fadeOutContainer"); } }
private void _list_SelectedIndexChanged(object sender, EventArgs e) { if (_list.SelectedIndex >= 0) { _selectedItem = (DisplayItem)_list.SelectedItem; Text = _selectedItem.ToString(); } else { Text = ""; _selectedItem = null; } OnSelectedItemChanged(); }
/// <param name="value">值</param> void refreshKey(DisplayItem item, JsonData value) { if (item.obj == null) { return; } /* * Debug.Log("refreshKey: " + name + ": key: " + item.key + * " value:" + (value == null ? "NULL" : value.ToJson())); */ switch (item.type) { case DisplayItem.Type.Text: processTextDisplayItem(item, value); break; case DisplayItem.Type.Sign: processSignDisplayItem(item, value); break; case DisplayItem.Type.Percent: processPercentDisplayItem(item, value); break; case DisplayItem.Type.SignPercent: processSignDisplayItem(item, value, true); break; case DisplayItem.Type.TimeSpan: processTimeSpanDisplayItem(item, value); break; case DisplayItem.Type.TimeSpanWithHour: processTimeSpanDisplayItem(item, value, true); break; case DisplayItem.Type.Show: processShowDisplayItem(item, value); break; case DisplayItem.Type.Hide: processShowDisplayItem(item, value, true); break; case DisplayItem.Type.Date: processDateDisplayItem(item, value); break; case DisplayItem.Type.DateTime: processDateTimeDisplayItem(item, value); break; case DisplayItem.Type.Color: processColorDisplayItem(item, value); break; case DisplayItem.Type.ScaleX: processScaleXDisplayItem(item, value); break; case DisplayItem.Type.ScaleY: processScaleYDisplayItem(item, value); break; case DisplayItem.Type.AnchorX: processAnchorXDisplayItem(item, value); break; case DisplayItem.Type.AnchorY: processAnchorYDisplayItem(item, value); break; case DisplayItem.Type.Fill: processFillDisplayItem(item, value); break; case DisplayItem.Type.ParamDisplay: processParamDisplayItem(item, value); break; default: processExtended(item, value); break; } }
private void inventoryItemToDisplayItem(InventoryItem invItem, DisplayItem displayItem) { var invCat = invItem.InventoryCategoryId != null?InventoryCategories.FirstOrDefault(ic => ic.InventoryCategoryId == invItem.InventoryCategoryId) : null; var vendor = invItem.VendorId != null?Vendors.FirstOrDefault(v => v.VendorId == invItem.VendorId) : null; bool isNeeded = invItem.QuantityOnHand.GetValueOrDefault() < invItem.MinimumQuantity.GetValueOrDefault(); displayItem.Line1 = invItem.InventoryItemName; displayItem.Line2 = (invCat == null ? "" : invCat.CategoryName) + (vendor == null ? "" : $" - {vendor.VendorName}"); displayItem.Line3 = $"In Stock: {invItem.QuantityOnHand.GetValueOrDefault()} | Min Qty: {invItem.MinimumQuantity.GetValueOrDefault()} | Needed: {(isNeeded ? (invItem.MinimumQuantity.GetValueOrDefault() - invItem.QuantityOnHand.GetValueOrDefault()) : 0)}"; displayItem.Tag = invItem; displayItem.Tag2 = isNeeded ? Color.Red : Color.LightGray; }
public virtual void InitDisplayOnScreen(GameObject source, string text, ButtonManager.ButtonID button) { for (int i = 0; i < elements.Count; i++) { if (elements[i].source == source) { return; } } DisplayItem item = new DisplayItem(source, text, button); elements.Add(item); }
/// <summary> /// The add element. /// </summary> private void AddElement() { var displayElement = new DisplayItem(); var viewModel = new DisplayItemEditorViewModel { DisplayItem = displayElement }; var editor = new DisplayItemEditorView { DataContext = viewModel }; editor.ShowDialog(); DisplayItems.Add(displayElement); CurrentDisplayElement = displayElement; }
public VerificationPage() { InitializeComponent(); CustomerName.Text = DeliveriesPage.delivery.name; CustomerAddress.Text = DeliveriesPage.delivery.house_address; if (DeliveriesPage.delivery.delivery_instructions != null && DeliveriesPage.delivery.delivery_instructions == "") { DeliveryInstructions.Text += DeliveriesPage.delivery.delivery_instructions; } else { DeliveryInstructions.Text += "No delivery instructions for this order"; } //Debug.WriteLine("PHONE (PARSHED) FROM LINE 24: " + Delivery.parsedPhone); //Debug.WriteLine("PHONE FROM LINE 25: " + Delivery.phone); //CurrentIndex = Index; //LocalDelivery = Delivery; var items = JsonConvert.DeserializeObject <ObservableCollection <DeliveryItem> >(DeliveriesPage.delivery.delivery_items); listOfItem = items; int i = 0; foreach (DeliveryItem item in items) { var el = new DisplayItem(); el.itemUID = item.item_uid; el.img = item.img; el.title = item.name + " (" + item.unit + ") "; el.itemName = item.name; el.quantity = item.qty.ToString(); el.opacityValue = 1; el.index = i; i++; if (item.qty > 1) { el.color = Color.Red; } else { el.color = Color.Black; } Items.Add(el); } ItemList.ItemsSource = Items; }
public void deleteItem() { if (displayInfo != null && Input.GetKey(KeyCode.LeftShift) && SceneManager.GetActiveScene().name != "Tutorial" && FindObjectOfType <ConsumableConfirm>() == null) { FindObjectOfType <AudioManager>().PlaySound("Destroy Item"); inventory.itemList.Remove(displayInfo.gameObject); if (displayInfo.GetComponent <ArtifactEffect>()) { displayInfo.GetComponent <ArtifactEffect>().artifactDestroyed(); } Destroy(displayInfo.gameObject); displayInfo = null; } }
public ConfigurationDataCookie() { Cookie = new StringItem { Name = "Cookie" }; CookieHint = new DisplayItem( "<ol><li>Login to BeyondHD in your browser <li>Open the developer console, go the network tab <li>Find 'cookie' in the request headers <li>Copy & paste it to here</ol>") { Name = "CookieHint" }; CookieExample = new DisplayItem( "Example cookie header (usually longer than this):<br><code>PHPSESSID=8rk27odm; ipsconnect_63ad9c=1; more_stuff=etc;</code>") { Name = "CookieExample" }; }
/// <summary> /// Checks if a channel contains sailing terms and is therefore a sailing channel /// </summary> /// <param name="terms"></param> /// <param name="channel"></param> /// <returns></returns> private bool CheckSailingTerms(IReadOnlyCollection <SailingTerm> terms, DisplayItem channel) { string body = channel.Title.ToLower() + " " + channel.Description.ToLower(); foreach (var term in terms) { if (body.Contains(term.Id)) { return(true); } } return(false); }
private static void Display(DisplayItem displayItem) { Console.ForegroundColor = _foregroundColor; Console.BackgroundColor = _backgroundColor; if ((displayItem.DisplayMode & DisplayMode.Inverted) != 0) { Console.ForegroundColor = _backgroundColor; Console.BackgroundColor = _foregroundColor; displayItem.Text = string.Format(" {0} ", displayItem.Text); } if ((displayItem.DisplayMode & DisplayMode.Dim) != 0) Console.ForegroundColor = _dimColor; if ((displayItem.DisplayMode & DisplayMode.Parse) != 0) displayItem.Text = U413.Domain.Utilities.BBCodeUtility.ConvertTagsForConsole(displayItem.Text); if ((displayItem.DisplayMode & DisplayMode.DontType) != 0) Console.WriteLine(displayItem.Text); else { if ((displayItem.DisplayMode & DisplayMode.Mute) == 0) _beep.PlayLooping(); foreach (char c in displayItem.Text) { Console.Write(c); Thread.Sleep(10); } Console.Write(' '); Console.WriteLine(); if ((displayItem.DisplayMode & DisplayMode.Mute) == 0) _beep.Stop(); } Console.ForegroundColor = _foregroundColor; Console.BackgroundColor = _backgroundColor; }
private void SetDisplayItemZ(DisplayItem displayItem, int pos) { foreach (PreviewPixel p in displayItem.Shape.Pixels) { p.Z = pos; } }
private void SetupLine(bool horizontal) { preview.Data = new VixenPreviewData(); preview.LoadBackground(); preview.BackgroundAlpha = 0; displayItem = new DisplayItem(); PreviewPoint p1, p2; if (horizontal) { p1 = new PreviewPoint(10, preview.Height/2); p2 = new PreviewPoint(preview.Width - 10, preview.Height/2); } else { p1 = new PreviewPoint(preview.Width/2, preview.Height - 10); p2 = new PreviewPoint(preview.Width/2, 10); } PreviewLine line = new PreviewLine(p1, p2, PixelsPerString(), null, 1); line.PixelCount = PixelsPerString(); line.PixelSize = Data.PixelSize; line.PixelColor = Color.White; line.Layout(); displayItem.Shape = line; preview.AddDisplayItem(displayItem); }
private void SetupCane() { preview.Data = new VixenPreviewData(); preview.LoadBackground(); preview.BackgroundAlpha = 0; displayItem = new DisplayItem(); PreviewCane cane = new PreviewCane(new PreviewPoint(10, 10), null, 1); cane.StringType = PreviewBaseShape.StringTypes.Pixel; cane.LinePixelCount = PixelsPerString() / 2; cane.ArchPixelCount = PixelsPerString() / 2; cane.PixelSize = Data.PixelSize; cane.PixelColor = Color.White; cane.ArchLeft = new Point(0, preview.Height / 4); cane.TopLeft = new Point(preview.Width / 4, preview.Height / 8); cane.BottomRight = new Point((preview.Width / 4) + (preview.Width / 2), (preview.Height / 4) + (preview.Height / 2)); cane.Layout(); displayItem.Shape = cane; preview.AddDisplayItem(displayItem); }
private void SetupArch() { preview.Data = new VixenPreviewData(); preview.LoadBackground(); preview.BackgroundAlpha = 0; displayItem = new DisplayItem(); PreviewArch arch = new PreviewArch(new PreviewPoint(10, 10), null, 1); arch.PixelCount = PixelsPerString(); arch.PixelSize = Data.PixelSize; arch.PixelColor = Color.White; arch.TopLeft = new Point(10, preview.Height/2); arch.BottomRight = new Point((int) (preview.Width - 10), (int) (preview.Height - 10)); arch.Layout(); displayItem.Shape = arch; preview.AddDisplayItem(displayItem); }
public void AddTtemplateToPreview(string fileName) { if (System.IO.File.Exists(fileName)) { // Read the entire template file (stoopid waste of resources, but how else?) string xml = System.IO.File.ReadAllText(fileName); DisplayItem newDisplayItem = PreviewTools.DeSerializeToDisplayItem(xml, typeof (DisplayItem)); if (newDisplayItem != null) { DeSelectSelectedDisplayItem(); AddDisplayItem(newDisplayItem); _selectedDisplayItem = newDisplayItem; OnSelectDisplayItem(this, _selectedDisplayItem); _selectedDisplayItem.Shape.MoveTo(10, 10); _selectedDisplayItem.Shape.Select(true); _selectedDisplayItem.Shape.SetSelectPoint(null); } } }
private void SelectItemUnderPoint(PreviewPoint point, bool addToSelection) { if (!_mouseCaptured) { // First, see if we have an item already selected, but want to add to it if (addToSelection) { if (_selectedDisplayItem != null) SelectedDisplayItems.Add(_selectedDisplayItem); DeSelectSelectedDisplayItem(); DisplayItem item = DisplayItemAtPoint(point); if (item != null) SelectedDisplayItems.Add(item); } else { // First, deselect any currently selected item DeSelectSelectedDisplayItem(); _selectedDisplayItem = DisplayItemAtPoint(point); if (_selectedDisplayItem != null) { _selectedDisplayItem.Shape.Select(true); OnSelectDisplayItem(this, _selectedDisplayItem); } } } }
private void VixenPreviewControl_MouseDown(object sender, MouseEventArgs e) { if (_editMode) { bool controlPressed = (Control.ModifierKeys == Keys.Control); PreviewPoint translatedPoint = new PreviewPoint(e.X + hScroll.Value, e.Y + vScroll.Value); if (e.Button == System.Windows.Forms.MouseButtons.Left) { if (_currentTool == Tools.Select) { if (controlPressed) { DisplayItem item = DisplayItemAtPoint(translatedPoint); if (item != null && SelectedDisplayItems.Contains(item)) { SelectedDisplayItems.Remove(item); } else { SelectItemUnderPoint(translatedPoint, controlPressed); } return; } // Is there a single dislay item selected? if (_selectedDisplayItem != null && !controlPressed) { // Lets see if we've got a drag point. PreviewPoint selectedPoint = _selectedDisplayItem.Shape.PointInSelectPoint(translatedPoint); if (selectedPoint != null) { dragStart = translatedPoint.ToPoint(); _selectedDisplayItem.Shape.SetSelectPoint(selectedPoint); Capture = true; _mouseCaptured = true; } // If we're not resizing, see if we're moving a single shape else if (_selectedDisplayItem.Shape.PointInShape(translatedPoint)) { StartMove(translatedPoint.X, translatedPoint.Y); } // If we get here, we're outside the shape, deselect else { DeSelectSelectedDisplayItem(); } } // Are there multiple items selected? // If so, we're moving, can't resize them... else if (SelectedDisplayItems.Count > 1 && !controlPressed) { //if (MouseOverSelectedDisplayItems(e.X, e.Y)) { // StartMove(e.X, e.Y); //} //else { // SelectedDisplayItems.Clear(); //} if (MouseOverSelectedDisplayItems(translatedPoint.X, translatedPoint.Y)) { StartMove(translatedPoint.X, translatedPoint.Y); } else { SelectedDisplayItems.Clear(); } } SelectItemUnderPoint(translatedPoint, controlPressed); // If we get this far, and we've got nothing selected, we're drawing a rubber band! if (_selectedDisplayItem == null && SelectedDisplayItems.Count == 0) { // Capture the mouse in case we want to draw a rubber band dragStart = translatedPoint.ToPoint(); Capture = true; _mouseCaptured = true; SelectedDisplayItems.Clear(); _bandRect.Width = 0; _bandRect.Height = 0; _banding = true; } } else if (_selectedDisplayItem != null && _selectedDisplayItem.Shape.PointInShape(translatedPoint) && !_selectedDisplayItem.Shape.Creating) { StartMove(translatedPoint.X, translatedPoint.Y); } // If we're not Selecting items, we're drawing them else if (_currentTool == Tools.PolyLine && _mouseCaptured) { return; } else if (_currentTool == Tools.MultiString && _mouseCaptured) { return; } else { DeSelectSelectedDisplayItem(); DisplayItem newDisplayItem = null; if (_currentTool == Tools.String) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewLine(translatedPoint, translatedPoint, 50, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Arch) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewArch(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Rectangle) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewRectangle(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Single) { newDisplayItem = new DisplayItem { Shape = new PreviewSingle(translatedPoint, elementsForm.SelectedNode, ZoomLevel) }; } else if (_currentTool == Tools.Ellipse) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewEllipse(translatedPoint, 50, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Triangle) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewTriangle(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Net) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewNet(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Cane) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewCane(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Star) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewStar(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.StarBurst) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewStarBurst(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Flood) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewFlood(translatedPoint, elementsForm.SelectedNode); } else if (_currentTool == Tools.MegaTree) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewMegaTree(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.PixelGrid) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewPixelGrid(translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.Icicle) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewIcicle(translatedPoint, translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.PolyLine) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewPolyLine(translatedPoint, translatedPoint, elementsForm.SelectedNode, ZoomLevel); } else if (_currentTool == Tools.MultiString) { newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewMultiString(translatedPoint, translatedPoint, elementsForm.SelectedNode, ZoomLevel); } // Now add the newely created display item to the screen. if (newDisplayItem != null) { AddDisplayItem(newDisplayItem); newDisplayItem.ZoomLevel = ZoomLevel; _selectedDisplayItem = newDisplayItem; _selectedDisplayItem.Shape.PixelSize = 3; _selectedDisplayItem.Shape.Select(true); _selectedDisplayItem.Shape.SelectDefaultSelectPoint(); dragStart = translatedPoint.ToPoint(); Capture = true; _mouseCaptured = true; } } } else if (e.Button == System.Windows.Forms.MouseButtons.Right) { contextMenuStrip1.Items.Clear(); SelectItemUnderPoint(translatedPoint, false); if (_selectedDisplayItem != null) { PreviewPoint selectedPoint = _selectedDisplayItem.Shape.PointInSelectPoint(translatedPoint); if (_selectedDisplayItem.Shape.PointInShape(translatedPoint)) { if (_selectedDisplayItem.Shape.GetType().ToString().Contains("PreviewCustom")) { contextMenuStrip1.Items.Add(new ToolStripMenuItem { Text = "Separate Template Items", Tag = "Separate", Image = Common.Resources.Properties.Resources.Split }); } } } else if (SelectedDisplayItems.Count > 1) { contextMenuStrip1.Items.Add(new ToolStripMenuItem { Text = "Create Group...", Tag = "CreateGroup", Image = Common.Resources.Properties.Resources.group }); contextMenuStrip1.Items.Add(new ToolStripSeparator()); contextMenuStrip1.Items.Add(new ToolStripMenuItem { Text = "Create Template...", Tag = "CreateTemplate", Image = Common.Resources.Properties.Resources.document_font }); } if (_selectedDisplayItem != null) { contextMenuStrip1.Items.Add(new ToolStripMenuItem { Text = "Cut", Tag = "Cut", Image = Common.Resources.Properties.Resources.cut }); contextMenuStrip1.Items.Add(new ToolStripMenuItem { Text = "Copy", Tag = "Copy", Image = Common.Resources.Properties.Resources.page_copy }); } if (ClipboardPopulated) { if (_selectedDisplayItem == null & SelectedDisplayItems.Count > 1) { contextMenuStrip1.Items.Add(new ToolStripSeparator()); } contextMenuStrip1.Items.Add(new ToolStripMenuItem { Text = "Paste", Tag = "Paste", Image = Common.Resources.Properties.Resources.paste_plain }); } if (_selectedDisplayItem != null) { contextMenuStrip1.Items.Add(new ToolStripMenuItem { Text = "Delete", Tag = "Delete", Image = Common.Resources.Properties.Resources.delete }); } if (_selectedDisplayItem != null) { contextMenuStrip1.Items.Add(new ToolStripSeparator()); if (Data.SaveLocations & _selectedDisplayItem != null) { // Z location menu contextMenuStrip1.Items.Add(new ToolStripMenuItem { Text = "Set Z Location to" }); // Z sub menu items (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "0 Front", Tag = "0" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "1", Tag = "1" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "2", Tag = "2" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "3", Tag = "3" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "4 Middle", Tag = "4" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "5", Tag = "5" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "6", Tag = "6" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "7", Tag = "7" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "8", Tag = "8" }); (contextMenuStrip1.Items[contextMenuStrip1.Items.Count - 1] as ToolStripMenuItem).DropDownItems.Add(new ToolStripMenuItem { Text = "9 Back", Tag = "9" }); } } if (contextMenuStrip1.Items.Count > 0) { contextMenuStrip1.Show(this, e.Location); } } else if (e.Button == System.Windows.Forms.MouseButtons.Middle) { // Pan zoomTo = MousePointToZoomPoint(e.Location); } } }
protected void AddItem( DisplayItem item ) { AddRawItem( item ); }
public void OnItemContextMenuClick(Object sender, EventArgs e) { string tag = (sender as MenuItem).Tag.ToString(); switch (tag) { case "CreateTemplate": _selectedDisplayItem = CreateTemplate(); if (_selectedDisplayItem != null) { _selectedDisplayItem.Shape.Select(true); } break; case "CreateGroup": _selectedDisplayItem = CreateGroup(); if (_selectedDisplayItem != null) { _selectedDisplayItem.Shape.Select(true); } break; case "Separate": if (_selectedDisplayItem != null) SeparateTemplateItems(_selectedDisplayItem); break; case "Cut": Cut(); break; case "Copy": Copy(); break; case "Paste": Paste(); break; case "Delete": Delete(); break; case "0": case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": SetZForSelectedItems(Convert.ToInt32(tag)); break; } }
public void DeSelectSelectedDisplayItemNoNotify() { if (_selectedDisplayItem != null) { _selectedDisplayItem.Shape.Deselect(); _selectedDisplayItem = null; } }
public void DeSelectSelectedDisplayItem() { if (_selectedDisplayItem != null) { OnDeSelectDisplayItem(this, _selectedDisplayItem); _selectedDisplayItem.Shape.Deselect(); _selectedDisplayItem = null; } }
public DisplayItem CreateGroup() { foreach (DisplayItem item in SelectedDisplayItems) { if (item.Shape.GetType().ToString().Contains("PreviewCustom")) { //messageBox Arguments are (Text, Title, No Button Visible, Cancel Button Visible) MessageBoxForm.msgIcon = SystemIcons.Error; //this is used if you want to add a system icon to the message form. var messageBox = new MessageBoxForm("You cannot create a group or a template with an item that is already grouped or a template item. First, separate the items and then re-group all the items you would like.", "Grouping Error", false, true); messageBox.ShowDialog(); return null; } } DisplayItem newDisplayItem; newDisplayItem = new DisplayItem(); newDisplayItem.Shape = new PreviewCustom(new PreviewPoint(100, 100), SelectedShapes()); AddDisplayItem(newDisplayItem); foreach (DisplayItem item in SelectedDisplayItems) { DisplayItems.Remove(item); } return newDisplayItem; }
public ConfigurationDataStrike(string url) : base(url) { StrikeWarning = new DisplayItem("This indexer does not support RSS Sync, only Search") { Name = "Warning" }; }
private void SetupMegaTree(int degrees) { int stringCount = StringCount; if (stringCount < 2) return; preview.Data = new VixenPreviewData(); preview.LoadBackground(); preview.BackgroundAlpha = 0; displayItem = new DisplayItem(); PreviewMegaTree tree = new PreviewMegaTree(new PreviewPoint(10, 10), null, 1); tree.BaseHeight = 25; tree.TopHeight = 1; tree.TopWidth = 1; tree.StringType = PreviewBaseShape.StringTypes.Pixel; tree.Degrees = degrees; tree.StringCount = stringCount; tree.PixelCount = PixelsPerString(); tree.PixelSize = Data.PixelSize; tree.PixelColor = Color.White; tree.Top = 10; tree.Left = 10; tree.BottomRight = new Point(preview.Width - 10, preview.Height - 10); tree.Layout(); displayItem.Shape = tree; preview.AddDisplayItem(displayItem); }
private void SetupPixelGrid() { if (StringCount < 2) return; preview.Data = new VixenPreviewData(); preview.LoadBackground(); preview.BackgroundAlpha = 0; displayItem = new DisplayItem(); PreviewPixelGrid grid = new PreviewPixelGrid(new PreviewPoint(10, 10), null, 1); grid.StringType = PreviewBaseShape.StringTypes.Pixel; grid.StringCount = StringCount; grid.LightsPerString = PixelsPerString(); grid.PixelSize = Data.PixelSize; grid.PixelColor = Color.White; grid.Top = 10; grid.Left = 10; if (Data.StringOrienation == NutcrackerEffects.StringOrientations.Horizontal) { grid.StringOrientation = PreviewPixelGrid.StringOrientations.Horizontal; grid.BottomRight = new Point(Math.Min(StringCount * Data.PixelSize * 2, preview.Width - 10), preview.Width - 10); ; grid.BottomLeft.Y = Math.Min(StringCount * Data.PixelSize * 2, preview.Width - 10); grid.BottomRight = new Point(Math.Min(grid.LightsPerString * Data.PixelSize * 2, preview.Width - 10), preview.Width - 10); grid.Left = Math.Max( (preview.Width - 10 - (grid.LightsPerString * Data.PixelSize * 2))/2 , 10); } else { grid.BottomRight = new Point(preview.Width-10,preview.Height-10); } grid.Layout(); displayItem.Shape = grid; preview.AddDisplayItem(displayItem); }
private void VixenPreviewControl_MouseUp(object sender, MouseEventArgs e) { if (_mouseCaptured) { if (_currentTool != Tools.Select) { // If control is pressed, deselect the shape and immediately allow drawing another shape //if ((Control.ModifierKeys & Keys.Shift) != 0) { // _selectedDisplayItem.Shape.MouseUp(sender, e); // DeSelectSelectedDisplayItem(); //} //else if (_selectedDisplayItem != null && _currentTool == Tools.PolyLine && e.Button == System.Windows.Forms.MouseButtons.Left && _selectedDisplayItem.Shape.Creating) { // If we are drawing a PolyLine, we want all the mouse events to be passed to the shape _selectedDisplayItem.Shape.MouseUp(sender, e); return; } else if (_selectedDisplayItem != null && _currentTool == Tools.MultiString && e.Button == System.Windows.Forms.MouseButtons.Left && _selectedDisplayItem.Shape.Creating) { // If we are drawing a MultiString, we want all the mouse events to be passed to the shape _selectedDisplayItem.Shape.MouseUp(sender, e); return; } else { //_currentTool = Tools.Select; } } if (_selectedDisplayItem != null) { _selectedDisplayItem.Shape.MouseUp(sender, e); OnSelectDisplayItem(this, _selectedDisplayItem); } // Ok, if this is true, we've got a rubber band and something is selected, now what? else if (SelectedDisplayItems.Count > 0) { // If we only have one item, just select it and go on. if (SelectedDisplayItems.Count == 1) { _selectedDisplayItem = SelectedDisplayItems[0]; _selectedDisplayItem.Shape.Select(true); OnSelectDisplayItem(this, _selectedDisplayItem); SelectedDisplayItems.Clear(); } else { // Do nothing... } } } ResetMouse(); }
public void AddDisplayItem(DisplayItem displayItem) { DisplayItems.Add(displayItem); }