working on it ...

Filters

Explore Public Snippets

Sort by

Found 901 snippets matching: filters

    public by cghersi @ MailUp API DEV  1416  30  5  0

    How to Retrieve and filter some lists of recipients with MailUp .NET SDK

    This snippet takes advantage of the MailUp .NET SDK to setup the secure communication towards the server through OAuth2 two leg authentication. You can start digging into the MailUP API world by reading this content: http://help.mailup.com/display/mailupapi/REST+API An instance of MailUpClient class is able to manage one user at a time. A MailU
    public static void GetLists(string clientID, string clientSecret, string username, string password)
    {
        // 1) Setup the MailUp Client:
        MailUpClient client = new MailUpClient(clientID, clientSecret);
        try
        {
            client.RetrieveAccessToken(username, password);
        }
        catch (MailUpException ex)
        {
            Console.WriteLine("Unable to access the service due to " + ex.Message);
            return;
        }
    
        // 2) Prepare the input:
        string filter = "Format.Trim().Equals('html')";
    
        // 3) Invoke the web method:
        CollectionOf<ConsoleListItem> result = null;
        try
        {
            result = client.GetLists(filter);
        }
        catch (Exception ex)
        {
            Console.WriteLine("Cannot perform the operation due to " + ex.Message);
            return;
        }
    
        // 4) Print results:
        if ((result != null) && (result.Count > 0))
            Console.WriteLine("Retrieved Lists:" + result.Count + "; first one with name:" + result[0].Name);
        else
            Console.WriteLine("An error occurred while retrieving the lists.");
    }
    

    public by cghersi  3889  0  5  0

    How to retrieve the clusters which a device is member of in PLAT.ONE

    This snippet describes the use a the VisibleClusterMemberships API , with the adoption of a filter to specify just only the clusters of a single given device
    import java.util.ArrayList;
    import java.util.List;
    
    import com.abodata.plat1.networkInfo.ClusterInfo.Level;
    import com.abodata.plat1.utils.APIFilter;
    import com.abodata.plat1.utils.Plat1CommonUtils;
    import com.abodata.plat1.ws.velocity.IProxyClusterMembership;
    
    public class ClusterManager {
    
    	public static List<Integer> getClustersOfDevice(int deviceID) {
    		
    		// fetch memberships from API:
    		List<APIFilter> filters = new ArrayList<APIFilter>();
    		filters.add(new APIFilter("MemberID", deviceID + ""));
    		List<IProxyClusterMembership> memberships = null;
    		try {
    			memberships = HelloWorldServiceImpl.getAPI().DB_GetVisibleClusterMembership(null, filters, 
    					true, 0, 100, Level.PhysicalNodes);
    		} catch (Exception e) {
    			e.printStackTrace();
    			return null;
    		}
    		
    		//collect results into an array of the ID of the clusters:
    		List<Integer> res = new ArrayList<Integer>();
    		if (Plat1CommonUtils.isNullOrEmpty(memberships))
    			return res;
    		for (IProxyClusterMembership m : memberships) {
    			res.add(m.getClusterId());
    		}
    		
    		return res;
    	}
    }

    public by cghersi  2630  1  5  0

    Index Usage Reporter

    Util_IndexUsage Thanks to Jesse Roberge - YeshuaAgapao@Yahoo.com Update - Fixed existance check for drop Reports index stats, index size+rows, member seek + include columns as two comma separated output columns, and index usage stats for one or more tables and/or schemas. Flexible parameterized sorting. Has all the output of Util_ListIndexes
    SET ANSI_NULLS ON
    SET QUOTED_IDENTIFIER ON
    SET ANSI_PADDING ON
    GO
    
    IF OBJECT_ID('dbo.Util_IndexUsage', 'P') IS NOT NULL DROP PROCEDURE dbo.Util_IndexUsage
    GO
    
    /**
    *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
    Util_IndexUsage
    By Jesse Roberge - YeshuaAgapao@Yahoo.com
    Update - Fixed existance check for drop
    
    Reports index stats, index size+rows, member seek + include columns as two comma separated output columns, and index usage stats for one or more tables and/or schemas.  Flexible parameterized sorting.
    Has all the output of Util_ListIndexes plus the usage stats.
    
    Update 2009-01-14:
    	Added IndexDepth and FillFactor output columns
    	Added 'Last xxx' datetime columns to the result set
    	Added @Delimiter parameter for the column listing output (Defaults to ,) for accomodating export to csv files.
    	Rearranged collumn output to match the pattern in Util_MissingIndexes. Constistant and looks better with the dates.
    	Removed duplicate output of 'is_unique'
    
    Required Input Parameters
    	none
    
    Optional
    	@SchemaName sysname=''		Filters schemas.  Can use LIKE wildcards.  All schemas if blank.  Accepts LIKE Wildcards.
    	@TableName sysname=''		Filters tables.  Can use LIKE wildcards.  All tables if blank.  Accepts LIKE Wildcards.
    	@Sort Tinyint=5				Determines what to sort the results by:
    									Value	Sort Columns
    									1		Score DESC, user_seeks DESC, user_scans DESC
    									2		Score ASC, user_seeks ASC, user_scans ASC
    									3		SchemaName ASC, TableName ASC, IndexName ASC
    									4		SchemaName ASC, TableName ASC, Score DESC
    									5		SchemaName ASC, TableName ASC, Score ASC
    	@Delimiter VarChar(1)=','	Delimiter for the horizontal delimited seek and include column listings.
    
    Usage:
    	EXECUTE Util_IndexUsage 'dbo', 'order%', 5, '|'
    
    Copyright:
    	Licensed under the L-GPL - a weak copyleft license - you are permitted to use this as a component of a proprietary database and call this from proprietary software.
    	Copyleft lets you do anything you want except plagarize, conceal the source, proprietarize modifications, or prohibit copying & re-distribution of this script/proc.
    
    	This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU Lesser General Public License as
        published by the Free Software Foundation, either version 3 of the
        License, or (at your option) any later version.
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU Lesser General Public License for more details.
    
        see <http://www.fsf.org/licensing/licenses/lgpl.html> for the license text.
    
    *=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
    **/
    
    CREATE PROCEDURE dbo.Util_IndexUsage
    	@SchemaName SysName='',
    	@TableName SysName='',
    	@Sort tinyint=5,
    	@Delimiter VarChar(1)=','
    AS
    
    SELECT
    	sys.schemas.schema_id, sys.schemas.name AS schema_name,
    	sys.objects.object_id, sys.objects.name AS object_name,
    	sys.indexes.index_id, ISNULL(sys.indexes.name, '---') AS index_name,
    	partitions.Rows, partitions.SizeMB, IndexProperty(sys.objects.object_id,
    	sys.indexes.name, 'IndexDepth') AS IndexDepth,
    	sys.indexes.type, sys.indexes.type_desc, sys.indexes.fill_factor,
    	sys.indexes.is_unique, sys.indexes.is_primary_key, sys.indexes.is_unique_constraint,
    	ISNULL(Index_Columns.index_columns_key, '---') AS index_columns_key,
    	ISNULL(Index_Columns.index_columns_include, '---') AS index_columns_include,
    	ISNULL(sys.dm_db_index_usage_stats.user_seeks,0) AS user_seeks,
    	ISNULL(sys.dm_db_index_usage_stats.user_scans,0) AS user_scans,
    	ISNULL(sys.dm_db_index_usage_stats.user_lookups,0) AS user_lookups,
    	ISNULL(sys.dm_db_index_usage_stats.user_updates,0) AS user_updates,
    	sys.dm_db_index_usage_stats.last_user_seek, sys.dm_db_index_usage_stats.last_user_scan,
    	sys.dm_db_index_usage_stats.last_user_lookup, sys.dm_db_index_usage_stats.last_user_update,
    	ISNULL(sys.dm_db_index_usage_stats.system_seeks,0) AS system_seeks,
    	ISNULL(sys.dm_db_index_usage_stats.system_scans,0) AS system_scans,
    	ISNULL(sys.dm_db_index_usage_stats.system_lookups,0) AS system_lookups,
    	ISNULL(sys.dm_db_index_usage_stats.system_updates,0) AS system_updates,
    	sys.dm_db_index_usage_stats.last_system_seek, sys.dm_db_index_usage_stats.last_system_scan,
    	sys.dm_db_index_usage_stats.last_system_lookup, sys.dm_db_index_usage_stats.last_system_update,
    	(
    		(
    			(CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_seeks,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_seeks,0)))*10
    			+ CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_scans,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_scans,0)))*1 ELSE 0 END
    			+ 1
    		)
    		/CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_updates,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_updates,0))+1) ELSE 1 END
    	) AS Score
    FROM
    	sys.objects
    	JOIN sys.schemas ON sys.objects.schema_id=sys.schemas.schema_id
    	JOIN sys.indexes ON sys.indexes.object_id=sys.objects.object_id
    	JOIN (
    		SELECT
    			object_id, index_id, SUM(row_count) AS Rows,
    			CONVERT(numeric(19,3), CONVERT(numeric(19,3), SUM(in_row_reserved_page_count+lob_reserved_page_count+row_overflow_reserved_page_count))/CONVERT(numeric(19,3), 128)) AS SizeMB
    		FROM sys.dm_db_partition_stats
    		GROUP BY object_id, index_id
    	) AS partitions ON sys.indexes.object_id=partitions.object_id AND sys.indexes.index_id=partitions.index_id
    	CROSS APPLY (
    		SELECT
    			LEFT(index_columns_key, LEN(index_columns_key)-1) AS index_columns_key,
    			LEFT(index_columns_include, LEN(index_columns_include)-1) AS index_columns_include
    		FROM
    			(
    				SELECT
    					(
    						SELECT sys.columns.name + @Delimiter + ' '
    						FROM
    							sys.index_columns
    							JOIN sys.columns ON
    								sys.index_columns.column_id=sys.columns.column_id
    								AND sys.index_columns.object_id=sys.columns.object_id
    						WHERE
    							sys.index_columns.is_included_column=0
    							AND sys.indexes.object_id=sys.index_columns.object_id
    							AND sys.indexes.index_id=sys.index_columns.index_id
    						ORDER BY key_ordinal
    						FOR XML PATH('')
    					) AS index_columns_key,
    					(
    						SELECT sys.columns.name + @Delimiter + ' '
    						FROM
    							sys.index_columns
    							JOIN sys.columns ON
    								sys.index_columns.column_id=sys.columns.column_id
    								AND sys.index_columns.object_id=sys.columns.object_id
    						WHERE
    							sys.index_columns.is_included_column=1
    							AND sys.indexes.object_id=sys.index_columns.object_id
    							AND sys.indexes.index_id=sys.index_columns.index_id
    						ORDER BY index_column_id
    						FOR XML PATH('')
    					) AS index_columns_include
    			) AS Index_Columns
    	) AS Index_Columns
    	LEFT OUTER JOIN sys.dm_db_index_usage_stats ON
    		sys.indexes.index_id=sys.dm_db_index_usage_stats.index_id
    		AND sys.indexes.object_id=sys.dm_db_index_usage_stats.object_id
    		AND sys.dm_db_index_usage_stats.database_id=DB_ID()
    WHERE
    	sys.objects.type='u'
    	AND sys.schemas.name LIKE CASE WHEN @SchemaName='' THEn sys.schemas.name ELSE @SchemaName END
    	AND sys.objects.name LIKE CASE WHEN @TableName='' THEn sys.objects.name ELSE @TableName END
    ORDER BY
    	CASE @Sort
    		WHEN 1 THEN
    			(
    				(
    					(CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_seeks,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_seeks,0)))*10
    					+ CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_scans,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_scans,0)))*1 ELSE 0 END
    					+ 1
    				)
    				/CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_updates,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_updates,0))+1) ELSE 1 END
    			)*-1
    		WHEN 2 THEN
    			(
    				(
    					(CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_seeks,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_seeks,0)))*10
    					+ CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_scans,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_scans,0)))*1 ELSE 0 END
    					+ 1
    				)
    				/CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_updates,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_updates,0))+1) ELSE 1 END
    			)
    		ELSE NULL
    	END,
    	CASE @Sort
    		WHEN 3 THEN sys.schemas.name
    		WHEN 4 THEN sys.schemas.name
    		WHEN 5 THEN sys.schemas.name
    		ELSE NULL
    	END,
    	CASE @Sort
    		WHEN 1 THEN CONVERT(VarChar(10), sys.dm_db_index_usage_stats.user_seeks*-1)
    		WHEN 2 THEN CONVERT(VarChar(10), sys.dm_db_index_usage_stats.user_seeks)
    		ELSE NULL
    	END,
    	CASE @Sort
    		WHEN 3 THEN sys.objects.name
    		WHEN 4 THEN sys.objects.name
    		WHEN 5 THEN sys.objects.name
    		ELSE NULL
    	END,
    	CASE @Sort
    		WHEN 1 THEN sys.dm_db_index_usage_stats.user_scans*-1
    		WHEN 2 THEN sys.dm_db_index_usage_stats.user_scans
    		WHEN 4 THEN
    			(
    				(
    					(CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_seeks,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_seeks,0)))*10
    					+ CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_scans,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_scans,0)))*1 ELSE 0 END
    					+ 1
    				)
    				/CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_updates,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_updates,0))+1) ELSE 1 END
    			)*-1
    		WHEN 5 THEN
    			(
    				(
    					(CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_seeks,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_seeks,0)))*10
    					+ CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_scans,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_scans,0)))*1 ELSE 0 END
    					+ 1
    				)
    				/CASE WHEN sys.indexes.type=2 THEN (CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.user_updates,0))+CONVERT(Numeric(19,6), ISNULL(sys.dm_db_index_usage_stats.system_updates,0))+1) ELSE 1 END
    			)
    		ELSE NULL
    	END,
    	CASE @Sort
    		WHEN 3 THEN sys.indexes.name
    		ELSE NULL
    	END
    GO
    
    --*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

    public by cghersi @ MailUp API DEV  990  1  5  0

    How to Retrieve and filter some groups of recipients with MailUp .NET SDK

    This snippet takes advantage of the MailUp .NET SDK to setup the secure communication towards the server through OAuth2 two leg authentication. You can start digging into the MailUP API world by reading this content: http://help.mailup.com/display/mailupapi/REST+API An instance of MailUpClient class is able to manage one user at a time. A MailU
    public static void GetGroups(string clientID, string clientSecret, string username, string password)
    {
        // 1) Setup the MailUp Client:
        MailUpClient client = new MailUpClient(clientID, clientSecret);
        try
        {
            client.RetrieveAccessToken(username, password);
        }
        catch (MailUpException ex)
        {
            Console.WriteLine("Unable to access the service due to " + ex.Message);
            return;
        }
    
        // 2) Prepare the input:
        int idList = 1;
        string filter = "Notes.Contains('test') && deleteable==true";
    
        // 3) Invoke the web method:
        CollectionOf<ConsoleGroupItem> result = null;
        try
        {
            result = client.GetGroups(idList, filter);
        }
        catch (Exception ex)
        {
            Console.WriteLine("Cannot perform the operation due to " + ex.Message);
            return;
        }
    
        // 4) Print results:
        if ((result != null) && (result.Count > 0))
            Console.WriteLine("Retrieved Groups:" + result.Count + "; first one with name:" + result[0].Name);
        else
            Console.WriteLine("An error occurred while retrieving the groups.");
    }
    

    public by snip2code  2986  1  7  0

    Search snippets with Snip2Code APIs

    This method calls Snip2Code web service to search for the snippets matching the given filters. This method can be called both as anonymous user (without having previously logged-in, in this case the results will be only public snippets) or as logged user (in this case the results will be found in the basket of user's visible snippets).
    public IList<Snippet> GetSnippetsForSearch(string searchText, out Dictionary<string, string[]> misSpellings, out int totNum,
        out int totNumWithNonDefOp, int maxNum = int.MaxValue, int start = 0, bool onlyCreated = false, int onlyOfGroup = 0)
    {
        //check for erroneous input:
        misSpellings = null;
        totNum = 0;
        totNumWithNonDefOp = 0;
        if ((maxNum <= 0) || (start < 0))
        {
            log.ErrorFormat("Input error: userID={0}, searchText={1}, maxNum={2}, start={3}",
                CurrentUserID, searchText.PrintNull(), maxNum, start);
            return new List<Snippet>();
        }
    
        //send the request and parse the response:
        string querystring = string.Format("query={0}&maxNum={1}&start={2}&onlyCreated={3}&onlyOfGroup={4}",
                                HttpUtility.UrlEncode(searchText), maxNum, start, onlyCreated, onlyOfGroup);
    	string SEARCH_SNIPPET_URL = "http://www.snip2code.com/Search/Get"; 
        string response = SendRequest(SEARCH_SNIPPET_URL, querystring, false);
    	S2CResListBaseEntity<Snippet> resp = Deserialize(response); //you can use a third party library to pass from json-encoded response to the object...
    
        //build the result:
    	if ((resp == null) || (resp.Data == null))
    		return null;
        IList<Snippet> snips = resp.Data;
        totNum = resp.TotNum;
        misSpellings = resp.GetMiscFromResp(out totNumWithNonDefOp);
        return snips;
    }
    
    public static Dictionary<string, string[]> GetMiscFromResp(this S2CResListBaseEntity<Snippet> resp, out int totNumWithNonDefOp)
    {
        totNumWithNonDefOp = 0;
        if ((resp == null) || (resp.Misc == null))
            return null;
        else
        {
            Dictionary<string, string[]> res = new Dictionary<string, string[]>();
            foreach (string key in resp.Misc.Keys)
            {
                if (string.IsNullOrEmpty(key) || (resp.Misc[key] == null))
                    continue;
                if (key.Equals(TOT_NUM_WITH_NON_DEF_OP, StringComparison.InvariantCultureIgnoreCase))
                    int.TryParse(resp.Misc[key], out totNumWithNonDefOp);
                else
                    res.Add(key, resp.Misc[key].Split(','));
            }
            return res;
        }
    }
    

    public by snip2code  2806  0  6  0

    Search Snippets With Snip2Code APIs in Java

    This method calls Snip2Code web service to search for the snippets matching the given filters. This method can be called both as anonymous user (without having previously logged-in, in this case the results will be only public snippets) or as logged user (in this case the results will be found in the basket of user's visible snippets).
    public class PaginatedList<T extends BaseEntity> {
    		public List<T> list;
    		public int totNum;
    		public HashMap<String, String> misc;
    		
    		public PaginatedList(List<T> list, int totNum, HashMap<String, String> misc) {
    			this.list = list;
    			this.totNum = totNum;
    			this.misc = misc;
    		}
    	} 
    
        public PaginatedList<Snippet> getSnippetsForSearch(String searchText, int maxNum, int start, boolean onlyCreated, int onlyOfGroup) {
            //send the request and parse the response:
            String querystring = "";
    		try {
    			querystring = String.format("query=%s&maxNum=%d&start=%d&onlyCreated=%b&onlyOfGroup=%d",
    					URLEncoder.encode(searchText, "UTF-8"), maxNum, start, onlyCreated, onlyOfGroup);
    		} catch (UnsupportedEncodingException e) {
    			return new PaginatedList<Snippet>(new ArrayList<Snippet>(), 0, null);
    		}
    		String SEARCH_SNIPPET_URL = "http://www.snip2code.com/Search/Get"; 
            String response = SendGetReq(SEARCH_SNIPPET_URL, querystring);
    		S2CResListBaseEntity<Snippet> resp = Deserialize(response); //you can use a third party library to pass from json-encoded response to the object...
    
            //build the result:
            return getPaginatedListFromResp(resp, Snippet.class);
        }
    
        protected <T extends BaseEntity> PaginatedList<T> getPaginatedListFromResp(S2CResListBaseEntity<T> resp, Class<T> clazz) {
    	    if ((resp != null) && (resp.getStatus() == ErrorCodes.OK) 
      	    	return new PaginatedList<T>(Utils.asList(resp.getData(), clazz), resp.getTotNum(), resp.getMisc());
    		else
    			return null;
        }

    public by paulsimmons  1141  0  5  0

    WooCommerce Ajax Product Filter by FMEAddons

    Ajax Product filter WooCommerce plugin by FMEAddons allows you to implement advanced search on your online store which will help your customers to find desired product (s) in a blink with the help of advance layered navigation filters. Adding ajax based product filtering on your online store will help you to eliminate delay in the searching process
    <? php                                     

    public by paulsimmons  849  0  5  0

    Magento Shop by Manufacturer Plugin by FMEAddons

    Magento shop by manufacturer plugin by FMEAddons helps you to create unlimited brands and display them in the brand slider. This module adds the separate page on your e-store for brands and customers can find the brand they love on this page. They can see the products of brands and buy the products right away. Brand page enables brands by category,
    // Enter here the actual content of the snippet.                        

    public by paulsimmons  670  0  4  0

    FMEAddons - Magento VAT Add-on

    You can let your customers buy products from you without tax by using Magento VAT extension by FMEAddons. This is a most important add-on for merchants who sell products outside the Europe, and in such countries where free trades agreements are prevailed by the Governments. Merchants can also export the VAT invoices of any duration by using filters
    // Enter here the actual content of the snippet.            

    public by msdn  109217  0  5  0

    MatchesSpecification: Tests to see if a given list of settings matches a set of filters exactly.

    Tests to see if a given list of settings matches a set of filters exactly. The settings to check. A list of filters to check. If any filter returns null, false. If there are any settings left over after all filters are processed, false. Otherwise true.
    /// <summary>
    /// Tests to see if a given list of settings matches a set of filters exactly.
    /// </summary>
    /// <param name="settings">The settings to check.</param>
    /// <param name="constraints">A list of filters to check.</param>
    /// <returns>
    /// If any filter returns null, false.
    /// If there are any settings left over after all filters are processed, false.
    /// Otherwise true.
    /// </returns>
    private static bool MatchesSpecification(
        NameValueCollection settings,
        params Func<NameValueCollection, NameValueCollection>[] constraints)
    {
        foreach (var constraint in constraints)
        {
            NameValueCollection remainingSettings = constraint(settings);
    
            if (remainingSettings == null)
            {
                return false;
            }
            else
            {
                settings = remainingSettings;
            }
        }
    
        if (settings.Count == 0)
        {
            return true;
        }
    
        return false;
    }
    • Public Snippets
    • Channels Snippets