本文整理汇总了C#中Store.GetService方法的典型用法代码示例。如果您正苦于以下问题:C# Store.GetService方法的具体用法?C# Store.GetService怎么用?C# Store.GetService使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Store
的用法示例。
在下文中一共展示了Store.GetService方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetOptions
public static ActiveWriterOptions GetOptions(Store store)
{
try
{
IDialogPageProvider package = store.GetService(typeof(Microsoft.VisualStudio.Shell.Package)) as IDialogPageProvider;
return package.GetDialogPage<ActiveWriterOptions>() as ActiveWriterOptions;
}
catch
{
return new ActiveWriterOptions();
}
}
示例2: GetDTE
public static DTE GetDTE(Store store)
{
return store.GetService(typeof (_DTE)) as DTE;
}
示例3: BuildProcessFileVisioToSubProcess
//.........这里部分代码省略.........
// Activity target = modelElementActivityList.FirstOrDefault(p => p.VisioId == shapeTarget.VisioId);
// #region Source Activity's Parent Task equal to Target Activity's Parent Task
// using (Transaction trans = source.Store.TransactionManager.BeginTransaction("update Flow Minimal"))
// {
// CreateNewFlow(source, target, connector.Outcome, connector.StoryLine, connector.VisioId, DetermineFlowType(connector.FlowType));
// trans.Commit();
// }
// #endregion
// }
// #endregion
//}
}
}
}
}
#endregion
//vReader.CloseVisio();
if (deletedCode.Count > 0)
{
pnlBackup.Enabled = true;
}
else
{
deletedCode.Add(new DeletedInfo
{
Name = "No items will be deleted."
});
pnlBackup.Enabled = false;
}
lstDeleted.DataSource = deletedCode;
lstDeleted.DisplayMember = "Name";
pnlDeleted.Visible = true;
#endregion
}
transaction.Commit();
}
catch (Exception ex)
{
throw ex;
}
}
}
IModelBus modelBus = store.GetService(typeof(SModelBus)) as IModelBus;
if (modelBus != null)
{
foreach (SubProcess process in subProcessList)
{
using (Transaction transaction = process.Store.TransactionManager.BeginTransaction("update modelbus"))
{
//List<Activity> subProcessActivities = process.Activities.Where(a => a is SubProcessActivity).ToList();
//foreach (Activity act in subProcessActivities)
//{
// var _act = (SubProcessActivity)act;
// string toProc = ((SubProcessActivity)act).ToProcessId;
// string toAct = ((SubProcessActivity)act).ToActivityId;
// var toProcess = (SubProcess)subProcessList.Where(p => p.VisioId.ToString() == toProc).SingleOrDefault();
// var toActivity = (SubProcessActivity)toProcess.Activities.Where(a => a.VisioId.ToString() == toAct).SingleOrDefault();
// string projectPath = lstProjects.SelectedValue.ToString().Substring(0, lstProjects.SelectedValue.ToString().LastIndexOf(@"\"));
// string folderPath = string.Format(@"{0}\processes\", _projectFolderPath);
// string filePath = string.Format("{0}{1}.subprocess", _folderPath, toActivity.SubProcess.SubProcessName.Replace(" ", "_"));
// ModelBusAdapterManager manager = modelBus.FindAdapterManagers(filePath).First();
// ModelBusReference reference = manager.CreateReference(filePath);
// using (ModelBusAdapter adapter = modelBus.CreateAdapter(reference))
// {
// _act.ExternalActivityRef = adapter.GetElementReference(toActivity);
// _act.SubProcessActivityRef = adapter.GetElementReference(toActivity);
// }
//}
transaction.Commit();
}
}
}
vReader.CloseVisio();
Close();
}