private void UpdatePatch() { long lS; string lN; bool isCritical = false; var dict = UpdatingLib.DefineSizeOfFiles(out lS, out lN, out isCritical); if (dict.Count > 0) { if (isCritical) { if (MessageBox.Show( @"�������� ����� ����������� ���������� ����������." + Environment.NewLine + @"�����!!! ��� ���� ����������� ��������� � ����� " + Furniture.Helpers.LocalAccounts.modelPathResult + @" ����� �������!" + Environment.NewLine + @"���������� ��������� ��� ���� ���������� � ���������� � ��������� �����!", @"MrDoors", MessageBoxButtons.OK, MessageBoxIcon.Question) == DialogResult.OK) { UpdatePatchAfterQuestion(dict, lS, lN); } } else { if (MessageBox.Show( @"�������� ����� ���������� ����������. ��������?" + Environment.NewLine + @"�����!!! ��� ���� ����������� ��������� � ����� " + Furniture.Helpers.LocalAccounts.modelPathResult + @" ����� �������!" + Environment.NewLine + @"���������� ��������� ��� ���� ���������� � ���������� � ��������� �����!", @"MrDoors", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { var listNameOfPatches = dict.Keys.ToList(); listNameOfPatches.Sort((x, y) => UpdatingLib.GetDate(x).CompareTo(UpdatingLib.GetDate(y))); string lastPatch = listNameOfPatches.Last(); long sizePatches = dict.Sum(l => l.Value); //if ((UpdatingLib.GetDate(lN) > UpdatingLib.GetDate(lastPatch)) || // (UpdatingLib.GetDate(lN) == UpdatingLib.GetDate(lastPatch) && lS <= sizePatches)) if ((UpdatingLib.GetDate(lN) > UpdatingLib.GetDate(lastPatch)) && (lS <= sizePatches)) { var f = new UpdatingLib("L"); f.Updating(); } else { var f = new UpdatingLib("P"); f.Updating(); } } else return; } } else if (lS > 0 && MessageBox.Show(@"�������� ����� ���������� ����������. ��������?" + Environment.NewLine + @"�����!!! ��� ���� ����������� ��������� � ����� " + Furniture.Helpers.LocalAccounts.modelPathResult + @" ����� �������!" + Environment.NewLine + @"���������� ��������� ��� ���� ���������� � ���������� � ��������� �����!", @"MrDoors", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { var f = new UpdatingLib("L"); f.Updating(); } }
public int UpdateLib() { if (MessageBox.Show(@"�������� ����������?", @"MrDoors", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { var f = new UpdatingLib("L"); SetParent(f.Handle, _swHandle); f.Updating(); } return 1; }
private static void UpdatePatchAfterQuestion(Dictionary<string, long> dict, long lS, string lN) { var listNameOfPatches = dict.Keys.ToList(); listNameOfPatches.Sort((x, y) => UpdatingLib.GetDate(x).CompareTo(UpdatingLib.GetDate(y))); string lastPatch = listNameOfPatches.Last(); long sizePatches = dict.Sum(l => l.Value); if ((UpdatingLib.GetDate(lN) > UpdatingLib.GetDate(lastPatch)) || (UpdatingLib.GetDate(lN) == UpdatingLib.GetDate(lastPatch) && lS <= sizePatches)) { var f = new UpdatingLib("L"); f.Updating(); } else { var f = new UpdatingLib("P"); f.Updating(); } }
private void btnIpdateLib_Click(object sender, EventArgs e) { var f = new UpdatingLib("L"); f.Updating(true); }