AcManager.Controls.Helpers.ShellLink.Save C# (CSharp) Метод

Save() публичный Метод

public Save ( ) : void
Результат void
        public void Save() {
            string file = ShortcutFile;

            if (file == null)
                throw new InvalidOperationException("File name is not given.");
            else
                Save(file);
        }

Same methods

ShellLink::Save ( string file ) : void

Usage Example

Пример #1
0
        public static void CreateShortcut()
        {
            if (HasShortcut())
            {
                return;
            }

            try {
                var directory = Path.GetDirectoryName(ShortcutLocation) ?? "";
                if (!Directory.Exists(directory))
                {
                    Directory.CreateDirectory(directory);
                }

                using (var shortcut = new ShellLink()) {
                    shortcut.TargetPath     = System.Reflection.Assembly.GetEntryAssembly().Location;
                    shortcut.Arguments      = "";
                    shortcut.AppUserModelID = AppUserModelId;
                    shortcut.Save(ShortcutLocation);
                }

                CreateShortcutCommand.RaiseCanExecuteChanged();
                DeleteShortcutCommand.RaiseCanExecuteChanged();
            } catch (Exception e) {
                NonfatalError.NotifyBackground("Can’t create shortcut", e);
            }
        }
All Usage Examples Of AcManager.Controls.Helpers.ShellLink::Save