예제 #1
0
        /// <summary>
        /// Indicates whether the current object is equal to another <see cref="IPackageId"/>
        /// </summary>
        /// <param name="other">An object to compare with this</param>
        /// <returns>true if the current object is equal to the other <see cref="IPackageId"/>; otherwise, false</returns>
        public bool Equals(IPackageId other)
        {
            var guidMessageId = other as GuidPackageId;

            if (guidMessageId is null)
            {
                return(false);
            }

            return(guidMessageId.guid == guid);
        }
예제 #2
0
        private void GetPackage_Click(object sender, EventArgs e)
        {
            Package package = Package.Current;

            IPackageId packageId = package.Id;

            StringBuilder builder = new StringBuilder();

            builder.AppendLine($"Name: {packageId.Name}");
            builder.AppendLine($"Version: {this.GetVersionString(packageId.Version)}");
            builder.AppendLine($"FullName: {packageId.FullName}");
            builder.AppendLine($"DisplayName: {package.DisplayName}");
            builder.AppendLine($"InstalledLocation: {package.InstalledLocation.Path}");
            builder.AppendLine($"Logo: {package.Logo.AbsoluteUri}");
            builder.AppendLine($"IsDevelopmentMode: {package.IsDevelopmentMode}");
            builder.AppendLine($"InstalledDate: {package.InstalledDate:g}");

            this.outputText.Text = builder.ToString();
        }
예제 #3
0
 /// <summary>
 /// Initializes an instance of <see cref="DataPackage{T}"/>
 /// </summary>
 /// <param name="id">Package identifier</param>
 /// <param name="data">Package body and data</param>
 public DataPackage(IPackageId id, T data)
     : base(id)
 {
     Data = data ?? throw new ArgumentNullException(nameof(data));
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of <see cref="ExceptionMessage{T}"/>
 /// </summary>
 /// <param name="id">Message identifier</param>
 /// <param name="exception">Exception thrown by the remote process</param>
 public ExceptionPackage(IPackageId id, Exception exception)
     : base(id)
 {
     Exception = exception ?? throw new ArgumentNullException(nameof(exception));
 }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of <see cref="Package"/>
 /// </summary>
 /// <param name="id">Package identifier</param>
 public Package(IPackageId id)
 {
     Id = id ?? throw new ArgumentNullException(nameof(id));
 }