Esempio n. 1
0
 public PutRequest(ResourceURI ResourceURI, Locale Locale, SelectorSet SelectorSet, System.Xml.XmlElement Body)
 {
     this.ResourceURI = ResourceURI;
     this.Locale      = Locale;
     this.SelectorSet = SelectorSet;
     this.Body        = Body;
 }
Esempio n. 2
0
 public MediaQuery(
     SelectorSet selectors,
     IEnumerable <SelectorSet> parentSelectors,
     int sourceLineIndex,
     IEnumerable <ICSSFragment> childFragments) : base(selectors, parentSelectors, sourceLineIndex, childFragments)
 {
     // The "selectors" argument can't be null at this point as the ContainerFragment base class would have already thrown an ArgumentNullException
     if (!selectors.First().Value.StartsWith("@media", StringComparison.InvariantCultureIgnoreCase))
     {
         throw new ArgumentException("The content indicates that this should be a Selector, not a Media Query");
     }
 }
Esempio n. 3
0
        private static SelectorSet CreateSelectorSet(string selectorName, string selectorValue)
        {
            SelectorSet selectorSet = null;

            if (selectorName != null)
            {
                selectorSet          = new SelectorSet();
                selectorSet.Selector = new Selector[] {
                    new Selector()
                    {
                        Name = selectorName,
                        Text = new string[] {
                            selectorValue
                        }
                    }
                };
            }
            return(selectorSet);
        }
        public ContainerFragment(
            SelectorSet selectors,
            IEnumerable <SelectorSet> parentSelectors,
            int sourceLineIndex,
            IEnumerable <ICSSFragment> childFragments)
        {
            if (selectors == null)
            {
                throw new ArgumentNullException("selectors");
            }
            if (parentSelectors == null)
            {
                throw new ArgumentNullException("parentSelectors");
            }
            if (sourceLineIndex < 0)
            {
                throw new ArgumentNullException("sourceLineIndex", "must be zero or greater");
            }
            if (childFragments == null)
            {
                throw new ArgumentNullException("childFragments");
            }

            var parentSelectorsTidied = parentSelectors.ToList();

            if (parentSelectorsTidied.Any(s => s == null))
            {
                throw new ArgumentException("Null reference encountered in parentSelectors set");
            }

            var childFragmentsTidied = childFragments.ToList();

            if (childFragmentsTidied.Any(f => f == null))
            {
                throw new ArgumentException("Null reference encountered in childFragments set");
            }

            Selectors        = selectors;
            SourceLineIndex  = sourceLineIndex;
            _parentSelectors = parentSelectorsTidied;
            _childFragments  = childFragmentsTidied;
        }
Esempio n. 5
0
        // Module defining this command


        // Optional custom code for this activity


        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of System.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker       = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if (ApplicationName.Expression != null)
            {
                targetCommand.AddParameter("ApplicationName", ApplicationName.Get(context));
            }

            if (BasePropertiesOnly.Expression != null)
            {
                targetCommand.AddParameter("BasePropertiesOnly", BasePropertiesOnly.Get(context));
            }

            if ((ComputerName.Expression != null) && (PSRemotingBehavior.Get(context) != RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", ComputerName.Get(context));
            }

            if (ConnectionURI.Expression != null)
            {
                targetCommand.AddParameter("ConnectionURI", ConnectionURI.Get(context));
            }

            if (Dialect.Expression != null)
            {
                targetCommand.AddParameter("Dialect", Dialect.Get(context));
            }

            if (Enumerate.Expression != null)
            {
                targetCommand.AddParameter("Enumerate", Enumerate.Get(context));
            }

            if (Filter.Expression != null)
            {
                targetCommand.AddParameter("Filter", Filter.Get(context));
            }

            if (Fragment.Expression != null)
            {
                targetCommand.AddParameter("Fragment", Fragment.Get(context));
            }

            if (OptionSet.Expression != null)
            {
                targetCommand.AddParameter("OptionSet", OptionSet.Get(context));
            }

            if (Port.Expression != null)
            {
                targetCommand.AddParameter("Port", Port.Get(context));
            }

            if (Associations.Expression != null)
            {
                targetCommand.AddParameter("Associations", Associations.Get(context));
            }

            if (ResourceURI.Expression != null)
            {
                targetCommand.AddParameter("ResourceURI", ResourceURI.Get(context));
            }

            if (ReturnType.Expression != null)
            {
                targetCommand.AddParameter("ReturnType", ReturnType.Get(context));
            }

            if (SelectorSet.Expression != null)
            {
                targetCommand.AddParameter("SelectorSet", SelectorSet.Get(context));
            }

            if (SessionOption.Expression != null)
            {
                targetCommand.AddParameter("SessionOption", SessionOption.Get(context));
            }

            if (Shallow.Expression != null)
            {
                targetCommand.AddParameter("Shallow", Shallow.Get(context));
            }

            if (UseSSL.Expression != null)
            {
                targetCommand.AddParameter("UseSSL", UseSSL.Get(context));
            }

            if (Credential.Expression != null)
            {
                targetCommand.AddParameter("Credential", Credential.Get(context));
            }

            if (Authentication.Expression != null)
            {
                targetCommand.AddParameter("Authentication", Authentication.Get(context));
            }

            if (CertificateThumbprint.Expression != null)
            {
                targetCommand.AddParameter("CertificateThumbprint", CertificateThumbprint.Get(context));
            }

            if (GetIsComputerNameSpecified(context) && (PSRemotingBehavior.Get(context) == RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", PSComputerName.Get(context));
            }

            return(new ActivityImplementationContext()
            {
                PowerShellInstance = invoker
            });
        }
        // Module defining this command


        // Optional custom code for this activity


        /// <summary>
        /// Returns a configured instance of System.Management.Automation.PowerShell, pre-populated with the command to run.
        /// </summary>
        /// <param name="context">The NativeActivityContext for the currently running activity.</param>
        /// <returns>A populated instance of System.Management.Automation.PowerShell</returns>
        /// <remarks>The infrastructure takes responsibility for closing and disposing the PowerShell instance returned.</remarks>
        protected override ActivityImplementationContext GetPowerShell(NativeActivityContext context)
        {
            System.Management.Automation.PowerShell invoker       = global::System.Management.Automation.PowerShell.Create();
            System.Management.Automation.PowerShell targetCommand = invoker.AddCommand(PSCommandName);

            // Initialize the arguments

            if (Action.Expression != null)
            {
                targetCommand.AddParameter("Action", Action.Get(context));
            }

            if (ApplicationName.Expression != null)
            {
                targetCommand.AddParameter("ApplicationName", ApplicationName.Get(context));
            }

            if ((ComputerName.Expression != null) && (PSRemotingBehavior.Get(context) != RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", ComputerName.Get(context));
            }

            if (ConnectionURI.Expression != null)
            {
                targetCommand.AddParameter("ConnectionURI", ConnectionURI.Get(context));
            }

            if (FilePath.Expression != null)
            {
                targetCommand.AddParameter("FilePath", FilePath.Get(context));
            }

            if (OptionSet.Expression != null)
            {
                targetCommand.AddParameter("OptionSet", OptionSet.Get(context));
            }

            if (Port.Expression != null)
            {
                targetCommand.AddParameter("Port", Port.Get(context));
            }

            if (SelectorSet.Expression != null)
            {
                targetCommand.AddParameter("SelectorSet", SelectorSet.Get(context));
            }

            if (SessionOption.Expression != null)
            {
                targetCommand.AddParameter("SessionOption", SessionOption.Get(context));
            }

            if (UseSSL.Expression != null)
            {
                targetCommand.AddParameter("UseSSL", UseSSL.Get(context));
            }

            if (ValueSet.Expression != null)
            {
                targetCommand.AddParameter("ValueSet", ValueSet.Get(context));
            }

            if (ResourceURI.Expression != null)
            {
                targetCommand.AddParameter("ResourceURI", ResourceURI.Get(context));
            }

            if (Credential.Expression != null)
            {
                targetCommand.AddParameter("Credential", Credential.Get(context));
            }

            if (Authentication.Expression != null)
            {
                targetCommand.AddParameter("Authentication", Authentication.Get(context));
            }

            if (CertificateThumbprint.Expression != null)
            {
                targetCommand.AddParameter("CertificateThumbprint", CertificateThumbprint.Get(context));
            }

            if (GetIsComputerNameSpecified(context) && (PSRemotingBehavior.Get(context) == RemotingBehavior.Custom))
            {
                targetCommand.AddParameter("ComputerName", PSComputerName.Get(context));
            }


            return(new ActivityImplementationContext()
            {
                PowerShellInstance = invoker
            });
        }
Esempio n. 7
0
 public GetRequest(ResourceURI ResourceURI, Locale Locale, SelectorSet SelectorSet)
 {
     this.ResourceURI = ResourceURI;
     this.Locale      = Locale;
     this.SelectorSet = SelectorSet;
 }