/// <summary> /// 获取升级选项,判断规则,只有一个文件,认为是安装包方式 /// </summary> private void InitOption() { if (File.Exists(m_metaPath)) { XmlDocument doc = new XmlDocument(); doc.Load(m_metaPath); XmlNode root = doc.SelectSingleNode("Files"); XmlNodeList files = root.SelectNodes("file"); int count = 0; foreach (XmlNode f in files) { if (!f.Attributes["path"].Value.EndsWith("update.config") && !f.Attributes["path"].Value.EndsWith("Upgrade.exe") && !f.Attributes["path"].Value.EndsWith("HashGener.exe")) { count++; } } if (count == 1) { m_syncOption = SyncOption.Installer; } } }
//------------------------------------------------------------------------------- #region Helper public static void SyncSprite(Sprite changesprite, Sprite syncsprite, SyncOption option) { if ((option & SyncOption.Position) == SyncOption.Position) { changesprite.Position = syncsprite.Position; } if ((option & SyncOption.Scale) == SyncOption.Scale) { changesprite.Scale = syncsprite.Scale; } if ((option & SyncOption.Color) == SyncOption.Color) { changesprite.Color = syncsprite.Color; } if ((option & SyncOption.Origin) == SyncOption.Origin) { changesprite.Origin = syncsprite.Origin; } if ((option & SyncOption.Rotation) == SyncOption.Rotation) { changesprite.Rotation = syncsprite.Rotation; } if ((option & SyncOption.Texture) == SyncOption.Texture) { changesprite.Texture = syncsprite.Texture; //_TexturePath = syncsprite.TexturePath; } }
public async Task SyncAsync(LocationBase src, LocationBase dst, SyncOption option, CancellationToken ct) { option.OutputType = "json"; var args = $"sync {src} {dst} {option} --cancel-from-stdin"; await this.StartAZCopyAsync(args, ct); }
public SynchronizationService() { this.syncOption = (SyncOption)Properties.Settings.Default.SyncOption; this.isOutlookAuthority = Properties.Settings.Default.IsOutlookAuthority; this.synchronizationTimer = new Timer(timeoutTimerFrequencyInMs); this.synchronizationTimer.Elapsed += this.OnSynchronizationTimerElapsed; }
/// <summary> /// Initializes a new instance of the <see cref="SyncRequestServerOperation"/> class. /// </summary> /// <param name="instanceKey"> /// The instance key. /// </param> /// <param name="syncKey"> /// The synchronize key. /// </param> /// <param name="syncOptions"> /// The synchronize options. /// </param> /// <param name="theDelegate"> /// The delegate. /// </param> public SyncRequestServerOperation( string instanceKey, string syncKey, SyncOption syncOptions, ISyncRequestDelegate theDelegate) : this(syncOptions, theDelegate) { this.SyncKey = syncKey; this.InstanceKey = instanceKey; }
public TeamMailboxSyncJob(JobQueue queue, Configuration config, TeamMailboxSyncInfo syncInfoEntry, string clientString, SyncOption syncOption) : base(queue, config, clientString) { this.SyncInfoEntry = syncInfoEntry; this.SyncOption = syncOption; if (((TeamMailboxSyncConfiguration)config).UseOAuth) { this.credentials = ((TeamMailboxSyncJobQueue)queue).OAuthCredentialFactory.Get(syncInfoEntry.MailboxPrincipal.MailboxInfo.OrganizationId); } else { this.credentials = CredentialCache.DefaultCredentials; } this.loggingContext = new LoggingContext(this.SyncInfoEntry.MailboxGuid, this.SyncInfoEntry.SiteUrl, base.ClientString, null); }
private void SetSyncOption(int index) { _syncOption = (SyncOption)index; for (int i = 0; i < syncOptionBox.Items.Count; i++) { if (i == index) { syncOptionBox.SetItemCheckState(i, CheckState.Checked); } else { syncOptionBox.SetItemCheckState(i, CheckState.Unchecked); } } }
private void CreateOptionBinding(RadioButton button, SyncOption mode) { // store the mode in the tag button.Tag = mode; // one-way sync the state from the data source with the check state var modeBinding = new Binding("Checked", Settings.Default, "SyncMode", true, DataSourceUpdateMode.Never); modeBinding.Format += (sender, e) => e.Value = (SyncOption)((Binding)sender).Control.Tag == (SyncOption)e.Value; button.DataBindings.Add(modeBinding); // update the data source when the check box is clicked (and don't autocheck it) button.AutoCheck = false; button.Click += (sender, e) => Settings.Default.SyncMode = (SyncOption)((RadioButton)sender).Tag; }
public void SyncUser(SyncOption option, User user, DeviceController device) { switch (option) { case SyncOption.Create: AddUser(user, device); break; case SyncOption.Delete: DeleteUser(user, device); break; case SyncOption.Update: case SyncOption.Unknown: UpdateUser(user, device); break; } }
/// <summary> /// Requests the sync manager to perform periodic sync operations. /// </summary> /// <since_tizen> 4 </since_tizen> /// <param name="request"> The sync job information of the sync job request. </param> /// <param name="period"> Determines the time interval of the periodic sync. The periodic sync operation can be triggered in that interval, but it does not guarantee the exact time. The minimum value is 30 minutes. </param> /// <param name="syncOptions"> Sync options determine a way to operate the sync job and can be used as ORing. </param> /// <privilege>http://tizen.org/privilege/alarm.set</privilege> /// <exception cref="UnauthorizedAccessException"> In case of a privilege not defined. </exception> /// <exception cref="ArgumentNullException"> Thrown when any of the arguments are null. </exception> /// <exception cref="InvalidOperationException"> Thrown when the application calling this API doesn't have a sync adapter. </exception> /// <returns> A unique value which can manage sync jobs. The number of sync job IDs is limited as it is less than hundred. </returns> public static int AddPeriodicSyncJob(SyncJobData request, SyncPeriod period, SyncOption syncOptions) { if (request == null || request.SyncJobName == null) { throw new ArgumentNullException(); } SafeAccountHandle accountHandle = (request.Account != null) ? request.Account.SafeAccountHandle : new SafeAccountHandle(); SafeBundleHandle bundleHandle = (request.UserData != null) ? request.UserData.SafeBundleHandle : new SafeBundleHandle(); int id = 0; int ret = Interop.Manager.AddPeriodicSyncJob(accountHandle, request.SyncJobName, (int)period, (int)syncOptions, bundleHandle, out id); if (ret != (int)SyncManagerErrorCode.None) { Log.Error(ErrorFactory.LogTag, "Failed to add periodic sync job"); throw ErrorFactory.GetException(ret); } return(id); }
private void LoadSettings() { // default SetSyncOption(0); // load RegistryKey regKeyAppRoot = Registry.CurrentUser.CreateSubKey(@"Software\Webgear\GOContactSync"); if (regKeyAppRoot.GetValue("SyncOption") != null) { _syncOption = (SyncOption)regKeyAppRoot.GetValue("SyncOption"); SetSyncOption((int)_syncOption); } if (regKeyAppRoot.GetValue("SyncProfile") != null) { tbSyncProfile.Text = (string)regKeyAppRoot.GetValue("SyncProfile"); } if (regKeyAppRoot.GetValue("Username") != null) { UserName.Text = regKeyAppRoot.GetValue("Username") as string; if (regKeyAppRoot.GetValue("Password") != null) { Password.Text = Encryption.DecryptPassword(UserName.Text, regKeyAppRoot.GetValue("Password") as string); } } if (regKeyAppRoot.GetValue("AutoSync") != null) { autoSyncCheckBox.Checked = Convert.ToBoolean(regKeyAppRoot.GetValue("AutoSync")); } if (regKeyAppRoot.GetValue("AutoSyncInterval") != null) { autoSyncInterval.Value = Convert.ToDecimal(regKeyAppRoot.GetValue("AutoSyncInterval")); } if (regKeyAppRoot.GetValue("AutoStart") != null) { runAtStartupCheckBox.Checked = Convert.ToBoolean(regKeyAppRoot.GetValue("AutoStart")); } autoSyncCheckBox_CheckedChanged(null, null); }
public SyncOption GetSelectedOption() { var item = QualityPicker.SelectedItem as SyncQualityOption; var option = new SyncOption { Quality = item, AutoSyncNewItems = _autoSync && SyncNewContent, UnwatchedItems = _unwatched && SyncUnwatched }; if (_itemLimit && !string.IsNullOrEmpty(ItemLimit)) { option.ItemLimit = int.Parse(ItemLimit); } if (_profileNeeded) { var profile = ProfilePicker.SelectedItem as SyncProfileOption; option.Profile = profile; } return(option); }
private void SetSyncOption(int index) { syncOption = (SyncOption)index; for (int i = 0; i < syncOptionBox.Items.Count; i++) { if (i == index) syncOptionBox.SetItemCheckState(i, CheckState.Checked); else syncOptionBox.SetItemCheckState(i, CheckState.Unchecked); } }
/// <summary> /// Initializes a new instance of the <see cref="SyncRequestServerOperation"/> class. /// </summary> /// <param name="syncOptions"> /// The synchronize options. /// </param> /// <param name="theDelegate"> /// The delegate. /// </param> public SyncRequestServerOperation(SyncOption syncOptions, ISyncRequestDelegate theDelegate) { this.SyncOptions = syncOptions; this.Delegate = theDelegate; this.DataSets = null; }
protected override Job InternalCreateJob(TeamMailboxSyncInfo info, string clientString, SyncOption syncOption) { return(new MembershipSyncJob(this, this.config, this.teamMailboxSecurityRefresher, info, clientString, syncOption)); }
public DocumentSyncJob(JobQueue queue, Configuration config, TeamMailboxSyncInfo syncInfoEntry, string clientString, SyncOption syncOption) : base(queue, config, syncInfoEntry, clientString, syncOption) { this.loggingComponent = ProtocolLog.Component.DocumentSync; }
public MembershipSyncJob(JobQueue queue, Configuration config, ITeamMailboxSecurityRefresher teamMailboxSecurityRefresher, TeamMailboxSyncInfo syncInfoEntry, string clientString, SyncOption syncOption) : base(queue, config, syncInfoEntry, clientString, syncOption) { if (teamMailboxSecurityRefresher == null) { throw new ArgumentNullException("teamMailboxSecurityRefresher"); } this.teamMailboxSecurityRefresher = teamMailboxSecurityRefresher; this.loggingComponent = ProtocolLog.Component.MembershipSync; }
public Syncronizer(SyncOption syncOption) { _syncOption = syncOption; }
public MaintenanceSyncJob(JobQueue queue, Configuration config, TeamMailboxSyncInfo syncInfoEntry, string clientString, SyncOption syncOption) : base(queue, config, syncInfoEntry, clientString, syncOption) { }
private void SyncMaps(SyncOption which_direction) { //synchronize maps with the ECU //frmInfoBox info = new frmInfoBox("Still needs to be implemented"); // sync ECU with binary file int cnt = 0; _ecuConnection.ProhibitRead = true; Thread.Sleep(100); if (_ecuConnection.Opened) { if (m_CurrentWorkingProject != string.Empty) { m_ProjectLog.WriteLogbookEntry(LogbookEntryType.SynchronizationStarted, which_direction.ToString()); } foreach (Trionic5Tools.SymbolHelper sh in m_trionicFile.GetFileInfo().SymbolCollection) { if (sh.Flash_start_address > 0) { cnt++; } } int currcnt = 0; //frmProgress progress = new frmProgress(); //progress.SetProgress("Synchronizing ECU with binary"); //progress.SetProgressPercentage(0); //progress.Show(); //preventUpdatePaint = true; foreach (Trionic5Tools.SymbolHelper sh in m_trionicFile.GetFileInfo().SymbolCollection) { if (sh.Flash_start_address > 0) { currcnt++; int percentage = (currcnt * 100) / cnt; //progress.SetProgressPercentage(percentage); SetStatusText("Sync: " + percentage.ToString() + "%"); SetTaskProgress(percentage, true); // <GS-08022011> if the user switch offline in the meantime // stop sync action to prevent damage to data if (_ECUmode == OperationMode.ModeOffline) break; //if (_APPmode == OperationMode.ModeOffline) break; // read ECU map if (sh.Start_address > 0 && sh.Length > 0) { //progress.SetProgress("Verifying " + sh.Varname); Console.WriteLine("map: " + sh.Varname); Thread.Sleep(50); byte[] symboldataECU = _ecuConnection.ReadSymbolDataNoProhibitRead(sh.Varname, (uint)sh.Start_address, (uint)sh.Length); byte[] symboldataBIN = m_trionicFile.ReadData((uint)sh.Flash_start_address, (uint)sh.Length); bool data_matches = true; if (symboldataBIN.Length == symboldataECU.Length) { for (int t = 0; t < symboldataBIN.Length; t++) { if ((byte)symboldataBIN.GetValue(t) != (byte)symboldataECU.GetValue(t)) { data_matches = false; break; } } if (!data_matches) { if (which_direction == SyncOption.ToECU) { //progress.SetProgress("Writing " + sh.Varname + " to ECU"); // <GS-08022011> if the user switch offline in the meantime // stop sync action to prevent damage to data if (_ECUmode == OperationMode.ModeOffline) break; //if (_APPmode == OperationMode.ModeOffline) break; _ecuConnection.WriteSymbolDataForced(sh.Start_address, sh.Length, symboldataBIN); } else { // <GS-08022011> if the user switch offline in the meantime // stop sync action to prevent damage to data if (_ECUmode == OperationMode.ModeOffline) break; //if (_APPmode == OperationMode.ModeOffline) break; m_trionicFile.WriteDataNoCounterIncrease(symboldataECU, (uint)sh.Flash_start_address); } } } } } } SetStatusText("Synchronized"); SetTaskProgress(0, false); // progress.Close(); // preventUpdatePaint = false; } _ecuConnection.ProhibitRead = false; }
private void LoadSettings() { // default SetSyncOption(0); // load RegistryKey regKeyAppRoot = Registry.CurrentUser.CreateSubKey(@"Software\Webgear\GOContactSync"); if (regKeyAppRoot.GetValue("SyncOption") != null) { _syncOption = (SyncOption)regKeyAppRoot.GetValue("SyncOption"); SetSyncOption((int)_syncOption); } if (regKeyAppRoot.GetValue("SyncProfile") != null) tbSyncProfile.Text = (string)regKeyAppRoot.GetValue("SyncProfile"); if (regKeyAppRoot.GetValue("SyncDelete") != null) btSyncDelete.Checked = Convert.ToBoolean(regKeyAppRoot.GetValue("SyncDelete")); if (regKeyAppRoot.GetValue("Username") != null) { UserName.Text = regKeyAppRoot.GetValue("Username") as string; if (regKeyAppRoot.GetValue("Password") != null) Password.Text = Encryption.DecryptPassword(UserName.Text, regKeyAppRoot.GetValue("Password") as string); } if (regKeyAppRoot.GetValue("AutoSync") != null) autoSyncCheckBox.Checked = Convert.ToBoolean(regKeyAppRoot.GetValue("AutoSync")); if (regKeyAppRoot.GetValue("AutoSyncInterval") != null) autoSyncInterval.Value = Convert.ToDecimal(regKeyAppRoot.GetValue("AutoSyncInterval")); if (regKeyAppRoot.GetValue("AutoStart") != null) runAtStartupCheckBox.Checked = Convert.ToBoolean(regKeyAppRoot.GetValue("AutoStart")); autoSyncCheckBox_CheckedChanged(null, null); }
public TeamMailboxSyncRpcInParameters(Guid mailboxGuid, OrganizationId orgId, string clientString, SyncOption syncOption, string domainController) { this.MailboxGuid = mailboxGuid; this.OrgId = orgId; this.ClientString = clientString; this.SyncOption = syncOption; this.DomainController = domainController; base.SetParameterValue("MailboxGuid", this.MailboxGuid); base.SetParameterValue("OrgId", this.OrgId); base.SetParameterValue("ClientString", this.ClientString); base.SetParameterValue("SyncOption", this.SyncOption); base.SetParameterValue("DomainController", this.DomainController); }
private void LoadSettings(string _profile) { Logger.Log("Loading settings from registry...", EventType.Information); RegistryKey regKeyAppRoot = Registry.CurrentUser.CreateSubKey(AppRootKey + (_profile != null ? ('\\' + _profile) : "")); //only for downside compliance reasons: load old registry settings first and save them later on in new structure if (Registry.CurrentUser.OpenSubKey(@"Software\Webgear\GOContactSync") != null) { //MessageBox.Show("Your settings have been deleted because of an upgrade! You simply need to reconfigure them. Thx!", Application.ProductName + " - INFORMATION",MessageBoxButtons.OK); //Registry.CurrentUser.DeleteSubKeyTree(@"Software\Webgear\GOContactSync"); regKeyAppRoot = Registry.CurrentUser.CreateSubKey(@"Software\Webgear\GOContactSync" + (_profile != null ? ('\\' + _profile) : "")); } if (regKeyAppRoot.GetValue(RegistrySyncOption) != null) { syncOption = (SyncOption)regKeyAppRoot.GetValue(RegistrySyncOption); SetSyncOption((int)syncOption); } if (regKeyAppRoot.GetValue(RegistryUsername) != null) { UserName.Text = regKeyAppRoot.GetValue(RegistryUsername) as string; //if (regKeyAppRoot.GetValue("Password") != null) // Password.Text = Encryption.DecryptPassword(UserName.Text, regKeyAppRoot.GetValue("Password") as string); } //if (regKeyAppRoot.GetValue("Password") != null) //{ // regKeyAppRoot.DeleteValue("Password"); //} //temporary remove listener this.autoSyncCheckBox.CheckedChanged -= new System.EventHandler(this.autoSyncCheckBox_CheckedChanged); ReadRegistryIntoCheckBox(autoSyncCheckBox, regKeyAppRoot.GetValue(RegistryAutoSync)); ReadRegistryIntoNumber(autoSyncInterval, regKeyAppRoot.GetValue(RegistryAutoSyncInterval)); ReadRegistryIntoCheckBox(runAtStartupCheckBox, regKeyAppRoot.GetValue(RegistryAutoStart)); ReadRegistryIntoCheckBox(reportSyncResultCheckBox, regKeyAppRoot.GetValue(RegistryReportSyncResult)); ReadRegistryIntoCheckBox(btSyncDelete, regKeyAppRoot.GetValue(RegistrySyncDeletion)); ReadRegistryIntoCheckBox(btPromptDelete, regKeyAppRoot.GetValue(RegistryPromptDeletion)); ReadRegistryIntoNumber(pastMonthInterval, regKeyAppRoot.GetValue(RegistrySyncAppointmentsMonthsInPast)); ReadRegistryIntoNumber(futureMonthInterval, regKeyAppRoot.GetValue(RegistrySyncAppointmentsMonthsInFuture)); if (regKeyAppRoot.GetValue(RegistrySyncAppointmentsTimezone) != null) appointmentTimezonesComboBox.Text = regKeyAppRoot.GetValue(RegistrySyncAppointmentsTimezone) as string; ReadRegistryIntoCheckBox(btSyncAppointments, regKeyAppRoot.GetValue(RegistrySyncAppointments)); //ReadRegistryIntoCheckBox(btSyncNotes, regKeyAppRoot.GetValue(RegistrySyncNotes));//ToDo: Google.Documents API Replaced by Google.Drive API on 21-Apr-2015 object registryEntry = regKeyAppRoot.GetValue(RegistrySyncNotes); if (registryEntry != null) { try { bool syncNotes = Convert.ToBoolean(registryEntry); if (syncNotes) Logger.Log("Notes Sync doesn't work anymore, because Google.Documents API was replaced by Google.Drive API on 21-Apr-2015 and it is not compatible. Thefore Notes Sync was removed from GCSM.", EventType.Information); } catch (Exception) { //ignored; } } ReadRegistryIntoCheckBox(btSyncContacts, regKeyAppRoot.GetValue(RegistrySyncContacts)); ReadRegistryIntoCheckBox(chkUseFileAs, regKeyAppRoot.GetValue(RegistryUseFileAs)); if (regKeyAppRoot.GetValue(RegistryLastSync) != null) { try { lastSync = new DateTime(Convert.ToInt64(regKeyAppRoot.GetValue(RegistryLastSync))); SetLastSyncText(lastSync.ToString()); } catch (System.FormatException ex) { Logger.Log("LastSyncDate couldn't be read from registry (" + regKeyAppRoot.GetValue(RegistryLastSync) + "): " + ex, EventType.Warning); } } LoadSettingsFolders(_profile); //autoSyncCheckBox_CheckedChanged(null, null); btSyncContacts_CheckedChanged(null, null); //btSyncNotes_CheckedChanged(null, null);//ToDo: Google.Documents API Replaced by Google.Drive API on 21-Apr-2015 _proxy.LoadSettings(_profile); //only for downside compliance reasons: load old registry settings first and save them later on in new structure if (Registry.CurrentUser.OpenSubKey(@"Software\Webgear\GOContactSync") != null) { SaveSettings(_profile); Registry.CurrentUser.DeleteSubKeyTree(@"Software\Webgear\GOContactSync"); } //enable temporary disabled listener this.autoSyncCheckBox.CheckedChanged += new System.EventHandler(this.autoSyncCheckBox_CheckedChanged); }
protected override Job InternalCreateJob(TeamMailboxSyncInfo info, string clientString, SyncOption syncOption) { return(new MaintenanceSyncJob(this, this.config, info, clientString, syncOption)); }
protected abstract Job InternalCreateJob(TeamMailboxSyncInfo info, string clientString, SyncOption syncOption);
public static EnqueueResult EnqueueTeamMailboxSyncRequest(string targetServer, Guid mailboxGuid, QueueType queueType, OrganizationId orgId, string clientString, string domainController, SyncOption syncOption = SyncOption.Default) { if (mailboxGuid == Guid.Empty) { throw new ArgumentNullException("mailboxGuid"); } if (orgId == null) { throw new ArgumentNullException("orgId"); } if (queueType != QueueType.TeamMailboxDocumentSync && queueType != QueueType.TeamMailboxMembershipSync && queueType != QueueType.TeamMailboxMaintenanceSync) { throw new ArgumentException("queueType"); } RpcClientWrapper.InitializeIfNeeded(); if (!RpcClientWrapper.instance.initialized) { return(new EnqueueResult(EnqueueResultType.ClientInitError, ClientStrings.RpcClientInitError)); } EnqueueResult result; try { using (JobQueueRpcClient jobQueueRpcClient = new JobQueueRpcClient(targetServer ?? RpcClientWrapper.instance.localServer.Fqdn)) { TeamMailboxSyncRpcInParameters teamMailboxSyncRpcInParameters = new TeamMailboxSyncRpcInParameters(mailboxGuid, orgId, clientString, syncOption, domainController); byte[] data = jobQueueRpcClient.EnqueueRequest(1, (int)queueType, teamMailboxSyncRpcInParameters.Serialize()); EnqueueRequestRpcOutParameters enqueueRequestRpcOutParameters = new EnqueueRequestRpcOutParameters(data); result = enqueueRequestRpcOutParameters.Result; } } catch (RpcException ex) { result = new EnqueueResult(EnqueueResultType.RpcError, ClientStrings.RpcClientRequestError(ex.Message)); } return(result); }