Exemple #1
0
        public static void DisposeService(CoreServiceInfo csi)
        {
            if (csi == null)
            {
                return;
            }

            csi.ToConsole("Disposing...");

            if (!csi.Disposed)
            {
                if (csi.DisposeSupported)
                {
                    TryCatch(csi.GetDisposeHandler(), csi.ToConsole);
                }

                TryCatch(csi.OnDisposed, csi.ToConsole);

                if (OnServiceDisposed != null)
                {
                    TryCatch(() => OnServiceDisposed(csi), csi.ToConsole);
                }

                csi.ToConsole("Done.");
            }
            else
            {
                csi.ToConsole("Already disposed, no action taken.");
            }
        }
Exemple #2
0
        public static void SaveService(CoreServiceInfo csi)
        {
            if (csi == null)
            {
                return;
            }

            csi.ToConsole("Saving...");

            TryCatch(csi.SaveOptions, csi.ToConsole);

            if (csi.SaveSupported)
            {
                TryCatch(csi.GetSaveHandler(), csi.ToConsole);
            }

            TryCatch(csi.OnSaved, csi.ToConsole);

            if (OnServiceSaved != null)
            {
                TryCatch(() => OnServiceSaved(csi), csi.ToConsole);
            }

            csi.ToConsole("Done.");
        }
Exemple #3
0
        public static void LoadService(CoreServiceInfo csi)
        {
            if (csi == null)
            {
                return;
            }

            csi.ToConsole("Loading...");

            TryCatch(csi.LoadOptions, csi.ToConsole);

            if (csi.LoadSupported)
            {
                TryCatch(csi.GetLoadHandler(), csi.ToConsole);
            }

            TryCatch(csi.OnLoaded, csi.ToConsole);

            if (OnServiceLoaded != null)
            {
                TryCatch(() => OnServiceLoaded(csi), csi.ToConsole);
            }

            csi.ToConsole("Done.");
        }
Exemple #4
0
        public static void ConfigureService(CoreServiceInfo csi)
        {
            if (csi == null)
            {
                return;
            }

            csi.ToConsole("Configuring...");

            if (!csi.Configured)
            {
                if (csi.ConfigSupported)
                {
                    TryCatch(csi.GetConfigHandler(), csi.ToConsole);
                }

                TryCatch(csi.OnConfigured, csi.ToConsole);

                if (OnServiceConfigured != null)
                {
                    TryCatch(() => OnServiceConfigured(csi), csi.ToConsole);
                }

                csi.ToConsole("Done.");
            }
            else
            {
                csi.ToConsole("Already configured, no action taken.");
            }
        }
Exemple #5
0
        public static void InvokeService(CoreServiceInfo csi)
        {
            if (csi == null)
            {
                return;
            }

            csi.ToConsole("Invoking...");

            if (!csi.Invoked)
            {
                if (csi.InvokeSupported)
                {
                    TryCatch(csi.GetInvokeHandler(), csi.ToConsole);
                }

                TryCatch(csi.OnInvoked, csi.ToConsole);

                if (OnServiceInvoked != null)
                {
                    TryCatch(() => OnServiceInvoked(csi), csi.ToConsole);
                }

                csi.ToConsole("Done.");
            }
            else
            {
                csi.ToConsole("Already invoked, no action taken.");
            }
        }
Exemple #6
0
		public static void DisposeService(CoreServiceInfo csi)
		{
			if (csi == null)
			{
				return;
			}

			csi.ToConsole("Disposing...");

			if (!csi.Disposed)
			{
				if (csi.DisposeSupported)
				{
					TryCatch(csi.GetDisposeHandler(), csi.ToConsole);
				}

				TryCatch(csi.OnDisposed, csi.ToConsole);

				if (OnServiceDisposed != null)
				{
					TryCatch(() => OnServiceDisposed(csi), csi.ToConsole);
				}

				csi.ToConsole("Done.");
			}
			else
			{
				csi.ToConsole("Already disposed, no action taken.");
			}
		}
Exemple #7
0
		public static void LoadService(CoreServiceInfo csi)
		{
			if (csi == null)
			{
				return;
			}

			csi.ToConsole("Loading...");

			TryCatch(csi.LoadOptions, csi.ToConsole);

			if (csi.LoadSupported)
			{
				TryCatch(csi.GetLoadHandler(), csi.ToConsole);
			}

			TryCatch(csi.OnLoaded, csi.ToConsole);

			if (OnServiceLoaded != null)
			{
				TryCatch(() => OnServiceLoaded(csi), csi.ToConsole);
			}

			csi.ToConsole("Done.");
		}
Exemple #8
0
		public static void SaveService(CoreServiceInfo csi)
		{
			if (csi == null)
			{
				return;
			}

			csi.ToConsole("Saving...");

			TryCatch(csi.SaveOptions, csi.ToConsole);

			if (csi.SaveSupported)
			{
				TryCatch(csi.GetSaveHandler(), csi.ToConsole);
			}

			TryCatch(csi.OnSaved, csi.ToConsole);

			if (OnServiceSaved != null)
			{
				TryCatch(() => OnServiceSaved(csi), csi.ToConsole);
			}

			csi.ToConsole("Done.");
		}
Exemple #9
0
		public static void InvokeService(CoreServiceInfo csi)
		{
			if (csi == null)
			{
				return;
			}

			csi.ToConsole("Invoking...");

			if (!csi.Invoked)
			{
				if (csi.InvokeSupported)
				{
					TryCatch(csi.GetInvokeHandler(), csi.ToConsole);
				}

				TryCatch(csi.OnInvoked, csi.ToConsole);

				if (OnServiceInvoked != null)
				{
					TryCatch(() => OnServiceInvoked(csi), csi.ToConsole);
				}

				csi.ToConsole("Done.");
			}
			else
			{
				csi.ToConsole("Already invoked, no action taken.");
			}
		}
Exemple #10
0
		public static void ConfigureService(CoreServiceInfo csi)
		{
			if (csi == null)
			{
				return;
			}

			csi.ToConsole("Configuring...");

			if (!csi.Configured)
			{
				if (csi.ConfigSupported)
				{
					TryCatch(csi.GetConfigHandler(), csi.ToConsole);
				}

				TryCatch(csi.OnConfigured, csi.ToConsole);

				if (OnServiceConfigured != null)
				{
					TryCatch(() => OnServiceConfigured(csi), csi.ToConsole);
				}

				csi.ToConsole("Done.");
			}
			else
			{
				csi.ToConsole("Already configured, no action taken.");
			}
		}