private void btnNew_Click(object sender, EventArgs e) { if (Control.ModifierKeys == (Keys.Control | Keys.Shift)) { IApplicationInterface.GetFloatingForm( eFloatReason.NotSet, new ucPropertyEditor(DataSourceManager.DataSourceFactories[0])) .ShowDialog(this); return; } // Open NewModel UserControl ucNewModel newModel = new ucNewModel(); string rootName = string.Format("Decision model-{0}", ctrl.Trees.Count + 1); if (IApplicationInterface.GetFloatingForm(eFloatReason.NotSet, newModel) .ShowDialog() == DialogResult.OK) { IDecisionTree tree = IApplicationInterface.NewDescisionTree(rootName); tree.Persistence = new XmlPersistenceImpl(); (tree.RootNode as IRootNode).DomainTemplate = newModel.SelectedDomainModelFile; ctrl.AddTree(tree); } }
internal void CreateSession() { Uri serviceAddress = new Uri("net.pipe://localhost/Multitouch.Service/ApplicationInterface"); EndpointAddress remoteAddress = new EndpointAddress(serviceAddress); NetNamedPipeBinding namedPipeBinding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None); namedPipeBinding.MaxReceivedMessageSize = int.MaxValue; namedPipeBinding.MaxBufferSize = int.MaxValue; namedPipeBinding.ReaderQuotas.MaxArrayLength = int.MaxValue; namedPipeBinding.ReceiveTimeout = TimeSpan.MaxValue; IApplicationInterfaceCallback dispatcher = new MultitouchServiceContactDispatcher(logic); InstanceContext instanceContext = new InstanceContext(dispatcher); service = new ApplicationInterfaceClient(instanceContext, namedPipeBinding, remoteAddress); try { service.CreateSession(); MouseHelper.SingleMouseFallback = false; } catch (EndpointNotFoundException) { //throw new MultitouchException("Could not connect to Multitouch service, please start Multitouch input server before running this application.", e); Trace.TraceWarning("Could not connect to Multitouch service. Enabling single mouse input."); SingleMouseClientAndDispatcher client = new SingleMouseClientAndDispatcher(logic); service = client; dispatcher = client; MouseHelper.SingleMouseFallback = true; } contactDispatcher = dispatcher; }
public GameController( IWriter writer, IReader reader, IApplicationInterface appInterface, IDrawShip drawShip) { this.writer = writer; this.reader = reader; this.appInterface = appInterface; this.drawShip = drawShip; }
private void LoadFile(string fileName) { LastUsedFolder = fileName; IDecisionTree tree = IApplicationInterface.NewDescisionTree(); IPersistence persistence = new XmlPersistenceImpl(fileName); if (tree.Load(persistence, fileName)) { ctrl.AddTree(tree); IApplicationInterface.StatusLine = string.Format("Opened {0} from disk", Path.GetFileName(fileName)) + UI_Constants.ZoomPanHint; } }
public Registration( IReader reader, IWriter writer, IDataBase dataBase, IApplicationInterface applicationInterface, ISelectingSpaceship selectingSpaceship) { this.reader = reader; this.writer = writer; this.dataBase = dataBase; this.applicationInterface = applicationInterface; this.selectingSpaceship = selectingSpaceship; }
private void btnNew_Click(object sender, EventArgs e) { string rootName = string.Format("Domain template-{0}", ctrl.Trees.Count + 1); IDecisionTree tree = IApplicationInterface.NewDescisionTree(rootName); IBaseNode dataObjects = tree.CreateNewNode(eNodeType.DataObjects, null, Constants.DataNodesTreeName); tree.RootNode.AddNode(dataObjects); IBaseNode dataSources = tree.CreateNewNode(eNodeType.DataSources, null, Constants.DataSourcesTreeName); tree.RootNode.AddNode(dataSources); ctrl.AddTree(tree); }
public Engine (IPlayerCreator playerCreator, IGameController gameController, IRegistration player, IWriter writer, IReader reader, IApplicationInterface applicationInterface) { this.playerCreator = playerCreator; this.gameController = gameController; this.player = player; this.Reader = reader; this.applicationInterface = applicationInterface; this.Writer = writer; }
internal void RemoveSession() { if (contactDispatcher != null) { try { service.RemoveSession(); IDisposable client = service as IDisposable; if(client != null) client.Dispose(); } catch (Exception e) { Trace.TraceWarning(e.ToString()); } contactDispatcher = null; service = null; } }
private void LoadFile(string fileName) { LastUsedFolder = fileName; IDecisionTree tree = IApplicationInterface.NewDescisionTree(); IPersistence persistence = new XmlPersistenceImpl(fileName); if (tree.Load(persistence, fileName)) { if (tree.RootNode.GetNode(eNodeType.DataObjects) == null) { IBaseNode dataObjects = tree.CreateNewNode(eNodeType.DataObjects, null, Constants.DataNodesTreeName); tree.RootNode.AddNode(dataObjects); } if (tree.RootNode.GetNode(eNodeType.DataSources) == null) { IBaseNode dataSources = tree.CreateNewNode(eNodeType.DataSources, null, Constants.DataSourcesTreeName); tree.RootNode.AddNode(dataSources); } ctrl.AddTree(tree); IApplicationInterface.StatusLine = string.Format("Opened {0} from disk", Path.GetFileName(fileName)) + UI_Constants.ZoomPanHint; } }
public Menu(IWriter writer, IApplicationInterface applicationInterface) { this.writer = writer; this.applicationInterface = applicationInterface; }
public MainWindow(IApplicationInterface app) { this.appInstance = app; InitializeComponent(); this.initValues(); }
private void TemplateForm_FormClosing(object sender, FormClosingEventArgs e) { bool CanExit = true; DialogResult UserSelected = DialogResult.None; SakwaUserControl oldEditor = editor.Controls.Count > 0 ? editor.Controls[0] as SakwaUserControl : null; if (oldEditor != null) { oldEditor.OnDeactivate(); } foreach (IDecisionTree tree in ctrl.Trees) { if (tree.IsDirty) { UserSelected = IApplicationInterface.GetFloatingForm( eFloatReason.NotSet, new ucUnsavedExit(true)).ShowDialog(); switch (UserSelected) { case DialogResult.OK: CanExit = true; break; case DialogResult.Yes: btnSave_Click(this, new EventArgs()); CanExit = true; break; default: CanExit = false; break; } break; } } if (CanExit) { conf.SetConfigurationValue(UI_Constants.TemplateFormState, this.WindowState.ToString()); IConfigurationItem size = conf.GetConfigurationItem(UI_Constants.TemplateFormSize); (size as IConfigurationItemObject <Size>).SetValue(this.Size); IConfigurationItem location = conf.GetConfigurationItem(UI_Constants.TemplateFormLocation); (location as IConfigurationItemObject <Point>).SetValue(this.Location); IConfigurationItem recentProjects = conf.GetConfigurationItem(UI_Constants.TemplateRecentProjects); if (recentProjects != null) { recentProjects.Clear(); foreach (IDecisionTree tree in ctrl.Trees) { if (File.Exists(tree.FullPath)) { string itemName = string.Format("item-{0}", recentProjects.ConfigurationItems.Count + 1); recentProjects.AddConfigurationItem(new IConfigurationItemImpl(itemName, tree.FullPath, UI_Constants.ConfigurationSource)); } } string path = ctrl.SelectedPath; conf.SetConfigurationValue(UI_Constants.TemplateRecentNode, path); } try { conf.Save(); } catch (Exception ex) { log.Debug(ex.ToString()); } _IApplication.ShowHideTemplateEditor(false, true); } else { e.Cancel = true; } }
private void lblVersion_Click(object sender, EventArgs e) { IApplicationInterface.ShowHelp(sender, UI_Constants.HelpChangeLog); }
private void LinkSubtreeError(LinkSubTree subTree) { // Open SubModel error IApplicationInterface.GetFloatingForm(eFloatReason.NotSet, new ucSubModelNotFound(subTree)) .ShowDialog(); }