Ejemplo n.º 1
0
 // <snippet8>
 public static void DisplayConnectionAccessRules(NetCodeGroup group)
 {
     System.Collections.DictionaryEntry[] rules = group.GetConnectAccessRules();
     foreach (System.Collections.DictionaryEntry o in rules)
     {
         string key = o.Key as string;
         CodeConnectAccess[] values = (CodeConnectAccess[])o.Value;
         Console.WriteLine("Origin scheme: {0}", key);
         foreach (CodeConnectAccess c in values)
         {
             Console.WriteLine("Scheme {0} Port: {1}", c.Scheme, c.Port);
         }
         Console.WriteLine("__________________________");
     }
 }
Ejemplo n.º 2
0
        public static void NetCodeGroupCallMethods()
        {
            NetCodeGroup ncg        = new NetCodeGroup(new GacMembershipCondition());
            string       teststring = NetCodeGroup.AbsentOriginScheme;

            teststring = NetCodeGroup.AnyOtherOriginScheme;
            ncg.AddConnectAccess("test", new CodeConnectAccess("test", 0));
            CodeGroup cg     = ncg.Copy();
            bool      equals = ncg.Equals(new object());

            System.Collections.DictionaryEntry[] de = ncg.GetConnectAccessRules();
            int hash = ncg.GetHashCode();

            ncg.ResetConnectAccess();
            PolicyStatement ps = ncg.Resolve(new Evidence());

            cg = ncg.ResolveMatchingCodeGroups(new Evidence());
        }