本文整理汇总了C#中IEditor类的典型用法代码示例。如果您正苦于以下问题:C# IEditor类的具体用法?C# IEditor怎么用?C# IEditor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IEditor类属于命名空间,在下文中一共展示了IEditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Load
public static void Load(IEditor editor, string fileName)
{
editor.Clear();
var doc = new XmlDocument();
doc.Load(fileName);
var waves = doc.SelectSingleNode("Waves");
editor.WaveList = new ObservableCollection<Wave>();
foreach (XmlNode wave in waves.SelectNodes("Wave"))
{
var w = new Wave();
w.EnemyList = new ObservableCollection<Enemy>();
foreach (XmlNode enemy in wave.SelectNodes("Enemy"))
{
w.EnemyList.Add(new Enemy
{
Type = enemy.GetAttribute("Type"),
Spawn = float.Parse(enemy.GetAttribute("Spawn").Default("0")),
X = float.Parse(enemy.GetAttribute("X").Default("0")),
Speed = float.Parse(enemy.GetAttribute("Speed").Default("0")),
Money = float.Parse(enemy.GetAttribute("Money").Default("0"))
});
}
editor.WaveList.Add(w);
}
}
示例2: CreateNewPlus
/// <summary>
/// 引き継いで新規作成
/// </summary>
/// <param name="iEditor">テキストを取得するためのIEditorインターフェース</param>
/// <returns>正否だけどとりあえずtrueしか返さない</returns>
public bool CreateNewPlus(IEditor iEditor)
{
NewFilePlusControl control = new NewFilePlusControl();
control.Owner = Application.Current.MainWindow;
var newFilePlusViewModel = NewFilePlusGenerator.GetNewFilePlusViewModel();
control.DataContext = newFilePlusViewModel;
//ダイアログを表示する
if (ShowDialogManager.ShowDialog(control) == true)
{
var transferData = NewFilePlusGenerator.GetTransferData(newFilePlusViewModel);
ModelsComposite.CreateNew(iEditor);
CurrentFile = "";
// Transferの過程でイベントが発生しても怒られないように、一旦Newの状態を各画面に通知する
EventAggregator.OnDataReloaded(this, new DataReloadedEventArgs());
// 引き継ぎ
NewFilePlusTransferer.Transfer(transferData);
// もっかい画面に通知
EventAggregator.OnDataReloaded(this, new DataReloadedEventArgs());
return true;
}
return true;
}
示例3: FindReplaceDialogViewModel
public FindReplaceDialogViewModel(IEditor editor)
{
this.editor = editor;
//_searchDirections = new List<string>();
//_searchDirections.Add("Next");
//_searchDirections.Add("Prev");
}
示例4: SpiralCurveDialog
// modified form constructor to accept the app and editor objects passed by ref
public SpiralCurveDialog(ref IApplication pApp, ref IEditor pEditor)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
try
{
m_pApp = pApp;
m_pEditor = pEditor;
m_pEditProp2 = (IEditProperties2)m_pEditor;
// REGEX strings that will be used for DMS units
m_RegexUnitsDMS = new ArrayList();
m_RegexUnitsDMS.Add(@" *(\d+)\.(\d\d)(\d\d\d\d) *");
m_RegexUnitsDMS.Add(@" *(\d+)\/(\d+)\/(\d+\.?\d*) *");
m_RegexUnitsDMS.Add(@" * *(\d+)\^(\d+)\'(\d+\.?\d*)\" + quote + " *");
m_RegexUnitsDMS.Add(@" *(\d+)\-(\d+)\-(\d+\.?\d*) *");
// REGEX string that will be used for DD, radians, Gons, etc..
m_RegexUnitsDecimals = @" *(\d+\.?\d+) *";
// REGEX object for validating the length with units
m_RegexUnitsMeasure = new Regex(@"(\d*\.?\d+) *(" + String.Join("|", this.AllowedUnits) + ") *$");
// validate the spatial reference of the edit data frame;
m_SRValid = SpatialRefValid();
}
catch
{
}
}
示例5: SaveXml
//! Save xml.
public void SaveXml(XmlWriter Writer, IEditor AssetDatabase)
{
// Write original prefab
Writer.WriteAttributeString("prefab", AssetDatabase.GetAssetPath(AssetDatabase.GetPrefabParent(gameObject)));
// Save instance
m_Instance.SaveXml(Writer);
}
示例6: frmMergeGNLines
public frmMergeGNLines(IApplication app, IEditor editor)
{
InitializeComponent();
_app = app;
m_editor = editor;
m_Config = ConfigUtil.GetMergeSplitConfig();
}
示例7: CurrentUserInfo
public CurrentUserInfo(IEditor editor)
{
_userName = Environment.UserName;
_domainName = Environment.UserDomainName;
_fullName = String.Format(@"{0}\{1}", _domainName, _userName);
_databaseUser = GetDatabaseUser(editor);
}
示例8: CreateNew
/// <summary>
/// 新規作成
/// </summary>
/// <param name="iEditor">テキストを取得するためのIEditorインターフェース</param>
/// <returns>正否だけどとりあえずtrueしか返さない</returns>
public bool CreateNew(IEditor iEditor)
{
ModelsComposite.CreateNew(iEditor);
CurrentFile = "";
EventAggregator.OnDataReloaded(this, new DataReloadedEventArgs());
return true;
}
示例9: EventListener
EventListener(IEditor editor, bool bListenAll)
{
if (editor == null)
{
throw new ArgumentNullException();
}
m_editor = editor;
}
示例10: Setup
public void Setup()
{
_messageDispatcher = new Fake_MessageDispatcher();
_pluginFactory = MockRepository.GenerateMock<IPluginLoader>();
_editor = MockRepository.GenerateMock<IEditor>();
_fileWriter = MockRepository.GenerateMock<IFileWriter>();
_dispatcher = new EditorDispatcher(_pluginFactory, _messageDispatcher, _fileWriter);
_dispatcher.SetEditor(_editor);
}
示例11: SetFlowByDigitizedDirectionCSharp
public SetFlowByDigitizedDirectionCSharp()
{
UID uidUtilNet = new UIDClass();
uidUtilNet.Value = "esriEditorExt.UtilityNetworkAnalysisExt";
m_utilNetExt = ArcMap.Application.FindExtensionByCLSID(uidUtilNet) as IUtilityNetworkAnalysisExt;
UID uidEditor = new UIDClass();
uidEditor.Value = "esriEditor.Editor";
m_editorExt = ArcMap.Application.FindExtensionByCLSID(uidEditor) as IEditor;
}
示例12: SaveScene
//! Save scene.
public void SaveScene(string Path, IEditor AssetDatabase)
{
// Testing for now
var stream = new FileStream(Application.dataPath + "/Scenes/" + Path + "scene.bytes", FileMode.Create);
var formatter = new BinaryFormatter();
// Serialize map
m_TerrainManager.Save(formatter, stream, AssetDatabase);
stream.Flush();
stream.Close();
}
示例13: NotifyDocumentSaved
public void NotifyDocumentSaved(IEditor source)
{
//If we are the source, don't do anything. We already have the changes
if(source != this)
{
DotaDataObject obj = EditingObject;
//Force the property editor to clear out the data and redraw
EditingObject = null;
EditingObject = obj;
}
}
示例14: EditorManager
public EditorManager(IFileViewModel setting, MainViewModel mainViewModel)
{
m_editorsWithSettings = new FilteredObservableCollection<IEditor>(m_baseEditors, editor => editor.Settings != null);
m_setting = setting;
m_mainViewModel = mainViewModel;
m_imageViewerViewModel = new ImageViewerViewModel();
m_jsonEditorViewModel = new JsonEditorViewModel(mainViewModel);
m_simpleEditor = new BaseTextEditorViewModel(mainViewModel);
m_findInFilesViewModel = new FindInFilesViewModel(mainViewModel);
UpdateSettings();
m_setting.ContentChanged += SettingOnContentChanged;
}
示例15: DoSave
protected override void DoSave(IEditor source)
{
if (source is TextEditor)
{
TextEditor textEd = source as TextEditor;
//Commit these changes to the dota object.
KeyValue kv = KVParser.KV1.Parse(textEd.TextContent);
DotaObject.KeyValue = kv;
}
}