예제 #1
0
        /// <summary>
        /// Returns the full ClickOnce application identity.
        /// </summary>
        /// <returns>A string containing the ClickOnce application identity.</returns>
        public override string ToString()
        {
            string dname = string.Empty;

            if (_deployManifestIdentity != null)
            {
                dname = _deployManifestIdentity.GetFullName(AssemblyIdentity.FullNameFlags.ProcessorArchitecture);
            }

            string aname = string.Empty;

            if (_applicationManifestIdentity != null)
            {
                aname = _applicationManifestIdentity.GetFullName(AssemblyIdentity.FullNameFlags.ProcessorArchitecture | AssemblyIdentity.FullNameFlags.Type);
            }
            return($"{_url}#{dname}/{aname}");
        }
예제 #2
0
파일: Util.cs 프로젝트: 3F/IeXod
        private static ITaskItem[] RemoveDuplicateItems(ITaskItem[] items)
        {
            if (items == null)
            {
                return(null);
            }
            if (items.Length <= 1)
            {
                return(items);
            }
            var list = new Dictionary <string, ITaskItem>();

            foreach (ITaskItem item in items)
            {
                if (String.IsNullOrEmpty(item.ItemSpec))
                {
                    continue;
                }

                string key;
                var    id = new AssemblyIdentity(item.ItemSpec);
                if (id.IsStrongName)
                {
                    key = id.GetFullName(AssemblyIdentity.FullNameFlags.All);
                }
                else
                {
                    key = Path.GetFullPath(item.ItemSpec).ToUpperInvariant();
                }

                if (!list.ContainsKey(key))
                {
                    list.Add(key, item);
                }
            }

            return(list.Values.ToArray());
        }