Exemplo n.º 1
0
        /// <summary>
        /// The do run set all classifications.
        /// </summary>
        /// <param name="server">
        /// The server.
        /// </param>
        /// <param name="ctg">
        /// The ctg.
        /// </param>
        /// <param name="isTest">
        /// The is Test.
        /// </param>
        /// <param name="allClassifications">
        /// The all Classifications.
        /// </param>
        private static void DoRunSetAllClassifications(
            IUpdateServer server,
            IComputerTargetGroup ctg,
            bool isTest,
            Rule allClassifications)
        {
            // TODO: support products in all classifications element
            // Microsoft.UpdateServices.Administration.UpdateCategoryCollection products = null;
            if (allClassifications.Copy)
            {
                // Check for copy
                Console.Out.WriteLine("Checking TargetGroup to Copy From: ");
                IComputerTargetGroup cftg = server.GetComputerTargetGroup(allClassifications.CopyFrom);
                Console.WriteLine("Matched copy from guid to: " + cftg.Name);
                CopyFrom.DoCopy(server, cftg, ctg, isTest);
            }

            if (allClassifications.ApproveSupersededUpdates)
            {
                // Check for superseded updates
                Console.Out.WriteLine("Checking Superseded Updates: ");
                CheckSupersededUpdates(
                    server,
                    allClassifications.AcceptLicenseAgreement,
                    ctg,
                    null,
                    null,
                    isTest,
                    allClassifications.ShouldApproveUninstalledSupersededUpdate);
            }

            if (allClassifications.ApproveStaleUpdates)
            {
                // Check for stale updates
                Console.Out.WriteLine("Checking Stale Updates: ");
                CheckStaleUpdates(server, allClassifications.AcceptLicenseAgreement, ctg, null, null, isTest);
            }

            if (allClassifications.ApproveNeededUpdates)
            {
                CheckNeededUpdates(server, ctg, isTest);
            }
        }
Exemplo n.º 2
0
        private void CopyToClipboard(CopyFrom from)
        {
            switch (from)
            {
            case CopyFrom.Database:
                System.Windows.Clipboard.SetText(DatabaseValues);
                break;

            case CopyFrom.YearCalendar:
                System.Windows.Clipboard.SetText(YearCalendarValues);
                break;

            case CopyFrom.IndividualMonths:
                System.Windows.Clipboard.SetText(IndividualMonthValues);
                break;

            default:
                break;
            }
        }
Exemplo n.º 3
0
        /// <summary>RenderAny as EPL. </summary>
        /// <param name="writer">to output to</param>
        public void ToEPL(TextWriter writer)
        {
            writer.Write("create");
            if (TypeDefinition != null)
            {
                TypeDefinition.Value.Write(writer);
            }

            writer.Write(" schema ");
            writer.Write(SchemaName);
            writer.Write(" as ");
            if ((Types != null) && (Types.IsNotEmpty()))
            {
                string delimiter = "";
                foreach (string type in Types)
                {
                    writer.Write(delimiter);
                    writer.Write(type);
                    delimiter = ", ";
                }
            }
            else
            {
                writer.Write("(");
                string delimiter = "";
                foreach (SchemaColumnDesc col in Columns)
                {
                    writer.Write(delimiter);
                    col.ToEPL(writer);
                    delimiter = ", ";
                }

                writer.Write(")");
            }

            if ((Inherits != null) && (Inherits.IsNotEmpty()))
            {
                writer.Write(" inherits ");
                string delimiter = "";
                foreach (string name in Inherits)
                {
                    writer.Write(delimiter);
                    writer.Write(name);
                    delimiter = ", ";
                }
            }

            if (StartTimestampPropertyName != null)
            {
                writer.Write(" starttimestamp ");
                writer.Write(StartTimestampPropertyName);
            }

            if (EndTimestampPropertyName != null)
            {
                writer.Write(" endtimestamp ");
                writer.Write(EndTimestampPropertyName);
            }

            if ((CopyFrom != null) && (CopyFrom.IsNotEmpty()))
            {
                writer.Write(" copyFrom ");
                string delimiter = "";
                foreach (string name in CopyFrom)
                {
                    writer.Write(delimiter);
                    writer.Write(name);
                    delimiter = ", ";
                }
            }
        }
Exemplo n.º 4
0
    public void GeraMenu()
    {
        Console.WriteLine("WELCOME TO OMICRON");

        string comando, contexto = ">", hdSelecionado = string.Empty;

        comando = String.Empty;

        while (!comando.Equals("exit"))
        {
            Console.Write(contexto);
            comando = Console.ReadLine();

            string[] comand = comando.Split(' ');

            try
            {
                switch (comand[0])
                {
                case "createhd":
                    int buffer, linha, coluna;
                    int.TryParse(comand[2], out linha);
                    int.TryParse(comand[3], out coluna);
                    buffer = linha * coluna;

                    CreateHd.CriarHd(comand[1], buffer, true);
                    break;

                case "cls":
                    Console.Clear();
                    break;

                case "selecthd":
                    var existe = SelectHd.SelecionaHd(comand[1]);
                    if (existe)
                    {
                        hdSelecionado = comand[1];
                        contexto      = hdSelecionado + ">";
                    }
                    else
                    {
                        Console.WriteLine("HD não reconhecido");
                    }
                    break;

                case "dirhd":
                    DirHd.ListaHd();
                    break;

                case "help":
                    var com = "";

                    if (comand.Length > 1)
                    {
                        com = comand[1];
                    }

                    Help.Ajuda(com);
                    break;

                case "formathd":
                    FormatHd.FormatarHd(comand[1]);
                    break;

                case "statushd":
                    StatusHd.Status(comand[1]);
                    break;

                case "typehd":
                    TypeHd.ImprimeTudo(comand[1]);
                    break;

                case "create":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        Create.CriaArquivo(contexto.Replace(">", ""), comand[1], comand[2]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "del":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        Del.Deleta(contexto.Replace(">", ""), comand[1]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "rmdir":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        Rmdir.RemoveDiretorio(contexto.Replace(">", ""), comand[1]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "type":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        TypeArq.MostrarTudo(contexto.Replace(">", ""), comand[1]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "renamedir":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        RenameDir.RenomeiaDir(contexto.Replace(">", ""), comand[1], comand[2]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "rename":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        RenameArq.RenomeiaArquivo(contexto.Replace(">", ""), comand[1], comand[2]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "mkdir":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        Mkdir.CriaDiretorio(contexto.Replace(">", ""), comand[1]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "dir":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        Dir.MostraDiretorios(contexto.Replace(">", ""));
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "copyfrom":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        CopyFrom.PegaImagem(comand[1], comand[2], contexto.Replace(">", ""));
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "copyto":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        CopyTo.EnviaImagem(comand[1], comand[2], contexto.Replace(">", ""));
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "copy":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        Copy.Copia(contexto.Replace(">", ""), comand[1], comand[2]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "move":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        Move.Movimenta(contexto.Replace(">", ""), comand[1], comand[2]);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "tree":
                    if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        Tree.Arvore(hdSelecionado, contexto.Replace(">", ""));
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                case "removehd":
                    RemoveHd.RemoverHd(comand[1]);
                    break;

                case "cd":
                    if (comand[1].Equals("..") && string.Concat(hdSelecionado + ">").Equals(contexto))
                    {
                        hdSelecionado = string.Empty;
                        contexto      = ">";
                    }
                    else if (!String.IsNullOrEmpty(hdSelecionado))
                    {
                        contexto = SeparaDir(contexto, comand);
                    }
                    else
                    {
                        Console.WriteLine("Por favor, selecione um hd");
                    }
                    break;

                default:
                    break;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine("....");
            }
        }
    }