예제 #1
0
 public void Create()
 {
     // Populate the form with that data
     MessageToTextBox.Text      = mMessage.GetTo();
     MessageCcTextBox.Text      = mMessage.GetCC();
     MessageSubjectTextBox.Text = mMessage.GetSubject();
     MessageRichTextBox.Text    = mMessage.GetMessage();
 }
예제 #2
0
        public void RefreshBox(MOG_Filename add, MOG_Filename del, MOG_Command command)
        {
            Color    textColorAdd   = Color.Black;
            Color    textColorDel   = Color.Black;
            ListView currentViewAdd = mParent.IsolateListView(add.GetBoxName(), add.GetType(), add.GetUserName(), ref textColorAdd);
            ListView currentViewDel = mParent.IsolateListView(del.GetBoxName(), del.GetType(), del.GetUserName(), ref textColorDel);

            if (currentViewAdd == currentViewDel)
            {
                // Check to see if this item already exists?
                int index = ListViewItemMessagesFindItem(add.GetFullFilename(), currentViewAdd);
                if (index != -1)
                {
                    currentViewAdd.Items[index].SubItems[(int)guiAssetManager.MessageBoxColumns.STATUS].Text   = command.GetDescription();
                    currentViewAdd.Items[index].SubItems[(int)guiAssetManager.MessageBoxColumns.BOX].Text      = add.GetBoxName();
                    currentViewAdd.Items[index].SubItems[(int)guiAssetManager.MessageBoxColumns.FULLNAME].Text = add.GetFullFilename();
                    currentViewAdd.Items[index].ForeColor = textColorAdd;
                    for (int x = 0; x < currentViewAdd.Items[index].SubItems.Count; x++)
                    {
                        currentViewAdd.Items[index].SubItems[x].ForeColor = textColorAdd;
                    }
                }
            }
            else
            {
                if (currentViewDel != null)
                {
                    int index = ListViewItemMessagesFindItem(del.GetFullFilename(), currentViewDel);
                    if (index != -1)
                    {
                        currentViewDel.Items[index].Remove();
                    }
                }

                if (currentViewAdd != null)
                {
                    // Check to see if this item already exists?
                    int index = ListViewItemMessagesFindItem(add.GetFullFilename(), currentViewAdd);
                    if (index != -1)
                    {
                        currentViewAdd.Items[index].SubItems[(int)guiAssetManager.MessageBoxColumns.STATUS].Text   = command.GetDescription();
                        currentViewAdd.Items[index].SubItems[(int)guiAssetManager.MessageBoxColumns.FULLNAME].Text = add.GetFullFilename();
                        currentViewAdd.Items[index].ForeColor = textColorAdd;
                        for (int x = 0; x < currentViewAdd.Items[index].SubItems.Count; x++)
                        {
                            currentViewAdd.Items[index].SubItems[x].ForeColor = textColorAdd;
                        }
                    }
                    else
                    {
                        MOG_ControllerMessage assetController = new MOG_ControllerMessage(mParent.mMog);
                        if (!assetController.Open(add.GetFullFilename()))
                        {
                            return;
                        }

                        // Create the newly added node
                        ListViewItem item = mParent.CreateListViewNode(assetController.GetSubject(),
                                                                       assetController.GetFrom(),
                                                                       assetController.GetFileInfo().LastWriteTime.ToString(),
                                                                       assetController.GetTo(),
                                                                       assetController.GetStatus(),
                                                                       "",
                                                                       assetController.GetAssetFilename().GetFullFilename(),
                                                                       assetController.GetAssetFilename().GetBoxName(),
                                                                       Color.Black);

                        currentViewAdd.Items.Add(item);

                        assetController.Close();
                    }
                }
            }

            // Update the Tab
            RefreshTab(command);
        }