public DDO_Shortcut(int charId, byte pos, ShortcutType type, long data) { m_charId = charId; m_position = pos; m_type = type; m_data = data; }
/// <summary> /// Add shortcut to <see cref="ActionSet"/> to supplied <see cref="UILocation"/>. /// </summary> public void AddShortcut(UILocation location, ShortcutType type, uint objectId, byte tier) { if (actions.TryGetValue(location, out ActionSetShortcut shortcut) && !shortcut.PendingDelete) { throw new InvalidOperationException($"Failed to add shortcut {type} {objectId} to {location}, location is occupied!"); } if (type == ShortcutType.Spell) { checked { TierPoints -= CalculateTierCost(tier); } } if (shortcut != null) { shortcut.EnqueueDelete(false); shortcut.ShortcutType = type; shortcut.ObjectId = objectId; shortcut.Tier = tier; } else { actions.Add(location, new ActionSetShortcut(this, location, type, objectId, tier)); } saveMask |= ActionSetSaveMask.ActionSetActions; log.Trace($"Added shortcut {type} {objectId} at {location} to action set {Index}."); }
private void ShortcutTypeChanged(object sender, SelectionChangedEventArgs e) { if (!eventBlock) { List <Core.DataStructures.Action> oldActions = Shortcut.Actions.Select(a => a.Duplicate()).ToList(); ShortcutType oldType = ShortcutType; ShortcutType = (ShortcutType)ShortcutTypeComboBox.SelectedIndex; SetDefaultAction(); SetIcon(); InitUiBasedOnType(); SetFieldValuesFromShortcut(); if ((oldType != ShortcutType.Multi) && (ShortcutType == ShortcutType.Multi)) { MultiUi_ShortcutsParent.Children.Clear(); CreateGroupActions(new List <Core.DataStructures.Action>() { oldActions[0] }); } if ((oldType == ShortcutType.Multi) && (ShortcutType != ShortcutType.Multi) && (oldActions.Count == 1)) { if (oldActions[0].ToShortcutType() == ShortcutType) { Shortcut.Actions[0] = oldActions[0]; SetFieldValuesFromShortcut(); } } } eventBlock = false; }
private Icon getIcon(ShortcutType type) { var resourceId = 0; switch (type) { case ShortcutType.ContinueLastTimeEntry: resourceId = Resource.Drawable.play; break; case ShortcutType.Reports: resourceId = Resource.Drawable.reports_dark; break; case ShortcutType.StartTimeEntry: resourceId = Resource.Drawable.play; break; case ShortcutType.StopTimeEntry: resourceId = Resource.Drawable.stop_white; break; } var icon = Icon.CreateWithResource(context, resourceId); return(icon); }
public Shortcut() { this.nameProp = new NameProperty(); this.Name = ""; //assign the type of the shortcut if (this is WebPageShortcut) { this.type = ShortcutType.WebPage; } else if (this is MSEdgeShortcut) { this.type = ShortcutType.MSEdge; } else if (this is FileShortcut) { this.type = ShortcutType.File; } else if (this is FolderShortcut) { this.type = ShortcutType.Folder; } else if (this is BatchShortcut) { this.type = ShortcutType.Batch; } }
public void AddShortcut(string[] ss, ShortcutType ShortType, bool RemoveOld) { if (RemoveOld) { this.RemoveShortcut(ShortType); } string[] textArray1 = ss; for (int num2 = 0; num2 < textArray1.Length; num2++) { string text1 = textArray1[num2]; int num1 = text1.IndexOf('('); string text2 = text1; if (num1 >= 0) { text2 = text2.Substring(0, num1); } num1 = text2.LastIndexOf('.'); if (num1 >= 0) { text2 = text2.Substring(num1 + 1); } object[] objArray1 = new object[5] { (int)ShortType, text2, text1, text1, text1 }; this.dtSymbol.Rows.Add(objArray1); } }
public void SetConsumable(int id) { mID = id; mConsumable = InventoryManager.Instance.GetItemById(mID) as Consumable; mIcon.gameObject.SetActive(true); mIcon.sprite = Resources.Load <Sprite>(mConsumable.Sprite); type = ShortcutType.Consumable; }
/// <summary> /// Return <see cref="ActionSetShortcut"/> with supplied <see cref="ShortcutType"/> and object id. /// </summary> public ActionSetShortcut GetShortcut(ShortcutType type, uint objectId) { ActionSetShortcut shortcut = actions.Values .Where(a => !a.PendingDelete) .SingleOrDefault(a => a.ShortcutType == type && a.ObjectId == objectId); return(shortcut); }
public static NO_Shortcut GetShortcut(this NetDataReader reader) { ShortcutType type = (ShortcutType)reader.GetByte(); byte placement = reader.GetByte(); long data = reader.GetLong(); return(new NO_Shortcut(type, placement, data)); }
public void SetSkill(int id) { mID = id; mInfo = SkillManager.Instance.GetSkillByID(id); mIcon.gameObject.SetActive(true); mIcon.sprite = Resources.Load <Sprite>(mInfo.Sprite); type = ShortcutType.Skill; }
internal ShortcutEntry(Identifier id, IEnumerable <KeyCombination> defaultCombination, Action <ShortcutArguments> action, Type context, ShortcutType type) { m_Identifier = id; m_DefaultCombinations = defaultCombination.ToList(); m_Context = context ?? ContextManager.globalContextType; m_Action = action; m_Type = type; }
public ShortcutInfo(Keys key, bool shift, bool control, bool alt, ShortcutType shortcutType) { Key = key; Shift = shift; Control = control; Alt = alt; ShortcutType = shortcutType; }
public void AddShortcut(DataTable dt, ShortcutType ShortType) { this.RemoveShortcut(ShortType); this.htSymbol.Clear(); foreach (DataRow row1 in dt.Rows) { this.AddShortcut(row1, ShortType); } }
internal ShortcutEntry(Identifier id, List <KeyCombination> defaultCombination, Action <ShortcutArguments> action, Type context, ShortcutType type, KeyCombination?prefKeyMigratedValue = null) { m_Identifier = id; m_DefaultCombinations = new List <KeyCombination>(defaultCombination); m_Context = context; m_Action = action; m_Type = type; this.prefKeyMigratedValue = prefKeyMigratedValue; }
private void SymbolForm_KeyDown(object sender, KeyEventArgs e) { Keys keys1 = e.KeyCode; if (keys1 != Keys.Return) { if (keys1 == Keys.Escape) { base.Close(); return; } return; } if ((this.dgSymbol.CurrentRowIndex < 0) || (this.dgSymbol.CurrentRowIndex >= this.dvSymbol.Count)) { base.Close(); return; } string text1 = this.dgSymbol[this.dgSymbol.CurrentRowIndex, 2].ToString(); ShortcutType type1 = (ShortcutType)int.Parse(this.dgSymbol[this.dgSymbol.CurrentRowIndex, 0].ToString()); if (base.Owner is ChartForm) { switch (type1) { case ShortcutType.Stock: { if (this.dgSymbol.CurrentRowIndex >= 0) { ChartForm.OpenChartForm(text1, base.Owner.MdiParent, false); } if (type1 == ShortcutType.Folder) { ListForm.Current.FolderId = int.Parse(text1); ListForm.Current.Activate(); } } break; case ShortcutType.Indicator: { (base.Owner as ChartForm).ChartControl.SetAreaByName(text1); if (type1 == ShortcutType.Folder) { ListForm.Current.FolderId = int.Parse(text1); ListForm.Current.Activate(); } } break; } } else if ((base.Owner is ListForm) && (type1 == ShortcutType.Stock)) { ListForm.Current.GotoSymbol(text1); } }
public ApplicationShortcut( string url, string title, string subtitle, ShortcutType type) { Url = url; Type = type; Title = title; Subtitle = subtitle; }
public Shortcut(int slotIndex, ShortcutType type, uint objId, ShortcutObjectType shortcutObjectType, uint objIndex, uint userId, uint objData, string text) { SlotIndex = slotIndex; Type = type; ObjectId = objId; ObjectType = shortcutObjectType; ObjectIndex = objIndex; UserId = userId; ObjectData = objData; Text = text; }
public AddTaskbarAppletEventArgs(int slotIndex, ShortcutType type, uint objId, ShortcutObjectType objectType, uint objIndex, uint userId, uint objData, string text) { SlotIndex = slotIndex; Type = type; ObjId = objId; ObjectType = objectType; ObjIndex = objIndex; UserId = userId; ObjData = objData; Text = text; }
public void RemoveShortcut(ShortcutType ShortType) { for (int num1 = 0; num1 < this.dtSymbol.Rows.Count; num1++) { DataRow row1 = this.dtSymbol.Rows[num1]; int num2 = (int)ShortType; if (row1[0].ToString() == num2.ToString()) { this.dtSymbol.Rows.Remove(row1); continue; } } }
private ShortcutInfo GetShortcutInfo(string str, ShortcutType shortcutType) { Keys key = Keys.None; GetModifiers(str, out key, out bool ctrl, out bool shift, out bool alt); if (key != Keys.None) { return(new ShortcutInfo(key, shift, ctrl, alt, shortcutType)); } return(null); }
public DbShortcut(ShortcutTaskbarTarget targetTaskbar, int?slotLevelIndex, int slotIndex, ShortcutType type, uint objectId, ShortcutObjectType objectType, uint objectIndex, uint userId, uint objectData, string text) { TargetTaskbar = targetTaskbar; SlotLevelIndex = slotLevelIndex; SlotIndex = slotIndex; Type = type; ObjectId = objectId; ObjectType = objectType; ObjectIndex = objectIndex; UserId = userId; ObjectData = objectData; Text = text; }
public static ShortcutType GetShortcutType(string destination, out string newDestination) { newDestination = destination; var type = new ShortcutType(); if (IsCLSIDKey(destination)) { type = ShortcutType.CLSIDKey; } else if (IsValidUrl(destination, out string url1)) { newDestination = url1; type = ShortcutType.Url; } else if (IsValidUrlFile(destination, out string url2)) { newDestination = url2; type = ShortcutType.Url; } else { destination = Path.GetFullPath(destination); newDestination = destination; var attributes = File.GetAttributes(destination); if ((attributes & FileAttributes.Directory) == FileAttributes.Directory) { type = ShortcutType.Folder; } else if (File.Exists(destination)) { if (destination.ToLower() == @"C:\Windows\System32\drivers\etc\hosts".ToLower() || destination.ToLower() == @"%windir%\System32\drivers\etc\hosts".ToLower()) { type = ShortcutType.HostsFile; } else { IsLink(destination, out newDestination); type = ShortcutType.File; } } else { type = ShortcutType.Unknown; } } return(type); }
public int AddShortcut(string name, ShortcutType type, string targetPath, string standardDestinationPath) { var shortcutId = lastUsedShortcutId++; _shortcuts.Add(new Shortcut { ShortcutId = shortcutId, Name = name, TargetPath = targetPath, StandardDestinationPath = standardDestinationPath }); return shortcutId; }
internal ShortcutEntry(Identifier id, IEnumerable <KeyCombination> defaultCombination, Action <ShortcutArguments> action, Type context, ShortcutType type) { m_Identifier = id; m_DefaultCombinations = defaultCombination.ToList(); m_Context = context ?? ContextManager.globalContextType; m_Action = action; m_Type = type; if (typeof(IShortcutToolContext).IsAssignableFrom(m_Context)) { foreach (var attribute in m_Context.GetCustomAttributes(typeof(ReserveModifiersAttribute), true)) { m_ReservedModifier |= (attribute as ReserveModifiersAttribute).modifier; } } }
public Shortcut () { this.nameProp = new NameProperty (); this.Name = ""; //assign the type of the shortcut if (this is WebPageShortcut) { this.type = ShortcutType.WebPage; } else if (this is MSEdgeShortcut) { this.type = ShortcutType.MSEdge; } else if (this is FileShortcut) { this.type = ShortcutType.File; } else if (this is FolderShortcut) { this.type = ShortcutType.Folder; } else if (this is BatchShortcut) { this.type = ShortcutType.Batch; } }
private void InitControl(ShortcutType shortcutType) { ShortcutType = shortcutType; // Set up the underlying Shortcut class Shortcut = new Shortcut(); eventBlock = true; Shortcut.Name = "My Shortcut"; SetDefaultAction(); // Set up right UI: SetIcon(); InitUiBasedOnType(); SetFieldValuesFromShortcut(); eventBlock = false; }
public void ConsumableUse() { bool success = ConsumablePanel.Instance.ReduceItem(mID); if (success) { for (int i = 0; i < mConsumable.ApplyAttrEffects.Count; i++) { AttrManager.Instance.ChangeAttrByType(mPlayerAct.gameObject, mConsumable.ApplyAttrEffects[i]); } if (ConsumablePanel.Instance.CheckItemCount(InventoryManager.Instance.GetItemById(mID)) <= 0) { type = ShortcutType.None; mIcon.gameObject.SetActive(false); } } }
/// <summary> /// Draws a shortcut type. /// </summary> /// <param name="shortcutType">Shortcut type to be drawn.</param> private void DrawItem(ShortcutType shortcutType, float columnWidth) { EditorGUILayout.BeginVertical(GUILayout.Width(columnWidth)); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label(shortcutType.columnTitle); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); if (shortcutType.guids.Count == 0) { EditorGUILayout.HelpBox("No shortcuts available.", MessageType.Info); } else { foreach (var guid in shortcutType.guids) { var path = AssetDatabase.GUIDToAssetPath(guid); var fileName = Path.GetFileNameWithoutExtension(path); if (GUILayout.Button(fileName)) { if (shortcutType.typeName == "Scene") { #if UNITY_5_3_OR_NEWER if (EditorSceneManager.SaveCurrentModifiedScenesIfUserWantsTo()) { EditorSceneManager.OpenScene(path, OpenSceneMode.Single); } #else EditorApplication.OpenScene(path); #endif } else { var type = TypeUtils.GetShortcutType(shortcutType.typeName); var asset = AssetDatabase.LoadAssetAtPath(path, type); AssetDatabase.OpenAsset(asset); } } } } EditorGUILayout.EndVertical(); }
public void AddShortcut(DataRow dr, ShortcutType ShortType) { string text1 = dr["Code"].ToString(); object[] objArray1 = new object[5] { (int)ShortType, text1, text1, dr["Name"], text1 }; this.dtSymbol.Rows.Add(objArray1); object[] objArray2 = new object[5] { (int)ShortType, this.GetChineseShortcut(dr["Name"].ToString()), text1, dr["Name"], text1 }; this.dtSymbol.Rows.Add(objArray2); if (ShortType == ShortcutType.Stock) { this.htSymbol[text1] = dr; } }
public void LoadShortcutsFromRegistry() { RegistryKey rootKey = RegistryHelper.OpenAppPaths(); string [] keyNames = rootKey.GetSubKeyNames(); foreach (string keyName in keyNames) { if (Regex.Match(keyName, @"\.exe$", RegexOptions.IgnoreCase).Success) { RegistryKey key = rootKey.OpenSubKey(keyName, true); Shortcut shortcut = null; //figure out the shortcut type from the type key ShortcutType type = (ShortcutType)Enum.Parse(typeof(ShortcutType), key.GetValue(Shortcut.TypeKeyName).ToString()); //create appropriate shortcut instance based on type if (type == ShortcutType.Batch) { shortcut = new BatchShortcut(key); } else if (type == ShortcutType.File) { shortcut = new FileShortcut(key); } else if (type == ShortcutType.Folder) { shortcut = new FolderShortcut(key); } else if (type == ShortcutType.WebPage) { shortcut = new WebPageShortcut(key); } else if (type == ShortcutType.MSEdge) { shortcut = new MSEdgeShortcut(key); } this.Add(shortcut); } } rootKey.Close(); }
public static string GetStartupShortcut(string product, ShortcutType shortcutType) { string startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup); startupPath = Path.Combine(startupPath, product); switch (shortcutType) { case ShortcutType.Application: startupPath += ".appref-ms"; break; case ShortcutType.Url: startupPath += ".url"; break; } return(startupPath); }
/// <summary> /// Draws the object list of the shortcut type. /// </summary> /// <param name="shortcutType">Shortcut type to be drawn.</param> private void DrawTypeObjects(ShortcutType shortcutType) { var guids = AssetUtils.GetAssetsGuid(shortcutType.typeName); if (guids.Length == 0) { EditorGUILayout.HelpBox("There are no objects for the selected type.", MessageType.Info); } foreach (var guid in guids) { var exists = false; //Checks whether the asset exists. foreach (var guidOnItem in shortcutType.guids) { if (guidOnItem == guid) { exists = true; break; } } //Check asset selection. EditorGUILayout.BeginHorizontal(); var selected = EditorGUILayout.Toggle(exists, GUILayout.Width(30)); EditorGUILayout.LabelField(AssetDatabase.GUIDToAssetPath(guid)); EditorGUILayout.EndHorizontal(); if (selected && !exists) { shortcutType.guids.Add(guid); } else if (!selected && exists) { shortcutType.guids.Remove(guid); } } //Removes any empty elements from objects. shortcutType.guids.Remove(string.Empty); }
public ShortcutInformation(ShortcutType type, string description) { ShortcutType = type; ShortcutDescription = description; }
// stuff that still needs to be converted from WiX v1 // Sub ProcessSFPCatalogElement(node, sDependency) // Dim op, row, attribute, child, sName, sSrc // // Set row = CreateRecord(UBound(SFPCatalogTable)) // For Each attribute In node.Attributes // Select Case(attribute.name) // Case "op" : op = attribute.value // Case "Name" : sName = attribute.value // Case "Dependency" : If IsEmpty(sDependency) Then sDependency = attribute.value Else Fail 0, 3022, "child SFPCatalog cannot have dependency outside of parent" // Case "src" : sSrc = BaseDir(attribute.value) // Case Else : Unexpected attribute, node // End Select // Next // If IsEmpty(sName) Then Fail 0, 3023, "Must specify a SFPCatalog.Name" // If ElementHasText(node) Then Fail 0, 0, "robmen - SFP Catalogs stored as hex in XML not currently supported, use src attribute instead" // If Not fso.FileExists(sSrc) Then Fail 0, 3024, "Missing sfp catalog file: " & sSrc // // If fVerbose Then WScript.Echo "SFPCatalog reading catalog from src: " & sSrc // row.StringData(SFPCatalog_SFPCatalog) = sName // row.SetStream SFPCatalog_Catalog, sSrc : CheckError 0 // row.StringData(SFPCatalog_Dependency) = sDependency // DoAction SFPCatalogTable, op, row // // For Each child In node.childNodes // Select Case (GetElementName(child)) // Case Empty // Case "SFPCatalog" : ProcessSFPCatalogElement child, sName // Case "File" : ProcessFileSFPCatalogElement child, sName // Case Else : Unexpected child, node // End Select // Next // End Sub // // // Sub ProcessFileSFPCatalogElement(node, sSFPCatalog) // Dim op, row, attribute // // Set row = CreateRecord(UBound(FileSFPCatalogTable)) // For Each attribute In node.Attributes // Select Case(attribute.name) // Case "op" : op = attribute.value // Case Else : Unexpected attribute, node // End Select // Next // // row.StringData(FileSFPCatalog_File_) = ElementText(node) // row.StringData(FileSFPCatalog_SFPCatalog_) = sSFPCatalog // DoAction FileSFPCatalogTable, op, row // End Sub /// <summary> /// Parses a shortcut element. /// </summary> /// <param name="node">Element to parse.</param> /// <param name="componentId">Identifer for parent component.</param> /// <param name="targetType">Target type of shortcut (directory or file)</param> /// <param name="targetId">Default identifier of target.</param> private void ParseShortcutElement(XmlNode node, string componentId, ShortcutType targetType, string targetId) { SourceLineNumberCollection sourceLineNumbers = this.core.GetSourceLineNumbers(node); string id = null; bool advertise = false; string arguments = null; string description = null; string descriptionResourceDll = null; int descriptionResourceId = CompilerCore.IntegerNotSet; string directory = null; string displayResourceDll = null; int displayResourceId = CompilerCore.IntegerNotSet; int hotkey = CompilerCore.IntegerNotSet; string icon = null; int iconIndex = CompilerCore.IntegerNotSet; string longName = null; string name = null; int show = CompilerCore.IntegerNotSet; string target = null; string workingDirectory = null; foreach (XmlAttribute attrib in node.Attributes) { switch (attrib.LocalName) { case "Id": id = this.core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); break; case "Advertise": advertise = YesNoType.Yes == this.core.GetAttributeYesNoValue(sourceLineNumbers, attrib); break; case "Arguments": arguments = this.core.GetAttributeValue(sourceLineNumbers, attrib); break; case "Description": description = this.core.GetAttributeValue(sourceLineNumbers, attrib); break; case "DescriptionResourceDll": descriptionResourceDll = this.core.GetAttributeValue(sourceLineNumbers, attrib); break; case "DescriptionResourceId": descriptionResourceId = this.core.GetAttributeIntegerValue(sourceLineNumbers, attrib); break; case "Directory": directory = this.core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); this.core.AddValidReference("Directory", directory); break; case "DisplayResourceDll": displayResourceDll = this.core.GetAttributeValue(sourceLineNumbers, attrib); break; case "DisplayResourceId": displayResourceId = this.core.GetAttributeIntegerValue(sourceLineNumbers, attrib); break; case "Hotkey": hotkey = this.core.GetAttributeIntegerValue(sourceLineNumbers, attrib); break; case "Icon": icon = this.core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); this.core.AddValidReference("Icon", icon); break; case "IconIndex": iconIndex = this.core.GetAttributeIntegerValue(sourceLineNumbers, attrib); break; case "LongName": longName = this.core.GetAttributeLongFilename(sourceLineNumbers, attrib); break; case "Name": name = this.core.GetAttributeShortFilename(sourceLineNumbers, attrib); break; case "Show": string showValue = this.core.GetAttributeValue(sourceLineNumbers, attrib); switch (showValue) { case CompilerCore.IllegalEmptyAttributeValue: show = CompilerCore.IllegalInteger; break; case "normal": show = 1; break; case "maximized": show = 3; break; case "minimized": show = 7; break; default: this.core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name, "Show", showValue, "normal", "maximized", "minimized")); show = CompilerCore.IllegalInteger; break; } break; case "Target": target = this.core.GetAttributeValue(sourceLineNumbers, attrib); break; case "WorkingDirectory": workingDirectory = this.core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); break; } } if (advertise && null != target) { this.core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name, "Target", "Advertise", "yes")); } if (null != descriptionResourceDll) { if (CompilerCore.IntegerNotSet == descriptionResourceId) { this.core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name, "DescriptionResourceDll", "DescriptionResourceId")); } } else { if (CompilerCore.IntegerNotSet != descriptionResourceId) { this.core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name, "DescriptionResourceId", "DescriptionResourceDll")); } } if (null != displayResourceDll) { if (CompilerCore.IntegerNotSet == displayResourceId) { this.core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name, "DisplayResourceDll", "DisplayResourceId")); } } else { if (CompilerCore.IntegerNotSet != displayResourceId) { this.core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name, "DisplayResourceId", "DisplayResourceDll")); } } foreach (XmlNode child in node.ChildNodes) { if (XmlNodeType.Element == child.NodeType) { switch (child.LocalName) { case "Icon": this.ParseBinaryOrIconElement(child, BinaryType.Icon); break; } } } Row row = this.core.CreateRow(sourceLineNumbers, "Shortcut"); row[0] = id; row[1] = directory; row[2] = GetMsiFilenameValue(name, longName); row[3] = componentId; if (advertise) { row[4] = Guid.Empty.ToString("B"); this.core.AddFeatureBacklink(new FeatureBacklink(componentId, FeatureBacklinkType.Shortcut, row.Symbol)); } else if (null != target) { row[4] = target; } else if (ShortcutType.Directory == targetType) { row[4] = String.Format(CultureInfo.InvariantCulture, "[{0}]", targetId); } else if (ShortcutType.File == targetType) { row[4] = String.Format(CultureInfo.InvariantCulture, "[#{0}]", targetId); } row[5] = arguments; row[6] = description; if (CompilerCore.IntegerNotSet != hotkey) { row[7] = hotkey; } row[8] = icon; if (CompilerCore.IntegerNotSet != iconIndex) { row[9] = iconIndex; } if (CompilerCore.IntegerNotSet != show) { row[10] = show; } row[11] = workingDirectory; row[12] = displayResourceDll; if (CompilerCore.IntegerNotSet != displayResourceId) { row[13] = displayResourceId; } row[14] = descriptionResourceDll; if (CompilerCore.IntegerNotSet != descriptionResourceId) { row[15] = descriptionResourceId; } }
public static string GetStartupShortcut(string product, ShortcutType shortcutType) { string startupPath = Environment.GetFolderPath(Environment.SpecialFolder.Startup); startupPath = Path.Combine(startupPath, product); switch (shortcutType) { case ShortcutType.Application: startupPath += ".appref-ms"; break; case ShortcutType.Url: startupPath += ".url"; break; } return startupPath; }
public static Boolean DoesStartupShortcutExist(string product, ShortcutType shortcutType) { String file = GetStartupShortcut(product, shortcutType); return File.Exists(file); }