public void DoCopy(ProgressChangeDelegate ProgressChanged, Completedelegate ModelOnOnComplete, Grid panel) { var newCopy = new CopyClass(_pathes.FromPath, _pathes.ToPath, ProgressChanged, ModelOnOnComplete, panel); panel.Tag = newCopy; Thread newThread = new Thread(new ThreadStart(newCopy.Copy)); newThread.IsBackground = true; newThread.Start(); }
public CopyClass(string Source, string Dest, ProgressChangeDelegate onProgressChanged, Completedelegate onComplete, Grid panel) { this.SourceFilePath = Source; this.DestFilePath = Dest; _panel = panel; OnProgressChanged += onProgressChanged; OnComplete += onComplete; }
public void Start(BackupDataSource source, BackupDataSource destination, ProgressChangeDelegate progressChange) { this.source = source; if (this.State.InProgress) { throw new ApplicationException("A backup operation is already in progress."); } this.State.InProgress = true; this.State.ProgressPercentage = 0; this.progressChange = progressChange; // Transfer the data from the source to the destination source.TransferData(destination, ProgressChange); this.State.InProgress = false; }
internal static string GenerateAuditScript(string storageConnectionString, ScriptAction scriptAction, ProgressChangeDelegate progressChangeDelegate) { //Set Audit Settings SqlAuditSettings myAuditSettings = new SqlAuditSettings(storageConnectionString); //Choose Script MMC.SyncAction myAuditSettings.ScriptAction = scriptAction; //Select Audit Columns myAuditSettings.AuditColumns = AuditColumns.ApplicationName | AuditColumns.AuditDateTime | AuditColumns.HostId | AuditColumns.HostName | AuditColumns.UserName | AuditColumns.UserSID; //Choose Triggers MMC.SyncAction myAuditSettings.TriggersActions = TriggerActions.Insert | TriggerActions.Update | TriggerActions.Delete; //Choose Indexes MMC.SyncAction myAuditSettings.IndexesAction = IndexesAction.SameIndexesAsSourceTable; //Assign naming properties myAuditSettings.AuditTablesSuffix = "_Audit"; myAuditSettings.AuditTriggersSuffix = "_TriggerForAudit"; //Define File Groups myAuditSettings.TablesFileGroupName = "[PRIMARY]"; myAuditSettings.IndexesFileGroupName = "[PRIMARY]"; //Use SqlAuditDiscovery Class to get Table Schemas. SqlAuditDiscovery auditDiscoveryUtility = new SqlAuditDiscovery(storageConnectionString); //Get TableInfo Collection TableInfoCollection myTables = auditDiscoveryUtility.GetAllTableInfo(myAuditSettings); //*** Tables Customization ***// myTables.Remove(new SchemaTablePair("dbo", "UsersDemo")); myTables.Remove(new SchemaTablePair("dbo", "netsqlazman_LogTable")); //Generate Audit Script SqlAuditGenerator generator = new SqlAuditGenerator(myAuditSettings); generator.ProgressChange+=progressChangeDelegate; return generator.GenerateDDLScriptForAuditTables(myTables); }
internal static string GenerateAuditScript(string storageConnectionString, ScriptAction scriptAction, ProgressChangeDelegate progressChangeDelegate) { //Set Audit Settings SqlAuditSettings myAuditSettings = new SqlAuditSettings(storageConnectionString); //Choose Script Action myAuditSettings.ScriptAction = scriptAction; //Select Audit Columns myAuditSettings.AuditColumns = AuditColumns.ApplicationName | AuditColumns.AuditDateTime | AuditColumns.HostId | AuditColumns.HostName | AuditColumns.UserName | AuditColumns.UserSID; //Choose Triggers Action myAuditSettings.TriggersActions = TriggerActions.Insert | TriggerActions.Update | TriggerActions.Delete; //Choose Indexes Action myAuditSettings.IndexesAction = IndexesAction.SameIndexesAsSourceTable; //Assign naming properties myAuditSettings.AuditTablesSuffix = "_Audit"; myAuditSettings.AuditTriggersSuffix = "_TriggerForAudit"; //Define File Groups myAuditSettings.TablesFileGroupName = "[PRIMARY]"; myAuditSettings.IndexesFileGroupName = "[PRIMARY]"; //Use SqlAuditDiscovery Class to get Table Schemas. SqlAuditDiscovery auditDiscoveryUtility = new SqlAuditDiscovery(storageConnectionString); //Get TableInfo Collection TableInfoCollection myTables = auditDiscoveryUtility.GetAllTableInfo(myAuditSettings); //*** Tables Customization ***// myTables.Remove(new SchemaTablePair("dbo", "UsersDemo")); myTables.Remove(new SchemaTablePair("dbo", "netsqlazman_LogTable")); //Generate Audit Script SqlAuditGenerator generator = new SqlAuditGenerator(myAuditSettings); generator.ProgressChange += progressChangeDelegate; return(generator.GenerateDDLScriptForAuditTables(myTables)); }