Exemplo n.º 1
0
        private void ParseObjectClass()

        {
            int row = (int)this.NodesList.SelectedIndex;

            ObjectClassDiff.Clear();

            if (row >= 0)

            {
                KeyValuePair <String, SchemaDefinitionDiff> p = attrTypediff.ElementAt(row);

                {
                    CurrentNode = p.Key;

                    SchemaDefinitionDiff diff = p.Value;



                    if (diff != null)

                    {
                        foreach (Tuple <ObjectClass, ObjectClass> t in diff.GetObjectClassDiff())

                        {
                            string baseObject = (t.Item1 != null) ? t.Item1.ToString() : VMDirSchemaConstants.MISING_OBJECTCLASS;

                            string currentObject = (t.Item2 != null) ? t.Item2.ToString() : VMDirSchemaConstants.MISING_OBJECTCLASS;

                            ObjectClassDiff.Add(new KeyValuePair <string, string>(baseObject, currentObject));
                        }
                    }

                    else
                    {
                        throw new Exception(VMDirSchemaConstants.NO_DATA_FOUND);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private static void listSchemaDefinitionDiff(ISchemaConnection conn)
        {
            Console.WriteLine("SCHEMA DEFINITION DIFF");
            Console.WriteLine("---------");

            String baseServer = conn.GetBaseServerName();
            IDictionary <String, SchemaDefinitionDiff> diffs = conn.GetAllSchemaDefinitionDiffs();

            foreach (KeyValuePair <String, SchemaDefinitionDiff> p in diffs)
            {
                String server             = p.Key;
                SchemaDefinitionDiff diff = p.Value;

                Console.WriteLine("Schema comparsion between {0} and {1}", baseServer, server);
                if (diff != null)
                {
                    foreach (Tuple <AttributeType, AttributeType> t in diff.GetAttributeTypeDiff())
                    {
                        Console.WriteLine("\tBASE: {0}", t.Item1);
                        Console.WriteLine("\tOTHE: {0}", t.Item2);
                        Console.WriteLine("\t-----");
                    }
                    foreach (Tuple <ObjectClass, ObjectClass> t in diff.GetObjectClassDiff())
                    {
                        Console.WriteLine("\tBASE: {0}", t.Item1);
                        Console.WriteLine("\tOTHE: {0}", t.Item2);
                        Console.WriteLine("\t-----");
                    }
                }
                else
                {
                    Console.WriteLine("\tServer not reachable {0}", server);
                }
                Console.WriteLine();
            }
            Console.WriteLine();
        }