Exemple #1
0
 public override void LoadProperty(string key, string value)
 {
     base.LoadProperty(key, value);
     if (key == "samplerate")
     {
         this.sampleRate = DocumentSystem.Converter <string, long?>(value);
     }
 }
Exemple #2
0
 public override void LoadProperty(string key, string value)
 {
     base.LoadProperty(key, value);
     if (key == "length")
     {
         this.length = DocumentSystem.Converter <string, long?>(value);
     }
 }
Exemple #3
0
 public override void LoadProperty(string key, string value)
 {
     base.LoadProperty(key, value);
     if (key == "pages")
     {
         this.numberOfPages = DocumentSystem.Converter <string, long?>(value);
     }
 }
Exemple #4
0
 public override void LoadProperty(string key, string value)
 {
     base.LoadProperty(key, value);
     if (key == "cols")
     {
         this.numberOfCol = DocumentSystem.Converter <string, long?>(value);
     }
     if (key == "rows")
     {
         this.numberOfRow = DocumentSystem.Converter <string, long?>(value);
     }
 }
Exemple #5
0
    static void Main()
    {
        DocumentSystem documents = new DocumentSystem();

        string command = Console.ReadLine();

        while (command != string.Empty)
        {
            Execute(command, ref documents);

            command = Console.ReadLine();
        }

        Console.WriteLine(documents.ToString());
    }
 public virtual void LoadProperty(string key, string value)
 {
     if (key == "name")
     {
         this.name = value;
     }
     else if (key == "content")
     {
         this.content = value;
     }
     else if (key == "size")
     {
         this.size = DocumentSystem.Converter <string, long?>(value);
     }
 }
Exemple #7
0
    public static void Execute(string command, ref DocumentSystem documents)
    {
        string sub = command.Substring(0, 3);

        switch (sub)
        {
        case "Add":
        {
            documents.AddDocument(DocumentSystem.CreateDocument(command));
        }
        break;

        case "Enc":
        {
            if (command[7] == 'A')
            {
                documents.EncryptAll();
            }
            else
            {
                documents.EncryptDocument(command.Split(new char[] { '[', ']' }, StringSplitOptions.RemoveEmptyEntries)[1]);
            }
        }
        break;

        case "Dec":
        {
            documents.DecryptDocument(command.Split(new char[] { '[', ']' }, StringSplitOptions.RemoveEmptyEntries)[1]);
        }
        break;

        case "Lis":
        {
            documents.ToString();
        }
        break;

        case "Cha":
        {
            string[] parameters = command.Split(new char[] { '[', ']' }, StringSplitOptions.RemoveEmptyEntries)[1].Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            documents.ChangeDocumentContent(parameters[0], parameters[1]);
        }
        break;
        }
    }