[21241] | 1 | using System; |
---|
| 2 | using System.Collections.Generic; |
---|
| 3 | using System.Linq; |
---|
| 4 | using System.Text; |
---|
| 5 | using System.Xml; |
---|
| 6 | using Picasa2Piwigo; |
---|
| 7 | using System.Windows.Forms; |
---|
| 8 | using System.Drawing; |
---|
| 9 | |
---|
| 10 | namespace Picasa2PiwigoCommonFunctions |
---|
| 11 | { |
---|
| 12 | public class LabelAdjust |
---|
| 13 | { |
---|
| 14 | public void AdjustLabelSize(Label labeltoadjust) |
---|
| 15 | { |
---|
| 16 | while (labeltoadjust.Width < System.Windows.Forms.TextRenderer.MeasureText(labeltoadjust.Text, |
---|
| 17 | new Font(labeltoadjust.Font.FontFamily, labeltoadjust.Font.Size, labeltoadjust.Font.Style)).Width) |
---|
| 18 | { |
---|
| 19 | labeltoadjust.Font = new Font(labeltoadjust.Font.FontFamily, labeltoadjust.Font.Size - 0.5f, labeltoadjust.Font.Style); |
---|
| 20 | } |
---|
| 21 | } |
---|
| 22 | public void AdjustRadioButtonSize(RadioButton Radiotoadjust) |
---|
| 23 | { |
---|
| 24 | while (Radiotoadjust.Width < System.Windows.Forms.TextRenderer.MeasureText(Radiotoadjust.Text, |
---|
| 25 | new Font(Radiotoadjust.Font.FontFamily, Radiotoadjust.Font.Size, Radiotoadjust.Font.Style)).Width) |
---|
| 26 | { |
---|
| 27 | Radiotoadjust.Font = new Font(Radiotoadjust.Font.FontFamily, Radiotoadjust.Font.Size - 0.5f, Radiotoadjust.Font.Style); |
---|
| 28 | } |
---|
| 29 | } |
---|
| 30 | public void AdjustButtonSize(Button ButtonToadjust) |
---|
| 31 | { |
---|
| 32 | while (ButtonToadjust.Width < System.Windows.Forms.TextRenderer.MeasureText(ButtonToadjust.Text, |
---|
| 33 | new Font(ButtonToadjust.Font.FontFamily, ButtonToadjust.Font.Size, ButtonToadjust.Font.Style)).Width) |
---|
| 34 | { |
---|
| 35 | ButtonToadjust.Font = new Font(ButtonToadjust.Font.FontFamily, ButtonToadjust.Font.Size - 0.5f, ButtonToadjust.Font.Style); |
---|
| 36 | } |
---|
| 37 | } |
---|
| 38 | } |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | namespace Picasa2PiwigoConstants |
---|
| 42 | { |
---|
| 43 | public class constants |
---|
| 44 | { |
---|
| 45 | //debug settings |
---|
| 46 | public const bool DEBUG_LOCALE = false; |
---|
| 47 | public const string SET_LOCALE = "es"; |
---|
| 48 | public const bool DEBUG_LOG_ENABLED = false; |
---|
| 49 | |
---|
| 50 | public const int COMMAND_START_UP = 1; |
---|
| 51 | public const int COMMAND_ADD_TO_ALBUM = 2; |
---|
| 52 | public const int COMMAND_NEW_ALBUM = 3; |
---|
| 53 | |
---|
| 54 | public const int MAX_DUPLICATE_FILENAMES = 10000; |
---|
| 55 | public const int MAX_NUMBER_OF_CONTACTS = 512; |
---|
| 56 | public struct PersonIDStruct |
---|
| 57 | { |
---|
| 58 | public string name; |
---|
| 59 | public int index; |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | public struct UniqueIDStruct |
---|
| 63 | { |
---|
| 64 | public string unique_id; |
---|
| 65 | public int index; |
---|
| 66 | } |
---|
| 67 | } |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | namespace Picasa2Piwigo |
---|
| 71 | { |
---|
| 72 | using Picasa2PiwigoConstants; |
---|
| 73 | static class GlobalClass |
---|
| 74 | { |
---|
| 75 | private static constants.PersonIDStruct[] m_contact_array = new constants.PersonIDStruct[constants.MAX_NUMBER_OF_CONTACTS]; |
---|
| 76 | private static constants.UniqueIDStruct[] m_picasa_unique_id_arrary = new constants.UniqueIDStruct[constants.MAX_NUMBER_OF_CONTACTS]; |
---|
| 77 | private static XmlDocument m_AlbumList = new XmlDocument(); |
---|
| 78 | private static string m_NewAlbumName; |
---|
| 79 | private static int m_NewAlbumParentID; |
---|
| 80 | private static string m_StatusDialogErrorMessage; |
---|
| 81 | private static int m_AddAlbumCategoryID; |
---|
| 82 | private static int m_person_count; |
---|
| 83 | private static int m_unique_id_count; |
---|
| 84 | private static string m_PiwigoVersionNumber; |
---|
| 85 | private static string m_NewAlbumDescription; |
---|
| 86 | |
---|
| 87 | public static XmlDocument AlbumList |
---|
| 88 | { |
---|
| 89 | get { return m_AlbumList;} |
---|
| 90 | set {m_AlbumList = value;} |
---|
| 91 | } |
---|
| 92 | public static string NewAlbumName |
---|
| 93 | { |
---|
| 94 | get { return m_NewAlbumName; } |
---|
| 95 | set { m_NewAlbumName = value; } |
---|
| 96 | } |
---|
| 97 | public static int NewAlbumNameParentID |
---|
| 98 | { |
---|
| 99 | get { return m_NewAlbumParentID; } |
---|
| 100 | set { m_NewAlbumParentID = value; } |
---|
| 101 | } |
---|
| 102 | public static string StatusDialogErrorMessage |
---|
| 103 | { |
---|
| 104 | get { return m_StatusDialogErrorMessage; } |
---|
| 105 | set { m_StatusDialogErrorMessage = value; } |
---|
| 106 | } |
---|
| 107 | public static constants.PersonIDStruct[] contact_array |
---|
| 108 | { |
---|
| 109 | get { return m_contact_array; } |
---|
| 110 | set { m_contact_array = value; } |
---|
| 111 | } |
---|
| 112 | public static constants.UniqueIDStruct[] picasa_unique_id_arrary |
---|
| 113 | { |
---|
| 114 | get { return m_picasa_unique_id_arrary; } |
---|
| 115 | set { m_picasa_unique_id_arrary = value; } |
---|
| 116 | } |
---|
| 117 | public static int AddAlbumCategoryID |
---|
| 118 | { |
---|
| 119 | get { return m_AddAlbumCategoryID; } |
---|
| 120 | set { m_AddAlbumCategoryID = value; } |
---|
| 121 | } |
---|
| 122 | public static int person_count |
---|
| 123 | { |
---|
| 124 | get { return m_person_count; } |
---|
| 125 | set { m_person_count = value; } |
---|
| 126 | } |
---|
| 127 | public static int unique_id_count |
---|
| 128 | { |
---|
| 129 | get { return m_unique_id_count; } |
---|
| 130 | set { m_unique_id_count = value; } |
---|
| 131 | } |
---|
| 132 | public static string NewAlbumDescription |
---|
| 133 | { |
---|
| 134 | get { return m_NewAlbumDescription; } |
---|
| 135 | set { m_NewAlbumDescription = value; } |
---|
| 136 | } |
---|
| 137 | public static string PiwigoVersionNumber |
---|
| 138 | { |
---|
| 139 | get { return m_PiwigoVersionNumber; } |
---|
| 140 | set { m_PiwigoVersionNumber = value; } |
---|
| 141 | } |
---|
| 142 | } |
---|
| 143 | } |
---|