本文整理汇总了C#中IVisualizerObjectProvider.ReplaceObject方法的典型用法代码示例。如果您正苦于以下问题:C# IVisualizerObjectProvider.ReplaceObject方法的具体用法?C# IVisualizerObjectProvider.ReplaceObject怎么用?C# IVisualizerObjectProvider.ReplaceObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IVisualizerObjectProvider
的用法示例。
在下文中一共展示了IVisualizerObjectProvider.ReplaceObject方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Show
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
string modifiedXml = Visualizer.ShowModal_LoadXmlFromString(objectProvider.GetObject().ToString(), objectProvider.IsObjectReplaceable, true);
if (Visualizer.ReplaceObject())
{
StringReader sr = new StringReader(modifiedXml);
objectProvider.ReplaceObject(sr.ReadToEnd());
sr.Close();
}
}
示例2: Show
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
object data = (object)objectProvider.GetObject();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
using(StoreBrowser storeBrowser = new StoreBrowser()) {
storeBrowser.Store = data as FileStore;
storeBrowser.ShowDialog();
if(objectProvider.IsObjectReplaceable) {
objectProvider.ReplaceObject(storeBrowser.Store);
}
}
}
示例3: Show
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
if (windowService != null)
{
if (objectProvider != null)
{
var obj = objectProvider.GetObject() as QueryData;
if (obj !=null)
{
var form = new EfVisualizerForm();
if (!string.IsNullOrEmpty(obj.ExceptionMessage))
{
form.SetDebugText(string.Format("Error:{0}{1}", Environment.NewLine, obj.ExceptionMessage));
}
else
{
form.SetDebugText(obj.SQLCommand);
}
DialogResult dialogResult = windowService.ShowDialog(form);
bool flag;
if (!objectProvider.IsObjectReplaceable)
{
flag = true;
}
else
{
flag = dialogResult != DialogResult.OK;
}
if (!flag)
{
objectProvider.ReplaceObject(obj);
}
}
}
else
{
throw new ArgumentNullException("objectProvider");
}
}
else
{
throw new ArgumentNullException("windowService");
}
}
示例4: Show
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
//make sure the object is the correct type
var objectToVisualise = objectProvider.GetObject() as DemoObject;
//Show the visualiser
var form = new DemoObjectVisualiserForm(objectToVisualise);
windowService.ShowDialog(form);
//If the object is replaceable, update the colour
if (objectProvider.IsObjectReplaceable)
{
objectToVisualise.Colour = form.colourBox.BackColor;
objectProvider.ReplaceObject(objectToVisualise);
}
}
示例5: Show
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
// 送られてくるはずのCvMatProxyを受け取る
using (var proxy = objectProvider.GetObject() as CvMatProxy)
{
if (proxy == null)
{
throw new ArgumentException();
}
using (var form = new CvMatViewer(proxy))
{
// 行列データ表示用フォームを開く
windowService.ShowDialog(form);
// 値の変更を元データのCvMatに反映
if (objectProvider.IsObjectReplaceable)
{
objectProvider.ReplaceObject(form.ModifiedProxy);
}
}
}
}
示例6: Show
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
if (windowService == null)
throw new ArgumentNullException("windowService");
if (objectProvider == null)
throw new ArgumentNullException("objectProvider");
// TODO: 取得要顯示其視覺化檢視的物件。
// 將 objectProvider.GetObject() 的結果轉型為
// 要視覺化的物件型別。
Image data = (Image)objectProvider.GetObject();
// TODO: 顯示您的物件檢視。
// 以自己的自訂表單或控制項取代 displayForm。
using (var displayForm = new ImageEffectsView(data))
{
// displayForm.Text = data.ToString();
if (windowService.ShowDialog(displayForm) != DialogResult.OK) return;
if (!objectProvider.IsObjectReplaceable) return;
IImageEffectsView view = displayForm;
objectProvider.ReplaceObject(view.ResultImage);
// objectProvider.TransferObject(view.ResultImage);
}
}
示例7: Show
protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
{
if (windowService == null)
throw new ArgumentNullException("windowService");
if (objectProvider == null)
throw new ArgumentNullException("objectProvider");
DataTable dt = objectProvider.GetObject() as DataTable;
if (dt != null)
{
using (FormMainDataSet main = new FormMainDataSet())
{
main.Init(dt, objectProvider.IsObjectReplaceable, "DataView Visualizer");
DialogResult dr = windowService.ShowDialog(main);
if (objectProvider.IsObjectReplaceable && dr == DialogResult.OK)
objectProvider.ReplaceObject(dt);
}
}
}