IIM Home


Home
Members
Archive
Discussions
Screen Shots
Code Outline
C# Recipes
Contact Information

namespace InternalInstantMessenger
{
      public class AddFriendForm : Form
      {
            // Methods
            static AddFriendForm();
            public AddFriendForm(IIMController iimc, IIMDock iimDock, ArrayList friendsList);
            private void AddToFriendsButton_Click(object sender, EventArgs e);
            private void ClearSelection_Click(object sender, EventArgs e);
            private void CloseButton_Click(object sender, EventArgs e);
            protected override void Dispose(bool disposing);
            private void FindPeersButton_Click(object sender, EventArgs e);
            private void InitializeComponent();
            public void ProcessNewlyDiscoveredPeers(object sender, Event e);
            private void SelectAllButton_Click(object sender, EventArgs e);
            private void UpdateKnownContactListBox();

            // Fields
            private Button AddToFriendsButton;
            private Button ClearSelection;
            private Button CloseButton;
            private Container components;
            private Button FindPeersButton;
            private ArrayList friendsList;
            private IIMController iimc;
            private IIMDock iimDock;
            private ArrayList knownContacts;
            private CheckedListBox knownContactsListBox;
            private static readonly ILog log;
            private Button SelectAllButton;
            private StatusBar statusBar;
      }

      public class BroadcastClient : UdpClient
      {
            // Methods
            public BroadcastClient();
            public void SetClientToBrodcastMode();
      }

      public class ClientDiscoveryAnswerListenServer : ListenServer
      {
            // Events
            public event ListenServer.NewArrival OnNewArrival;

            // Methods
            public ClientDiscoveryAnswerListenServer();
            private void OnReceive(IAsyncResult ar);
            private void Start();

            // Fields
            private ListenServer.NewArrival OnNewArrival;
      }

      public class ClientDiscoveryListenServer : ListenServer
      {
            // Methods
            public ClientDiscoveryListenServer(ClientInfo me);
            private void OnSend(IAsyncResult ar);
            private void SendResponse(EndPoint endPoint);
            private void Start();

            // Fields
            private ClientInfo me;
      }

      [Serializable]
      public class ClientInfo
      {
            // Methods
            public ClientInfo();
            public ClientInfo(string sn, string un, string cn, string ci, string pw, StatusLevel sl, Guid gd);
            public static string GetPasswordHash(string strPlain);
            public override string ToString();

            // Properties
            public string ComputerIP { get; set; }
            public string ComputerName { get; set; }
            public Guid GUID { get; set; }
            public string Password { set; }
            public string PasswordHash { get; set; }
            public string ScreenName { get; set; }
            public StatusLevel Status { get; set; }
            public string UserName { get; set; }

            // Fields
            private string computerIP;
            private string computerName;
            private Guid guid;
            private string password;
            private string screenName;
            private StatusLevel status;
            private string userName;
      }

      public class ClientStatusUpdateBroadcastListenServer : ListenServer
      {
            // Events
            public event PingRequestReceived OnPingRequestReceived;
            public event StatusUpdateReceived OnStatusUpdateReceived;

            // Methods
            public ClientStatusUpdateBroadcastListenServer(ClientInfo me, ArrayList friends);
            private void OnSend(IAsyncResult ar);
            private void SendResponse(EndPoint endPoint);
            private void Start();

            // Fields
            private ArrayList friends;
            private ClientInfo me;
            private PingRequestReceived OnPingRequestReceived;
            private StatusUpdateReceived OnStatusUpdateReceived;

            // Nested Types
            public delegate void PingRequestReceived(object sender, Event e);


            public delegate void StatusUpdateReceived(object sender, Event e);

      }

      public class ConversationForm : Form
      {
            // Methods
            static ConversationForm();
            public ConversationForm(ClientInfo target, ClientInfo me, Guid convoID, IIMController iimc);
            public ConversationForm(ArrayList members, ClientInfo me, Guid convoID, IIMController iimc);
            private void ChangeFont();
            private void ConversationDisplayBox_KeyDown(object sender, KeyEventArgs kea);
            private void ConversationDisplayBox_LinkClicked(object sender, LinkClickedEventArgs e);
            protected override void Dispose(bool disposing);
            public void FlashChatWindow();
            [DllImport("user32.dll")]
            public static extern bool FlashWindow(IntPtr hwnd, bool flash);
            [DllImport("user32.dll")]
            public static extern bool FlashWindowEx(ref FLASHINFO fInfo);
            private void InitializeComponent();
            private void Input_Font_Button_Click(object sender, EventArgs e);
            private void InviteOthersButton_Click(object sender, EventArgs e);
            private void LoadFormSettings();
            private void MessageInputBox_TextChanged(object sender, EventArgs e);
            protected override void OnClosing(CancelEventArgs e);
            private static void OnSend(IAsyncResult ar);
            private void Opacity100MenuItem_Click(object sender, EventArgs e);
            private void Opacity25MenuItem_Click(object sender, EventArgs e);
            private void Opacity50MenuItem_Click(object sender, EventArgs e);
            private void Opacity75MenuItem_Click(object sender, EventArgs e);
            public void ProcessNewMessage(MessageInfo message);
            public void RefreshMembersListBox();
            public void RemoveMember(ClientInfo member);
            private void ResizeConversationDisplayBox();
            private void SaveFormSettings();
            private void SendButton_Click(object sender, EventArgs e);
            private void SendMultiple(string message);
            private void SendSingle(ClientInfo recip, string message);
            private void UpdateConversationDisplayBox(string talker, string message);
            private void UpdateConversationDisplayBoxRtf(string talker, string message);

            // Properties
            public Guid ConversationID { get; set; }
            public ArrayList Members { get; }
            public bool Multi { get; }
            public ClientInfo Target { get; }

            // Fields
            private Container components;
            private ExRichTextBox ConversationDisplayBox;
            private ContextMenu ConversationFormContextMenu;
            private Guid conversationID;
            private Color desiredColor;
            private Font desiredFont;
            private FontDialog fdlg;
            private bool hiddenControls;
            private IIMController iimc;
            private Button Input_Font_Button;
            private Button InviteOthersButton;
            private static readonly ILog log;
            private ArrayList members;
            private ListView membersListView;
            private MenuItem menuItem1;
            private MenuItem menuItem2;
            private MenuItem menuItem3;
            private ExRichTextBox MessageInputBox;
            private bool multi;
            private MenuItem Opacity100MenuItem;
            private MenuItem Opacity25MenuItem;
            private MenuItem Opacity50MenuItem;
            private MenuItem Opacity75MenuItem;
            private Label ParticipantsLabel;
            private Button SendButton;
            private StatusBar statusBar;
            private ClientInfo target;

            // Nested Types
            [StructLayout(LayoutKind.Sequential)]
            public struct FLASHINFO
            {
                  public int cbSize;
                  public IntPtr hwnd;
                  public int dwFlags;
                  public uint uCount;
                  public int dwTimeout;
            }
      }

      public class CSettings
      {
            // Methods
            static CSettings();
            public CSettings(bool AllUsers);
            private void AddRow(ref DataTable dt, string Key, object Value);
            private DataTable CreateDT(string Settings, string Key, string Value);
            public bool GetSetting(string AppTitle, string Settings, string Key, bool KeyValue);
            public double GetSetting(string AppTitle, string Settings, string Key, double KeyValue);
            public int GetSetting(string AppTitle, string Settings, string Key, int KeyValue);
            public string GetSetting(string AppTitle, string Settings, string Key, string KeyValue);
            private DataTable GetXml(string tablename);
            public void SaveSetting(string AppTitle, string Settings, string Key, bool Value);
            public void SaveSetting(string AppTitle, string Settings, string Key, double Value);
            public void SaveSetting(string AppTitle, string Settings, string Key, int Value);
            public void SaveSetting(string AppTitle, string Settings, string Key, string Value);
            private void SetupXMLFileName(string fn);

            // Properties
            public bool AllUsers { get; set; }
            public string AlternatePath { get; set; }

            // Fields
            private DataSet ds;
            private static readonly ILog log;
            private bool m_AllUsers;
            private string m_AlternatePath;
            private const string XML = ".xml";
            private string xmlFile;
      }

      public class Desktop : IDisposable, ICloneable
      {
            // Methods
            static Desktop();
            public Desktop();
            private Desktop(IntPtr desktop);
            private void CheckDisposed();
            public object Clone();
            public bool Close();
            [DllImport("user32.dll")]
            private static extern bool CloseDesktop(IntPtr hDesktop);
            public bool Create(string name);
            public static Desktop CreateDesktop(string name);
            [DllImport("user32.dll")]
            private static extern IntPtr CreateDesktop(string lpszDesktop, IntPtr lpszDevice, IntPtr pDevmode, int dwFlags, long dwDesiredAccess, IntPtr lpsa);
            public Process CreateProcess(string path);
            public static Process CreateProcess(string path, string desktop);
            [DllImport("kernel32.dll")]
            private static extern bool CreateProcess(string lpApplicationName, string lpCommandLine, IntPtr lpProcessAttributes, IntPtr lpThreadAttributes, bool bInheritHandles, int dwCreationFlags, IntPtr lpEnvironment, string lpCurrentDirectory, ref STARTUPINFO lpStartupInfo, ref PROCESS_INFORMATION lpProcessInformation);
            private static bool DesktopProc(string lpszDesktop, IntPtr lParam);
            private bool DesktopWindowsProc(IntPtr wndHandle, IntPtr lParam);
            public void Dispose();
            public virtual void Dispose(bool disposing);
            [DllImport("user32.dll")]
            private static extern bool EnumDesktops(IntPtr hwinsta, EnumDesktopProc lpEnumFunc, IntPtr lParam);
            [DllImport("user32.dll")]
            private static extern bool EnumDesktopWindows(IntPtr hDesktop, EnumDesktopWindowsProc lpfn, IntPtr lParam);
            public static bool Exists(string name);
            public static bool Exists(string name, bool caseInsensitive);
            protected override void Finalize();
            public static Desktop GetCurrent();
            public static string GetDesktopName(Desktop desktop);
            public static string GetDesktopName(IntPtr desktopHandle);
            public static string[] GetDesktops();
            public static Process[] GetInputProcesses();
            [DllImport("kernel32.dll")]
            private static extern int GetProcessId(IntPtr process);
            [DllImport("user32.dll")]
            private static extern IntPtr GetProcessWindowStation();
            [DllImport("user32.dll")]
            private static extern IntPtr GetThreadDesktop(int dwThreadId);
            [DllImport("kernel32.dll")]
            private static extern int GetThreadId(IntPtr thread);
            [DllImport("user32.dll")]
            private static extern bool GetUserObjectInformation(IntPtr hObj, int nIndex, IntPtr pvInfo, int nLength, ref int lpnLengthNeeded);
            public WindowCollection GetWindows();
            [DllImport("user32.dll")]
            private static extern int GetWindowText(IntPtr hWnd, IntPtr lpString, int nMaxCount);
            public bool Open(string name);
            public static Desktop OpenDefaultDesktop();
            public static Desktop OpenDesktop(string name);
            [DllImport("user32.dll")]
            private static extern IntPtr OpenDesktop(string lpszDesktop, int dwFlags, bool fInherit, long dwDesiredAccess);
            public bool OpenInput();
            public static Desktop OpenInputDesktop();
            [DllImport("user32.dll")]
            private static extern IntPtr OpenInputDesktop(int dwFlags, bool fInherit, long dwDesiredAccess);
            public void Prepare();
            public static bool SetCurrent(Desktop desktop);
            [DllImport("user32.dll")]
            private static extern bool SetThreadDesktop(IntPtr hDesktop);
            public bool Show();
            public static bool Show(string name);
            [DllImport("user32.dll")]
            private static extern bool SwitchDesktop(IntPtr hDesktop);
            public override string ToString();

            // Properties
            public IntPtr DesktopHandle { get; }
            public string DesktopName { get; }
            public bool IsOpen { get; }

            // Fields
            private const long AccessRights = 0x1ff;
            public static readonly Desktop Default;
            private const long DESKTOP_CREATEMENU = 4;
            private const long DESKTOP_CREATEWINDOW = 2;
            private const long DESKTOP_ENUMERATE = 0x40;
            private const long DESKTOP_HOOKCONTROL = 8;
            private const long DESKTOP_JOURNALPLAYBACK = 0x20;
            private const long DESKTOP_JOURNALRECORD = 0x10;
            private const long DESKTOP_READOBJECTS = 1;
            private const long DESKTOP_SWITCHDESKTOP = 0x100;
            private const long DESKTOP_WRITEOBJECTS = 0x80;
            public static readonly Desktop Input;
            private IntPtr m_desktop;
            private string m_desktopName;
            private bool m_disposed;
            private static StringCollection m_sc;
            private ArrayList m_windows;
            public const int MaxWindowNameLength = 100;
            private const int NORMAL_PRIORITY_CLASS = 0x20;
            private const int STARTF_USEPOSITION = 4;
            private const int STARTF_USESHOWWINDOW = 1;
            private const int STARTF_USESTDHANDLES = 0x100;
            private const short SW_HIDE = 0;
            private const short SW_NORMAL = 1;
            private const int UOI_NAME = 2;

            // Nested Types
            private delegate bool EnumDesktopProc(string lpszDesktop, IntPtr lParam);


            private delegate bool EnumDesktopWindowsProc(IntPtr desktopHandle, IntPtr lParam);


            [StructLayout(LayoutKind.Sequential)]
            private struct PROCESS_INFORMATION
            {
                  public IntPtr hProcess;
                  public IntPtr hThread;
                  public int dwProcessId;
                  public int dwThreadId;
            }

            [StructLayout(LayoutKind.Sequential)]
            private struct STARTUPINFO
            {
                  public int cb;
                  public string lpReserved;
                  public string lpDesktop;
                  public string lpTitle;
                  public int dwX;
                  public int dwY;
                  public int dwXSize;
                  public int dwYSize;
                  public int dwXCountChars;
                  public int dwYCountChars;
                  public int dwFillAttribute;
                  public int dwFlags;
                  public short wShowWindow;
                  public short cbReserved2;
                  public IntPtr lpReserved2;
                  public IntPtr hStdInput;
                  public IntPtr hStdOutput;
                  public IntPtr hStdError;
            }

            [StructLayout(LayoutKind.Sequential)]
            public struct Window
            {
                  private IntPtr m_handle;
                  private string m_text;
                  public IntPtr Handle { get; }
                  public string Text { get; }
                  public Window(IntPtr handle, string text);
            }

            public class WindowCollection : CollectionBase
            {
                  // Methods
                  public WindowCollection();
                  public void Add(Desktop.Window wnd);

                  // Properties
                  public Desktop.Window this[int index] { get; }
            }
      }

      public class Emoticon
      {
            // Methods
            public Emoticon(Image image, string str);

            // Properties
            public Image Image { get; }
            public string Str { get; }

            // Fields
            private Image image;
            private string str;
      }

      public class Event
      {
            // Methods
            public Event(EventType et);

            // Properties
            public object Payload { get; set; }
            public EventType Type { get; }

            // Fields
            private object payload;
            private EventType type;
      }

      public enum EventType
      {
            // Fields
            FileEvent = 1,
            MessageEvent = 0,
            PeerAddRequestEvent = 2,
            StatusChange = 3
      }

      public class ExRichTextBox : RichTextBox
      {
            // Methods
            static ExRichTextBox();
            public ExRichTextBox();
            public ExRichTextBox(RtfColor _textColor);
            public ExRichTextBox(RtfColor _textColor, RtfColor _highlightColor);
            public void AppendRtf(string _rtf);
            public void AppendTextAsRtf(string _text);
            public void AppendTextAsRtf(string _text, Font _font);
            public void AppendTextAsRtf(string _text, Font _font, RtfColor _textColor);
            public void AppendTextAsRtf(string _text, Font _font, RtfColor _textColor, RtfColor _backColor);
            [DllImport("gdiplus.dll")]
            private static extern uint GdipEmfToWmfBits(IntPtr _hEmf, uint _bufferSize, byte[] _buffer, int _mappingMode, EmfToWmfBitsFlags _flags);
            private string GetColorTable(RtfColor _textColor, RtfColor _backColor);
            private string GetDocumentArea(string _text, Font _font);
            private string GetFontTable(Font _font);
            private string GetImagePrefix(Image _image);
            private string GetRtfImage(Image _image);
            public void InsertImage(Image _image);
            public void InsertRtf(string _rtf);
            public void InsertTextAsRtf(string _text);
            public void InsertTextAsRtf(string _text, Font _font);
            public void InsertTextAsRtf(string _text, Font _font, RtfColor _textColor);
            public void InsertTextAsRtf(string _text, Font _font, RtfColor _textColor, RtfColor _backColor);
            private string RemoveBadChars(string _originalRtf);
            public void ScrollToEnd();

            // Properties
            public RtfColor HiglightColor { get; set; }
            public string Rtf { get; set; }
            public RtfColor TextColor { get; set; }

            // Fields
            private const string FF_UNKNOWN = "UNKNOWN";
            private RtfColor highlightColor;
            private const int HMM_PER_INCH = 2540;
            private static readonly ILog log;
            private const int MM_ANISOTROPIC = 8;
            private const int MM_HIENGLISH = 5;
            private const int MM_HIMETRIC = 3;
            private const int MM_ISOTROPIC = 7;
            private const int MM_LOENGLISH = 4;
            private const int MM_LOMETRIC = 2;
            private const int MM_TEXT = 1;
            private const int MM_TWIPS = 6;
            private const string RTF_DOCUMENT_POST = @"\cf0\fs17}";
            private const string RTF_DOCUMENT_PRE = @"\viewkind4\uc1\pard\cf1\f0\fs20";
            private const string RTF_HEADER = @"{\rtf1\ansi\ansicpg1252\deff0\deflang1033";
            private string RTF_IMAGE_POST;
            private HybridDictionary rtfColor;
            private HybridDictionary rtfFontFamily;
            private RtfColor textColor;
            private const int TWIPS_PER_INCH = 1440;
            private float xDpi;
            private float yDpi;

            // Nested Types
            private enum EmfToWmfBitsFlags
            {
                  // Fields
                  EmfToWmfBitsFlagsDefault = 0,
                  EmfToWmfBitsFlagsEmbedEmf = 1,
                  EmfToWmfBitsFlagsIncludePlaceable = 2,
                  EmfToWmfBitsFlagsNoXORClip = 4
            }

            [StructLayout(LayoutKind.Sequential, Size=1)]
            private struct RtfColorDef
            {
                  public const string Black = @"\red0\green0\blue0";
                  public const string Maroon = @"\red128\green0\blue0";
                  public const string Green = @"\red0\green128\blue0";
                  public const string Olive = @"\red128\green128\blue0";
                  public const string Navy = @"\red0\green0\blue128";
                  public const string Purple = @"\red128\green0\blue128";
                  public const string Teal = @"\red0\green128\blue128";
                  public const string Gray = @"\red128\green128\blue128";
                  public const string Silver = @"\red192\green192\blue192";
                  public const string Red = @"\red255\green0\blue0";
                  public const string Lime = @"\red0\green255\blue0";
                  public const string Yellow = @"\red255\green255\blue0";
                  public const string Blue = @"\red0\green0\blue255";
                  public const string Fuchsia = @"\red255\green0\blue255";
                  public const string Aqua = @"\red0\green255\blue255";
                  public const string White = @"\red255\green255\blue255";
            }

            [StructLayout(LayoutKind.Sequential, Size=1)]
            private struct RtfFontFamilyDef
            {
                  public const string Unknown = @"\fnil";
                  public const string Roman = @"\froman";
                  public const string Swiss = @"\fswiss";
                  public const string Modern = @"\fmodern";
                  public const string Script = @"\fscript";
                  public const string Decor = @"\fdecor";
                  public const string Technical = @"\ftech";
                  public const string BiDirect = @"\fbidi";
            }
      }

      public class FileNegotiation
      {
            // Methods
            public FileNegotiation();

            // Properties
            public bool Accepted { get; set; }
            public string file { get; set; }

            // Fields
            private bool accepted;
            private string m_file;
      }

      internal class FocusHelper
      {
            // Methods
            static FocusHelper();
            public FocusHelper();
            public static bool HasFocus(Control control);

            // Fields
            private static readonly ILog log;
      }

      public class IIMController
      {
            // Methods
            static IIMController();
            public IIMController();
            public void addConversation(ConversationForm convo);
            public static string AskForIPAddress(IPHostEntry iphostentry);
            public void BroadcastStatusUpdate(UpdateType type, string data);
            private void DetermineGraphicCapabilities();
            public void DiscoverPeers();
            public bool LoadConfig();
            private void LoadEmoticons();
            public void LoadFriends();
            private void LoadIcons();
            public void Ping();
            public void Ping(string ip);
            public void ProcessNewMessages(object sender, Event e);
            public void ProcessPingRequest(object sender, Event e);
            public void RemoveConversation(ConversationForm convo);
            public void SaveConfig();
            public void SaveFriends();
            public void ShutdownListeners();

            // Properties
            public bool AdvancedFlashing { get; }
            public ClientDiscoveryAnswerListenServer Cdals { get; }
            public ArrayList Conversations { get; }
            public ClientStatusUpdateBroadcastListenServer Csuls { get; }
            public Emoticon[] Emoticons { get; }
            public ArrayList FriendsList { get; }
            public ImageList Icons { get; }
            public ArrayList KnownContacts { get; }
            public ClientInfo Me { get; }
            public string NewMessageArrivalSound { get; set; }
            public bool OpacityEnabled { get; set; }
            public bool SafeMode { get; set; }

            // Fields
            private bool advancedFlashing;
            private ClientDiscoveryAnswerListenServer cdals;
            private ClientDiscoveryListenServer cdls;
            private ArrayList conversations;
            private ClientStatusUpdateBroadcastListenServer csuls;
            private Emoticon[] emoticons;
            private ArrayList friendsList;
            private ImageList icons;
            private ArrayList knownContacts;
            private static readonly ILog log;
            private ClientInfo me;
            private MessageListenServer mls;
            private string newMessageArrivalSound;
            private bool opacityEnabled;
            private bool safeMode;
      }

      public class IIMDock : Form
      {
            // Methods
            static IIMDock();
            public IIMDock();
            private void AlwaysOnTop_MenuItem_Click(object sender, EventArgs e);
            private void BroadcastStatusUpdateReceived(object sender, Event e);
            private void ChangeUserName();
            protected override void Dispose(bool disposing);
            private void Exit_MenuItem_Click(object sender, EventArgs e);
            private void FadeIn();
            private void FadeOut();
            private void FindPeers();
            private void FriendsList_DoubleClick(object sender, EventArgs e);
            private void FriendsList_SelectedIndexChanged(object sender, EventArgs e);
            private void Hide_MenuItem_Click(object sender, EventArgs e);
            public void HideApp();
            private void IIMDockToolBar_ButtonClick(object sender, ToolBarButtonClickEventArgs e);
            private void IIMIcon_DoubleClick(object sender, EventArgs e);
            private void InitializeComponent();
            protected bool IsMouseInside();
            private void LoadFormSettings();
            [STAThread]
            private static void Main(string[] args);
            protected override void OnClosing(CancelEventArgs e);
            protected void OnMouseEnter(object sender, EventArgs ea);
            protected void OnMouseLeave(object sender, EventArgs ea);
            protected void OnMouseTimer(object sender, ElapsedEventArgs eea);
            protected void OnRefreshTimer(object sender, ElapsedEventArgs eea);
            protected void OnUserStatusTimer(object sender, ElapsedEventArgs eea);
            private void Opacity100MenuItem_Click(object sender, EventArgs e);
            private void Opacity25MenuItem_Click(object sender, EventArgs e);
            private void Opacity50MenuItem_Click(object sender, EventArgs e);
            private void Opacity75MenuItem_Click(object sender, EventArgs e);
            private void OpenConversationForm();
            public void PositionWindow();
            public void RefreshFriendsListBox();
            private void SaveFormSettings();
            private void SetGUICapabilties();
            private void Show_MenuItem_Click(object sender, EventArgs e);
            public void ShowApp();
            private void ShutDown();
            private void SizeWatcher(object sender, EventArgs e);
            private void Startup();
            private void Status_Away_MenuItem_Click(object sender, EventArgs e);
            private void Status_Busy_MenuItem_Click(object sender, EventArgs e);
            private void Status_Offline_MenuItem_Click(object sender, EventArgs e);
            private void Status_Online_MenuItem_Click(object sender, EventArgs e);
            protected override void WndProc(ref Message m);

            // Fields
            private MenuItem AlwaysOnTop_MenuItem;
            private ToolBarButton ChangeSettingsToolbarButton;
            private ToolBarButton CloseApplicationToolbarButton;
            private IContainer components;
            private ToolTip ContactToolTip;
            private int desiredHeight;
            private int desiredLeft;
            private double desiredOpacity;
            private int desiredTop;
            private int desiredWidth;
            private ToolBarButton EditFriendsListToolbarButton;
            private MenuItem Exit_MenuItem;
            private int fadeOutDelayCounter;
            private ArrayList friends;
            private ListView FriendsList;
            private MenuItem Hide_MenuItem;
            private IIMController iimc;
            private ContextMenu IIMDockContextMenu;
            private ToolBar IIMDockToolBar;
            private NotifyIcon IIMIcon;
            private ContextMenu IIMIconContextMenu;
            private Label label1;
            private static readonly ILog log;
            private ImageList menuImageList;
            private MenuItem menuItem1;
            private MenuItem menuItem2;
            private MenuItem menuItem7;
            private int mouseEnterCount;
            private Timer mouseTimer;
            private MenuItem Opacity100MenuItem;
            private MenuItem Opacity25MenuItem;
            private MenuItem Opacity50MenuItem;
            private MenuItem Opacity75MenuItem;
            private ToolBarButton PeerSearchToolbarButton;
            private Timer refreshTimer;
            private ToolBarButton RequestStatusUpdateToolbarButton;
            private ToolBarButton SendMessageToolbarButton;
            private ToolBarButton SeperatorToolbarButton;
            private bool sessionEnding;
            private MenuItem Show_MenuItem;
            private MenuItem Status_Away_MenuItem;
            private MenuItem Status_Busy_MenuItem;
            private MenuItem Status_Offline_MenuItem;
            private MenuItem Status_Online_MenuItem;
            private Timer userStatusTimer;
      }

      public class InviteOthersForm : Form
      {
            // Methods
            static InviteOthersForm();
            public InviteOthersForm(IIMController iimc, ClientInfo target, ArrayList members);
            private void ClearSelectionButton_Click(object sender, EventArgs e);
            protected override void Dispose(bool disposing);
            private void FormCancelButton_Click(object sender, EventArgs e);
            private void InitializeComponent();
            private void OKButton_Click(object sender, EventArgs e);
            public void RefreshFriendsListBox();
            private void SelectAllButton_Click(object sender, EventArgs e);

            // Fields
            private Button ClearSelectionButton;
            private Container components;
            private Button FormCancelButton;
            private ListView friendsListView;
            private IIMController iimc;
            private static readonly ILog log;
            private ArrayList members;
            private Button OKButton;
            private Button SelectAllButton;
            private ClientInfo target;
      }

      public class IPQueryForm : Form
      {
            // Methods
            static IPQueryForm();
            public IPQueryForm(int numControls, ArrayList lables, ArrayList radioButtons);
            private void button1_Click(object sender, EventArgs e);
            protected override void Dispose(bool disposing);
            private void InitializeComponent();

            // Fields
            private Button button1;
            private Container components;
            private Label label1;
            private static readonly ILog log;
            private PictureBox pictureBox1;
            public ArrayList radioButtons;
      }

      public abstract class ListenServer
      {
            // Methods
            static ListenServer();
            public ListenServer();

            // Properties
            public bool Stop { set; }

            // Fields
            public const int CDALSPORT = 0x2711;
            public const int CDLSPORT = 10000;
            public const int CSUBLSPORT = 0x2716;
            public const int FTLSPORT = 0x2713;
            protected static readonly ILog log;
            public const int MLSPORT = 0x2712;
            public const int MPBLSPORT = 0x2715;
            public const int MPLSPORT = 0x2714;
            protected Thread serverThread;
            protected bool stop;

            // Nested Types
            public delegate void NewArrival(object sender, Event e);

      }

      public enum Mask
      {
            // Fields
            DateOnly = 1,
            Decimal = 5,
            Digit = 6,
            IpAddress = 3,
            None = 0,
            PhoneWithArea = 2,
            SSN = 4
      }

      [ToolboxBitmap(typeof(MaskedTextBox), "app.bmp")]
      public class MaskedTextBox : TextBox
      {
            // Methods
            public MaskedTextBox();
            private bool CheckDayOfMonth(int mon, int day);
            protected override void Dispose(bool disposing);
            private void InitializeComponent();
            private void MaskDate(KeyPressEventArgs e);
            private void MaskDecimal(KeyPressEventArgs e);
            private void MaskDigit(KeyPressEventArgs e);
            private void MaskIpAddr(KeyPressEventArgs e);
            private void MaskPhoneSSN(KeyPressEventArgs e, int pos, int pos2);
            private void OnKeyPress(object sender, KeyPressEventArgs e);
            private void OnLeave(object sender, EventArgs e);
            private bool ReplaceSelectionOrInsert(KeyPressEventArgs e, int len);

            // Properties
            public Mask Masked { get; set; }

            // Fields
            private Container components;
            private int CountDot;
            private int DelimitNumber;
            private int digitPos;
            private ErrorProvider errorProvider1;
            private Mask m_mask;
      }

      public class MemoryManagement
      {
            // Methods
            static MemoryManagement();
            public MemoryManagement();
            public static void FlushMemory();
            [DllImport("kernel32.dll", CharSet=CharSet.Ansi, SetLastError=true, ExactSpelling=true)]
            private static extern int SetProcessWorkingSetSize(IntPtr process, int minimumWorkingSetSize, int maximumWorkingSetSize);

            // Fields
            private static readonly ILog log;
      }

      [Serializable]
      public class MessageInfo
      {
            // Methods
            public MessageInfo();
            public MessageInfo(string message, ClientInfo target, ClientInfo source, Guid conversationIdentifier, bool multi, MessageType type);
            public MessageInfo(string message, ArrayList members, ClientInfo source, Guid conversationIdentifier, bool multi, MessageType type);

            // Properties
            public Guid ConversationID { get; set; }
            public ArrayList Members { get; set; }
            public string MessageBody { get; set; }
            public bool Multi { get; set; }
            public ClientInfo SenderInfo { get; set; }
            public ClientInfo TargetInfo { get; set; }
            public MessageType Type { get; }

            // Fields
            private Guid conversationID;
            private ArrayList members;
            private string messageBody;
            private bool multi;
            private ClientInfo senderInfo;
            private ClientInfo targetInfo;
            private MessageType type;
      }

      public class MessageListenServer : ListenServer
      {
            // Events
            public event ListenServer.NewArrival OnNewArrival;

            // Methods
            public MessageListenServer();
            private void OnReceive(IAsyncResult ar);
            private void Start();
            public void StopServer();

            // Properties
            public Socket Server { get; }

            // Fields
            private ListenServer.NewArrival OnNewArrival;
            private Socket server;
      }

      public enum MessageType
      {
            // Fields
            Message = 0,
            RemovalNotice = 1
      }

      public class MiscPackageListenServer : ListenServer
      {
            // Methods
            public MiscPackageListenServer();
            private void OnReceive(IAsyncResult ar);
            private void Start();

            // Nested Types
            public delegate void ContactStatusChange(object sender, Event e);

      }

      public class OptionsForm : Form
      {
            // Methods
            static OptionsForm();
            public OptionsForm(IIMController iimc);
            private void CancelButton_Click(object sender, EventArgs e);
            protected override void Dispose(bool disposing);
            private void FillFields();
            private void graphicsPictureBox_Click(object sender, EventArgs e);
            private void InitializeComponent();
            private void NewMessageBrowseButton_Click(object sender, EventArgs e);
            private void SaveButton_Click(object sender, EventArgs e);
            private void testSoundbutton_Click(object sender, EventArgs e);

            // Fields
            private Button AddIPAddressButton;
            private Container components;
            private TextBox ComputerNameBox;
            private PictureBox graphicsPictureBox;
            private GroupBox groupBox1;
            private GroupBox groupBox2;
            private GroupBox groupBox3;
            private GroupBox groupBox4;
            private IIMController iimc;
            private TextBox IPAddressBox;
            private Label IPAddressLabel;
            private MaskedTextBox IPAddressToAddBox;
            private ListBox IPListBox;
            private Label label1;
            private Label label2;
            private Label label3;
            private Label label4;
            private Label label5;
            private Label label6;
            private static readonly ILog log;
            private Button MyCancelButton;
            private Button NewMessageBrowseButton;
            private TextBox NewMessageSoundBox;
            private OpenFileDialog openFileDialog;
            private PictureBox pictureBox1;
            private Button RemoveIPAddressButton;
            private CheckBox safeModeCheckBox;
            private Button SaveButton;
            private TextBox ScreenNameBox;
            private Button testSoundbutton;
            private TextBox UserNameBox;
      }

      public enum PackageType
      {
            // Fields
            FileSendOffer = 1,
            Ping = 2,
            StatusUpdate = 0,
            WhiteBoardSessionAccept = 9,
            WhiteBoardSessionInit = 8
      }

      public class PasswordForm : Form
      {
            // Methods
            static PasswordForm();
            public PasswordForm(string[] strings, bool[] valid);
            private void button2_Click(object sender, EventArgs e);
            protected override void Dispose(bool disposing);
            private void InitializeComponent();
            private void OKButton_Click(object sender, EventArgs e);

            // Fields
            private Button CancelButt;
            private Container components;
            private Label label1;
            private Label label2;
            private static readonly ILog log;
            private Button OKButton;
            private TextBox passwordBox;
            private TextBox PasswordHashBox;
            private string[] passwords;
            private bool[] valid;
      }

      public enum RtfColor
      {
            // Fields
            Aqua = 14,
            Black = 0,
            Blue = 12,
            Fuchsia = 13,
            Gray = 7,
            Green = 2,
            Lime = 10,
            Maroon = 1,
            Navy = 4,
            Olive = 3,
            Purple = 5,
            Red = 9,
            Silver = 8,
            Teal = 6,
            White = 15,
            Yellow = 11
      }

      public class SoundPlayer
      {
            // Methods
            public SoundPlayer();
            public static void Play(string filename);
            [DllImport("Winmm.dll")]
            private static extern bool PlaySound(string Sound, int hMod, uint dwFlags);
      }

      public enum StatusLevel
      {
            // Fields
            Away = 2,
            Busy = 3,
            Offline = 1,
            Online = 0
      }

      public class SystemParameterInfoWrapper
      {
            // Methods
            static SystemParameterInfoWrapper();
            public SystemParameterInfoWrapper();
            public static bool IsScreenSaverRunning();
            [DllImport("user32.dll", CharSet=CharSet.Auto)]
            public static extern int SystemParametersInfo(int uAction, int uParam, ref int lpvParam, int fuWinIni);

            // Fields
            private static readonly ILog log;
            public static int SPI_GETSCREENSAVERRUNNING;
      }

      public class TcpPacketizer
      {
            // Methods
            static TcpPacketizer();
            public TcpPacketizer(Socket socket);
            public IAsyncResult BeginReceive(AsyncCallback callback, object state);
            public IAsyncResult BeginSend(byte[] buffer, AsyncCallback callback, object state);
            public byte[] EndReceive(IAsyncResult ar);
            public void EndSend(IAsyncResult ar);
            private void OnReceiveLength(IAsyncResult ar);
            private void OnReceiveMessage(IAsyncResult ar);
            public void Send(byte[] Buffer);

            // Properties
            public Socket Socket { get; set; }

            // Fields
            private static readonly ILog log;
            private InternalAsyncResult m_AsyncResult;
            private Exception m_Exception;
            private byte[] m_LengthBuffer;
            private byte[] m_MessageBuffer;
            private int m_Offset;
            private Socket m_Socket;

            // Nested Types
            internal class InternalAsyncResult : IAsyncResult
            {
                  // Methods
                  internal InternalAsyncResult(AsyncCallback cb, object state);

                  // Properties
                  public object AsyncState { get; }
                  public WaitHandle AsyncWaitHandle { get; }
                  internal AsyncCallback Callback { get; }
                  public bool CompletedSynchronously { get; }
                  public bool IsCompleted { get; }

                  // Fields
                  private AsyncCallback m_Callback;
                  private bool m_Completed;
                  private object m_State;
            }

            public delegate void SendDelegate(byte[] buffer);

      }

      public enum UpdateType
      {
            // Fields
            Away = 2,
            Busy = 3,
            Offline = 1,
            Online = 0,
            ScreenName = 4
      }

      public class UserConfigForm : Form
      {
            // Methods
            static UserConfigForm();
            public UserConfigForm(IIMController iimc);
            protected override void Dispose(bool disposing);
            private void FillFields();
            private void InitializeComponent();
            private void OKButton_Click(object sender, EventArgs e);
            protected override void OnClosing(CancelEventArgs e);

            // Fields
            private Container components;
            private TextBox ComputerNameBox;
            private IIMController iimc;
            private TextBox IPAddressBox;
            private Label IPAddressLabel;
            private Label label1;
            private Label label2;
            private Label label3;
            private Label label4;
            private static readonly ILog log;
            private Button OKButton;
            private TextBox PasswordBox;
            private TextBox ScreenNameBox;
            private ClientInfo userInfo;
            private TextBox UserNameBox;
      }
}

Home | Members | Archive | Discussions | Screen Shots | Code Outline | C# Recipes | Contact Information

 Copyright 2004 The Tiny Custom Software Company.
For problems or questions regarding this Web site contact Project Admin Email.
Last updated: 01/02/05.

Free Site Counters