protected override void ProcessRecord() { base.ProcessRecord(); if (string.IsNullOrEmpty(Namespace)) { Namespace = "XrmCiFramework"; } base.WriteVerbose($"Generating custom attribute class with namespace: {Namespace}"); WriteObject(ClassText.Replace("#NAMESPACE#", Namespace)); }
// Default constructor // Initializes all properties and instances of classes public ClassBIZ() { // Initialization of our class instances CCT = new ClassCryptText(myKey, myDummy); CDT = new ClassDecryptText(myKey); CRC = new ClassRollingCrypt(myKey, myDummy); CRD = new ClassRollingDecrypt(myKey); CFH = new ClassFileHandler(); // Initialization of our properties to avoid null exception cryptText = new ClassText(); cleanText = new ClassText(); }
/// <summary> /// This method reads a file from a given path. /// fileStream finds and creates a connection to the file /// reader sets a pointer at the very beginning of the file. /// reader.ReadToEnd indicates what part of the file needs to be read(it reads the entire file). /// </summary> /// <param name="path"> string </param> /// <returns> ClassText </returns> public ClassText ReadTextFromFile(string path) { ClassText ct = new ClassText(); try { FileStream fileStream = new FileStream(path, FileMode.Open); using (StreamReader reader = new StreamReader(fileStream)) { ct.text = reader.ReadToEnd(); } } catch (IOException ex) { throw ex; } return(ct); }