本文整理汇总了C#中RibbonControlEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# RibbonControlEventArgs类的具体用法?C# RibbonControlEventArgs怎么用?C# RibbonControlEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RibbonControlEventArgs类属于命名空间,在下文中一共展示了RibbonControlEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: button1_Click
private void button1_Click(object sender, RibbonControlEventArgs e)
{
Outlook.Application application = new Outlook.Application();
Outlook.NameSpace ns = application.GetNamespace("MAPI");
try
{
//get selected mail item
Object selectedObject = application.ActiveExplorer().Selection[1];
Outlook.MailItem selectedMail = (Outlook.MailItem)selectedObject;
//create message
Outlook.MailItem newMail = application.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
newMail.Recipients.Add(ReadFile());
newMail.Subject = "SPAM";
newMail.Attachments.Add(selectedMail, Microsoft.Office.Interop.Outlook.OlAttachmentType.olEmbeddeditem);
newMail.Send();
selectedMail.Delete();
System.Windows.Forms.MessageBox.Show("Spam notification has been sent.");
}
catch
{
System.Windows.Forms.MessageBox.Show("You must select a message to report.");
}
}
示例2: btFuncMeta_Click
private void btFuncMeta_Click(object sender, RibbonControlEventArgs e)
{
// SAPINTGUI.FormFunctionMetaEx formFunctionMetaEx = new SAPINTGUI.FormFunctionMetaEx();
// formFunctionMetaEx.Show();
FormFunctionMeta formFunctionMeta = new FormFunctionMeta();
formFunctionMeta.Show();
}
示例3: branchComboBox_TextChanged
private void branchComboBox_TextChanged(object sender, RibbonControlEventArgs e)
{
btnExport_Refresh();
btnExportMonsterTable_Refresh();
btnExportMetaTable_Refresh();
branch = branchComboBox.Text;
}
示例4: ConvertLatLon_button_Click
private void ConvertLatLon_button_Click(object sender, RibbonControlEventArgs e)
{
DecimalDegrees decimalDegrees;
DegreesDecimalMinutes degreesDecimalMinutes;
DegreesMinutesSeconds degreesMinutesSeconds;
try
{
switch (this.LatLonFromat_dropDown.SelectedItem.Label)
{
case "Decimal Degrees":
decimalDegrees = new DecimalDegrees(this.Longitude_editBox.Text, this.Latitude_editBox.Text);
this.MGRS_editBox.Text = decimalDegrees.ToMilitaryGridReferenceSystem().Grid;
break;
case "Degrees Decimal Minutes":
degreesDecimalMinutes = new DegreesDecimalMinutes(this.Longitude_editBox.Text, this.Latitude_editBox.Text);
this.MGRS_editBox.Text = degreesDecimalMinutes.ToMilitaryGridReferenceSystem().Grid;
break;
case "Degrees Minutes Seconds":
degreesMinutesSeconds = new DegreesMinutesSeconds(this.Longitude_editBox.Text, this.Latitude_editBox.Text);
this.MGRS_editBox.Text = degreesMinutesSeconds.ToMilitaryGridReferenceSystem().Grid;
break;
}
}
catch
{
MessageBox.Show("Invalid " + this.LatLonFromat_dropDown.SelectedItem.Label + " input.");
}
}
示例5: RefreshButton_Click
private void RefreshButton_Click(object sender, RibbonControlEventArgs e)
{
if (ViewModel.IsConnected)
{
ViewModel.RefreshFeeds.Execute(null);
}
}
示例6: btnReportCustom_Click
private void btnReportCustom_Click(object sender, RibbonControlEventArgs e)
{
if (this.ddlReportTo.SelectedItem != null)
{
Reporting.SendReports(this.ddlReportTo.SelectedItem.Tag.ToString());
}
}
示例7: editPoll_Click
private void editPoll_Click(object sender, RibbonControlEventArgs e)
{
// Get the current slide
PowerPoint.Slide sld = Globals.ThisAddIn.Application.ActiveWindow.View.Slide;
// Get access to the xml for that slide
CustomXMLPart xml = sld.CustomerData._Index(1);
string question = xml.SelectSingleNode("/CP3Poll/PollQuestion").Text;
string type = xml.SelectSingleNode("/CP3Poll/PollType").Text;
string correctAnswer = xml.SelectSingleNode("/CP3Poll/PollCorrectAnswer").Text;
// Ensure we got valid results
if (question != null && type != null && correctAnswer != null)
{
// If this is a multiple choice question
// TODO: Change this question type thing to an enum
if (type.ToLower().Contains("multiple choice"))
{
string[] answers = new string[5];
// Iterate through each possible correctAnswer
for (int i = 1; i <= 5; ++i)
{
// Add the correctAnswer to the array
answers[i-1] = xml.SelectSingleNode("/CP3Poll/PollAnswers/Answer" + i).Text;
}
Form1 editPoll = new Form1(question, correctAnswer, answers);
editPoll.Show();
}
else
{ // True / false
Form1 editPoll = new Form1(question, correctAnswer);
editPoll.Show();
}
}
}
示例8: Configure_Click
private void Configure_Click(object sender, RibbonControlEventArgs e)
{
ThisAddIn addIn = Globals.ThisAddIn;
NamedRangeProvider nrp = addIn.NamedRangeProvider;
nrp.Clear();
var d = new ProjectConfigurationDialogue(addIn, nrp);
if (m_bounds.HasValue) {
d.Bounds = m_bounds.Value;
d.StartPosition = FormStartPosition.Manual;
}
d.Mode = addIn.Mode;
ProjectInvocationRule[] rules = addIn.Rules;
d.SetRules(rules);
var result = d.ShowDialog();
if (result == DialogResult.OK) {
addIn.Mode = d.Mode;
addIn.Rules = rules = d.GetRules();
addIn.WriteRules();
}
else {
/* It is possible that something has been changed in Excel - a range name, for example -
* and this has had an effect on the validity of a project invocation rule. Even if the
* user cancels the dialogue, we should take this opportunity to ensure that the Run
* button's enabled state is set correctly.
* */
foreach (ProjectInvocationRule rule in rules) {
rule.UpdateValidity();
}
addIn.UpdateExecutionState();
}
m_bounds = d.Bounds;
}
示例9: buttonLaunch_Click
private void buttonLaunch_Click(object sender, RibbonControlEventArgs e)
{
//Reading the data.
var rangePossibleValues = ((Excel.Range)Globals.ThisAddIn.Application.get_Range(this.editBoxPossibleValues.Text));
var rangeRulesMatrix = ((Excel.Range)Globals.ThisAddIn.Application.get_Range(this.editBoxRulesMatrix.Text));
var listPossibleValues = convertRangeToStringArrays(rangePossibleValues, true);
var listRulesMatrix = convertRangeToStringArrays(rangeRulesMatrix, false);
//Generating the solution.
try
{
var model = new SmartPermutations(listPossibleValues, listRulesMatrix);
string[,] permutationMatrix = model.ComputePermutationMatrix();
//Copying the data to a new sheet.
Excel.Worksheet newWorksheet;
newWorksheet = (Excel.Worksheet)Globals.ThisAddIn.Application.ActiveWorkbook.Worksheets.Add();
var startCell = (Excel.Range)newWorksheet.Cells[1, 1];
var endCell = (Excel.Range)newWorksheet.Cells[permutationMatrix.GetLength(0), permutationMatrix.GetLength(1)];
var writeRange = newWorksheet.Range[startCell, endCell];
writeRange.Value2 = permutationMatrix;
}
catch (ExceptionInvalidData ex)
{
MessageBox.Show(ex.Message);
}
}
示例10: btnHelp_Click
public static void btnHelp_Click(object sender, RibbonControlEventArgs e)
{
string baseurl = string.Empty;
baseurl = System.Configuration.ConfigurationManager.AppSettings["helpurl"];
var module = ((RibbonButton)sender).Tag as AddinModule;
System.Diagnostics.Process.Start(baseurl + module.HelpHref);
}
示例11: buttonGenerateData_Click
private void buttonGenerateData_Click(object sender, RibbonControlEventArgs e)
{
using (DataSchemaForm form = new DataSchemaForm())
{
form.ShowDialog();
}
}
示例12: button1_Click
private void button1_Click(object sender, RibbonControlEventArgs e)
{
if (settingsWindow.ShowDialog() == DialogResult.OK)
{
foreach (Workbook wb in Globals.ThisAddIn.Application.Workbooks)
{
if (IsWorkbookInBasePath(wb))
{
var cfg = new ConfigManager(wb);
dic_wb_cm.Add(wb, cfg);
if (wb == Globals.ThisAddIn.Application.ActiveWorkbook)
cfg.ShowUIPane(true);
}
else
{
ConfigManager cfg = null;
if (dic_wb_cm.TryGetValue(wb, out cfg))
{
cfg.Dispose();
dic_wb_cm.Remove(wb);
}
}
}
foreach (var cfg in dic_wb_cm.Values.ToArray())
{
if (!IsWorkbookInBasePath(cfg.Wb))
{
cfg.Dispose();
dic_wb_cm.Remove(cfg.Wb);
}
}
}
}
示例13: ImportIcsData_Click
private async void ImportIcsData_Click (object sender, RibbonControlEventArgs e)
{
try
{
EnsureSynchronizationContext ();
var dataInputWindow = CreateWindowWithTextBox();
dataInputWindow.Item1.ShowDialog();
var entitySynchronizationLogger = new EntitySynchronizationLogger ();
await OutlookTestContext.EventRepository.Create (
async appointmentWrapper => await OutlookTestContext.EntityMapper.Map2To1 (
OutlookTestContext.DeserializeICalendar (dataInputWindow.Item2.Text),
appointmentWrapper,
entitySynchronizationLogger),
NullEventSynchronizationContext.Instance);
var reportWindow = CreateWindowWithTextBox();
reportWindow.Item2.Text = "SynchronizationReport:\r\n" + Serializer<EntitySynchronizationReport>.Serialize (entitySynchronizationLogger.GetReport());
reportWindow.Item1.ShowDialog();
}
catch (Exception x)
{
ExceptionHandler.Instance.DisplayException (x, s_logger);
}
}
示例14: button1_Click
//Botton "Export Data"
private void button1_Click(object sender, RibbonControlEventArgs e)
{
try
{
int START_ROW = 9;
int START_COL = 3;
Excel.Worksheet active_worksheet = Globals.ThisAddIn.Application.ActiveSheet;
//Acquire Target Data and Export
Target TargetData = new Target();
TargetData.GetData(active_worksheet);
TargetData.ExportData();
//Acquire Comparable Data and Export
for (int col_index = START_COL; active_worksheet.Cells[START_ROW, col_index].Value != null ; col_index ++)
{
Comparable comparable_data = new Comparable();
comparable_data.GetData(active_worksheet, START_ROW, col_index);
comparable_data.ExportData();
}
MessageBox.Show("Successfully export data.");
}
catch (Exception exception)
{
Debug.WriteLine(exception.ToString());
}
}
示例15: selectButton_Click
private void selectButton_Click(object sender, RibbonControlEventArgs e)
{
Object val = Globals.Program.currUserKey.GetValue("Folder", "");
if (val != null && val.GetType() == this.openFile.Filter.GetType())
select.setSelectedFolder(val.ToString());
select.ShowDialog();
}