Пример #1
0
 static OrderController CreateSeparateServices()
 {
     var reader = new Reader<Order>();
     var saver = new Saver<Order>();
     var deleter = new Deleter<Order>();
     return new OrderController(reader, saver, deleter);
 }
Пример #2
0
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine(@"Please write arguments in this format: ""path:\to\directory"" ""the number of weeks from the last opening"" ");
                Console.ReadLine();
                return;
            }
            string path = args[0];
            string date = args[1];

            var check = new ArgsChecker();

            if (!check.CheckPath(path))
            {
                Console.Write("Please enter valid path");
                Console.ReadLine();
                return;
            }

            if (!check.CheckDate(date))
            {
                Console.Write("Please enter valid date");
                Console.ReadLine();
                return;
            }

            var delete = new Deleter();
            delete.DeleteOlds(path, int.Parse(date) * 7);
        }
 public void step_02()
 {
     Deleter.DeleteServicesFromTempCity();
 }
Пример #4
0
 public IObservable <Unit> DeleteAsObservable(Uri uri)
 {
     return(Deleter.DeleteAsObservable(uri));
 }
Пример #5
0
        /// <summary>
        /// Performs the desired action of each menu item when
        /// selected from the drop down menu list.
        /// </summary>
        /// <param name="item">Selected menu item.</param>
        public override bool OnOptionsItemSelected(IMenuItem item)
        {
            Dialog dialog = null;

            AlertDialog.Builder builder = new AlertDialog.Builder(this);

            //Choose which action to do: Logout, View Messages, Leave Group, Edit Profile, Delete Account
            switch (item.ItemId)
            {
            case Resource.Id.logout:
                // Create the logout confirmation dialog
                builder.SetMessage(Resource.String.logout_question)
                .SetCancelable(false)
                .SetPositiveButton(Resource.String.yes, (senderAlert, args) =>
                {
                    //Send the logout request to the server
                    Deleter.DeleteObject(MainActivity.serverURL + MainActivity.login_ext + "/" + MainActivity.credentials.username + "/" + MainActivity.credentials.token);

                    userProfile         = null;
                    Intent logoutIntent = new Intent(this, typeof(MainActivity));
                    logoutIntent.SetFlags(ActivityFlags.ClearTop | ActivityFlags.NewTask);
                    StartActivity(logoutIntent);
                })
                .SetNegativeButton(Resource.String.no, (senderAlert, args) => { });

                //Build and show the logout dialog
                dialog = builder.Create();
                dialog.Show();
                return(true);

            case Resource.Id.viewMessages:
                // Start ViewMessagesActivity
                StartActivity(typeof(ViewInbox));
                return(true);

            case Resource.Id.leaveGroup:
                // Create the leave group confirmation dialog
                builder.SetMessage(Resource.String.leave_group_question)
                .SetCancelable(false)
                .SetPositiveButton(Resource.String.yes, (senderAlert, args) =>
                {
                    //Tell the server to remove the user from their current group
                    Deleter.DeleteObject(MainActivity.serverURL + MainActivity.user_group + "/" + MainActivity.credentials.username + "/" + MainActivity.credentials.token);
                })
                .SetNegativeButton(Resource.String.no, (senderAlert, args) => { });

                //Build and show the leave group dialog
                dialog = builder.Create();
                dialog.Show();
                return(true);

            case Resource.Id.editProfile:
                // Pass profile object and start EditProfileActivity
                Intent editIntent       = new Intent(this, typeof(EditProfileActivity));
                var    serializedObject = JsonConvert.SerializeObject(userProfile);
                editIntent.PutExtra("UserProfile", serializedObject);
                StartActivity(editIntent);
                return(true);

            case Resource.Id.deleteUser:
                // Create the delete user confirmation dialog
                builder.SetMessage(Resource.String.delete_question)
                .SetCancelable(false)
                .SetPositiveButton(Resource.String.yes, (senderAlert, args) =>
                {
                    Deleter.DeleteObject(MainActivity.serverURL + "user/" + MainActivity.credentials.username + "/" + MainActivity.credentials.token);
                    userProfile         = null;
                    Intent deleteIntent = new Intent(this, typeof(MainActivity));
                    deleteIntent.SetFlags(ActivityFlags.ClearTop | ActivityFlags.NewTask);
                    StartActivity(deleteIntent);
                })
                .SetNegativeButton(Resource.String.no, (senderAlert, args) => { });

                //Build and show the account deletion dialog
                dialog = builder.Create();
                dialog.Show();
                return(true);
            }
            return(base.OnOptionsItemSelected(item));
        }
Пример #6
0
 public unsafe ImageFrame(ImageFormat.Types.Format format, int width, int height, int widthStep, NativeArray <byte> pixelData, Deleter deleter)
     : this(format, width, height, widthStep, (IntPtr)NativeArrayUnsafeUtility.GetUnsafeReadOnlyPtr(pixelData), deleter)
 {
 }
Пример #7
0
 public ImageFrame(ImageFormat.Types.Format format, int width, int height, int widthStep, IntPtr pixelData, Deleter deleter) : base()
 {
     unsafe
     {
         UnsafeNativeMethods.mp_ImageFrame__ui_i_i_i_Pui8_PF(format, width, height, widthStep, pixelData, deleter, out var ptr).Assert();
         this.ptr = ptr;
     }
 }
Пример #8
0
 // this will hold the empty game object in the scene that holds the Health value
 void Start()
 {
     playerStats = GameObject.Find("playerStats");
     // we have assigned the variable player stats to the empty gameobject we talked about above
     Deleter = FindObjectOfType <Deleter>();
 }