public void Deinitialize(GlobalListener globalListener) { AccountService.GetAccountDetailsFinish -= OnGetAccountDetailsFinish; // Add folders to global listener to receive notifications globalListener.Folders.Remove(this.CloudDrive); globalListener.Folders.Remove(this.RubbishBin); }
public async void Initialize(GlobalListener globalListener) { // Add folders to global listener to receive notifications globalListener.Folders.Add(this.CameraUploads); // Create Camera Uploads folder node if not exists await this.CameraUploads.CreateRootNodeIfNotExists(); }
public void Deinitialize(GlobalListener globalListener) { GlobalListener.StorageStateChanged -= OnStorageStateChanged; // Add folders to global listener to receive notifications globalListener.Folders.Remove(this.CloudDrive); globalListener.Folders.Remove(this.RubbishBin); }
// Use this for initialization void Start() { UnityEngine.Object.DontDestroyOnLoad(obj); setConnectionListener(); setGroupListener(); Instance = this; }
/// <summary> /// Remove folders from global listener /// </summary> /// <param name="globalListener">Global notifications listener</param> public void Deinitialize(GlobalListener globalListener) { if (globalListener == null) { return; } globalListener.NodeAdded -= CloudDrive.OnNodeAdded; globalListener.NodeRemoved -= CloudDrive.OnNodeRemoved; globalListener.OutSharedFolderAdded -= CloudDrive.OnOutSharedFolderUpdated; globalListener.OutSharedFolderRemoved -= CloudDrive.OnOutSharedFolderUpdated; globalListener.NodeAdded -= RubbishBin.OnNodeAdded; globalListener.NodeRemoved -= RubbishBin.OnNodeRemoved; globalListener.NodeAdded -= CameraUploads.OnNodeAdded; globalListener.NodeRemoved -= CameraUploads.OnNodeRemoved; }
private void InitializeApplication() { if (ApplicationInitialized) { return; } // Clear settings values we do no longer use AppService.ClearObsoleteSettings(); // Initialize the application information if (AppInformation == null) { AppInformation = new AppInformation(); } // Initialize the links information LinkInformationService.Reset(); // Initialize SDK parameters SdkService.InitializeSdkParams(); // Add a global notifications listener GlobalListener = new GlobalListener(); SdkService.MegaSdk.addGlobalListener(GlobalListener); // Add a global request listener to process all. SdkService.MegaSdk.addRequestListener(this); // Add a global transfer listener to process all transfers. SdkService.MegaSdk.addTransferListener(TransferService.GlobalTransferListener); // Initialize Folders AppService.InitializeAppFolders(); // Initialize the DB AppService.InitializeDatabase(); // Save the app information for future use (like deleting settings) AppService.SaveAppInformation(); // Ensure we don't initialize again ApplicationInitialized = true; }
public void Deinitialize(GlobalListener globalListener) { }
// Do not add any additional code to this method private async void InitializePhoneApplication() { if (phoneApplicationInitialized) { return; } // Create the frame but don't set it as RootVisual yet; this allows the splash // screen to remain active until the application is ready to render. RootFrame = new RadPhoneApplicationFrame { // Add default page transitions animations Transition = new RadTransition() { ForwardInAnimation = AnimationService.GetPageInAnimation(), ForwardOutAnimation = AnimationService.GetPageOutAnimation(), BackwardInAnimation = AnimationService.GetPageInAnimation(), BackwardOutAnimation = AnimationService.GetPageOutAnimation(), } }; RootFrame.Navigated += CompleteInitializePhoneApplication; // Handle navigation failures RootFrame.NavigationFailed += RootFrame_NavigationFailed; // Handle reset requests for clearing the backstack RootFrame.Navigated += CheckForResetNavigation; #if WINDOWS_PHONE_81 RootFrame.Navigating += RootFrameOnNavigating; // Handle contract activation such as returned values from file open or save picker PhoneApplicationService.Current.ContractActivated += CurrentOnContractActivated; #endif // Assign the URI-mapper class to the application frame. RootFrame.UriMapper = new AssociationUriMapper(); // Initialize the application information AppInformation = new AppInformation(); // Initialize the links information LinkInformation = new LinkInformation(); // Initialize SDK parameters SdkService.InitializeSdkParams(); // Initialize the main drive CloudDrive = new CloudDriveViewModel(SdkService.MegaSdk, AppInformation); // Add a global notifications listener. GlobalListener = new GlobalListener(AppInformation); SdkService.MegaSdk.addGlobalListener(GlobalListener); // Add a global request listener to process all. SdkService.MegaSdk.addRequestListener(this); // Add a global transfer listener to process all transfers. SdkService.MegaSdk.addTransferListener(TransfersService.GlobalTransferListener); // Initialize Folders AppService.InitializeAppFolders(); // Set the current resolution that we use later on for our image selection AppService.CurrentResolution = ResolutionHelper.CurrentResolution; // Clear settings values we do no longer use AppService.ClearObsoleteSettings(); // Save the app version information for future use (like deleting settings) AppService.SaveAppInformation(); // Set MEGA red as Accent Color ((SolidColorBrush)Resources["PhoneAccentBrush"]).Color = (Color)Resources["MegaRedColor"]; // Ensure we don't initialize again phoneApplicationInitialized = true; }
public void Deinitialize(GlobalListener globalListener) { // Add folders to global listener to receive notifications globalListener.Folders.Remove(this.CameraUploads); }
public void Deinitialize(GlobalListener globalListener) { // Add folders to global listener to receive notifications globalListener.Nodes.Remove(this); }
public void Initialize(GlobalListener globalListener) { // Add folders to global listener to receive notifications globalListener.Folders.Add(this.FolderLink); }
public void Deinitialize(GlobalListener globalListener) { // Remove contacts of global listener globalListener.Contacts.Remove(this); }
public void Initialize(GlobalListener globalListener) { // Add contacts to global listener to receive notifications globalListener.Contacts.Add(this); }