private void btnClose_Click(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(this.ItemName.Trim())) { itemdata.Name = this.ItemName; } if (!string.IsNullOrEmpty(this.Path.Trim())) { itemdata.Path = this.Path; } if (!string.IsNullOrEmpty(this.Arguments.Trim())) { itemdata.Arguments = this.Arguments; } if (!string.IsNullOrEmpty(this.WorkingDirectory.Trim())) { itemdata.WorkingDirectory = this.WorkingDirectory; } if (this.ItemIcon != null && this.itemdata.IconChanged) { itemdata.Icon_imagesource = this.ItemIcon; itemdata.Icon_byte = GetIcon.ImageSourceToByteArray(this.ItemIcon); } if (!string.IsNullOrEmpty(this.TagName.Trim())) { itemdata.TagName = TagName; } if (this.txtHotKey.Available) { this.itemdata.AddHotKey(this.txtHotKey); } else { this.itemdata.RemoveHotKey(); } Manage.RefreshSingle(item, itemdata); this.Close(); }
private void SaveSettings() { if (!string.IsNullOrEmpty(this.ItemName)) { itemdata.Name = this.ItemName; } if (!string.IsNullOrEmpty(this.Path)) { itemdata.Path = this.Path; } if (!string.IsNullOrEmpty(this.Arguments)) { itemdata.Arguments = this.Arguments; } if (!string.IsNullOrEmpty(this.WorkingDirectory)) { itemdata.WorkingDirectory = this.WorkingDirectory; } if (this.ItemIcon != null && this.itemdata.IconChanged) { itemdata.Icon = GetIcon.ImageSourceToByteArray(this.ItemIcon); } itemdata.TagName = TagName; if (this.txtHotKey.Available) { this.itemdata.AddHotKey(this.txtHotKey); } else { this.itemdata.RemoveHotKey(); } Manage.RefreshSingle(item, itemdata); this.Close(); }