コード例 #1
0
        public void OnNamespaceUpdated()
        {
            var isNewNamespace = !AvailableNamespaces.Any(i => i.Namespace == NamespaceName);
            var isValidName    = !isNewNamespace || IsValidNamespace(NamespaceName);

            if (isNewNamespace && isValidName)
            {
                Icon        = KnownMonikers.StatusInformation;
                Message     = ServicesVSResources.A_new_namespace_will_be_created;
                ShowMessage = true;
                CanSubmit   = true;
            }
            else if (!isValidName)
            {
                Icon        = KnownMonikers.StatusInvalid;
                Message     = ServicesVSResources.This_is_an_invalid_namespace;
                ShowMessage = true;
                CanSubmit   = false;
            }
            else
            {
                ShowMessage = false;
                CanSubmit   = true;
            }
        }
コード例 #2
0
        public VkCoreApiBase[] GetAvailableApis(string _namespace)
        {
            var apis = _vkApi.Values.Where(a => a.AvailableNamespaces.Contains(_namespace) || a.AvailableNamespaces.Length == 0);

            if (AvailableNamespaces.Contains(_namespace))
            {
                var _apis = apis.ToList();
                _apis.Add(this);
                return(_apis.ToArray());
            }
            return(apis.ToArray());
        }