/// <summary>
        /// Save the address space data set in an external dictionary file.
        /// </summary>
        /// <param name="prompt">If set to <c>true</c> show prompt to enter a file name.</param>
        /// <returns><c>true</c> if operation accomplished successfully.</returns>
        internal bool Save(bool prompt, Type4Serialization configuration)
        {
            prompt = m_Empty || prompt;
            if (prompt)
            {
                if (!ShowDialogSaveFileDialog())
                {
                    return(false);
                }
            }
            m_Empty = false;
            bool res = false;

            try
            {
                GraphicalUserInterface.UseWaitCursor = true;
                Save(GetConfiguration(configuration));
                res = true;
            }
            catch (Exception ex)
            {
                GraphicalUserInterface.MessageBoxShowExclamation(ex.Message, Properties.Resources.SolutionFileSaveError);
            }
            finally
            {
                GraphicalUserInterface.UseWaitCursor = false;
            }
            return(res);
        }
        /// <summary>
        /// Reads the configuration.
        /// </summary>
        /// <param name="fileName">The fully qualified name of the file, or the relative file name.</param>
        /// <exception cref="FileNotFoundException">The exception that is thrown when an attempt to access a file
        /// that does not exist on disk fails.
        /// </exception>
        /// <exception cref="System.InvalidOperationException">An error occurred during deserialization. The original exception is available
        /// using the System.Exception.InnerException property.
        /// </exception>
        internal Type4Serialization ReadConfiguration(string fileName)
        {
            FileInfo info = new FileInfo(fileName);

            if (!info.Exists)
            {
                throw new FileNotFoundException(fileName);
            }
            try
            {
                GraphicalUserInterface.UseWaitCursor = true;
                Type4Serialization _return = XmlFile.ReadXmlFile <Type4Serialization>(fileName);
                DefaultFileName = fileName;
                m_Empty         = false;
                return(_return);
            }
            catch (InvalidOperationException _ioe)
            {
                GraphicalUserInterface.MessageBoxShowExclamation(string.Format(ReadErrorInvalidOperationStringFormat, _ioe.GetMessageFromException()), Resources.SolutionFileOpenError);
                return(null);
            }
            catch (Exception _ex)
            {
                GraphicalUserInterface.MessageBoxShowExclamation(string.Format(ReadErrorGenericStringFormat, _ex.GetMessageFromException()), Resources.SolutionFileOpenError);
                return(null);
            }
            finally
            {
                GraphicalUserInterface.UseWaitCursor = false;
            }
        }
예제 #3
0
파일: Enemy.cs 프로젝트: Nige91/JetPack
 public void Draw(SKCanvas canvas)
 {
     if (!exploded)
     {
         animatorNormal.Draw(canvas, movementModule.GetRect());
         GraphicalUserInterface.DrawHealthbar(
             canvas,
             movementModule.coords.X,
             movementModule.coords.Y,
             health / maxHealth
             );
     }
     else
     {
         animatorExpl.Draw(canvas, movementModule.GetRectExpl());
     }
 }
 /// <summary>
 /// Saves the specified data <paramref name="dataToSerialize"/>.
 /// </summary>
 /// <param name="dataToSerialize">Data to be serialized.</param>
 /// <exception cref="System.InvalidOperationException">An error occurred during serialization. The original exception is available using the System.Exception.InnerException property.</exception>
 /// <exception cref="System.UnauthorizedAccessException:">Access is denied.</exception>
 /// <exception cref="System.ArgumentException">path is an empty string(""). -or- path contains the name of a system device (com1, com2, and so on)</exception>
 /// <exception cref="System.ArgumentNullException">path is null.</exception>
 /// <exception cref="System.IO.DirectoryNotFoundException">The specified path is invalid, such as being on an unmapped drive.</exception>
 /// <exception cref="System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length.
 /// For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters.
 /// </exception>
 /// <exception cref="System.IO.IOException">path includes an incorrect or invalid syntax for file name, directory name, or volume label syntax.</exception>
 /// <exception cref="System.Security.SecurityException">The caller does not have the required permission.</exception>
 protected void Save(Type4Serialization modelDesign)
 {
     try
     {
         XmlFile.DataToSerialize <Type4Serialization> dataToSerialize = PrepareDataToSerialize(modelDesign);
         GraphicalUserInterface.UseWaitCursor = true;
         BeforeWrite?.Invoke(this, new StringEventArgs(DefaultFileName));
         XmlFile.WriteXmlFile <Type4Serialization>(dataToSerialize.Data, DefaultFileName, FileMode.Create, dataToSerialize.StylesheetName, dataToSerialize.XmlNamespaces);
         ChangesArePresent = false;
     }
     catch (Exception ex)
     {
         GraphicalUserInterface.MessageBoxShowExclamation(ex.Message, Properties.Resources.SolutionFileSaveError);
     }
     finally
     {
         GraphicalUserInterface.UseWaitCursor = false;
     }
 }
예제 #5
0
        /// <summary>
        /// Initialize the tree view.
        /// </summary>
        /// <param name="gui">The GUI that this treeview will be a part of.</param>
        /// <param name="position">The position of this treeview.</param>
        /// <param name="height">The height of this treeview.</param>
        /// <param name="width">The width of this treeview.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Nodes = new List<TreeNode>();
            _Indent = 15;
            _ChildPosition = new Vector2(Position.X + _Indent, Position.Y + 10);
            _ChildWidth = 200;
            _ChildHeight = 15;
            _MoveNodeUp = new Button(gui, new Vector2(position.X + (width / 4), position.Y + 5));
            _MoveNodeDown = new Button(gui, new Vector2(position.X + (width / 4) + 20, position.Y + 5));

            //Add the controls.
            Add(_MoveNodeDown);
            Add(_MoveNodeUp);

            //Hook up some events.
            _MoveNodeUp.MouseClick += OnMoveNodeUpClick;
            _MoveNodeDown.MouseClick += OnMoveNodeDownClick;
        }
예제 #6
0
        /// <summary>
        /// Initialize the label.
        /// </summary>
        /// <param name="gui">The GUI that this label will be a part of.</param>
        /// <param name="position">The position of this label.</param>
        /// <param name="height">The height of this label.</param>
        /// <param name="width">The width of this label.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Text = "";
            _Tag = null;
            _VisibleTextLength = 0;
        }
예제 #7
0
 /// <summary>
 /// Initialize the property list.
 /// </summary>
 /// <param name="gui">The GUI that this property list will be a part of.</param>
 /// <param name="position">The position of this property list.</param>
 /// <param name="height">The height of this property list.</param>
 /// <param name="width">The width of this property list.</param>
 protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
 {
     //The inherited method.
     base.Initialize(gui, position, width, height);
 }
예제 #8
0
 /// <summary>
 /// Create a list item.
 /// </summary>
 /// <param name="gui">The GUI that this list item will be a part of.</param>
 /// <param name="list">The list this list item is a part of.</param>
 /// <param name="position">The position of this list item.</param>
 /// <param name="height">The height of this list item.</param>
 /// <param name="width">The width of this list item.</param>
 public FieldListItem(GraphicalUserInterface gui, List list, Vector2 position, float width, float height)
     : base(gui, list, position, width, height)
 {
     //Initialize some variables.
     Initialize(gui, position, width, height);
 }
예제 #9
0
 /// <summary>
 /// Constructor for a field.
 /// </summary>
 /// <param name="gui">The GUI that this field will be a part of.</param>
 /// <param name="height">The height of this field.</param>
 /// <param name="width">The width of this field.</param>
 public Field(GraphicalUserInterface gui, float width, float height)
 {
     Initialize(gui, Vector2.Zero, width, height);
 }
예제 #10
0
        /// <summary>
        /// Initialize the checkbox.
        /// </summary>
        /// <param name="gui">The GUI that this checkbox will be a part of.</param>
        /// <param name="position">The position of this checkbox.</param>
        /// <param name="height">The height of this checkbox.</param>
        /// <param name="width">The width of this checkbox.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Ratio = .1f;
            _Label = new Label(GUI, new Vector2(Position.X + (Width * _Ratio), Position.Y), (Width * (1 - _Ratio)), Height);
            _Button = new Button(GUI, Position, (Width * _Ratio), Height);
            _IsChecked = false;
            _Label.Text = "";

            //Add the controls.
            Add(_Label);
            Add(_Button);

            //Hook up some events.
            _Button.MouseClick += OnButtonClicked;
        }
예제 #11
0
        /// <summary>
        /// Initialize the expander.
        /// </summary>
        /// <param name="gui">The GUI that this expander will be a part of.</param>
        /// <param name="position">The position of this expander.</param>
        /// <param name="height">The height of this expander.</param>
        /// <param name="width">The width of this expander.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Button = new Button(GUI, Position, 15, 15);
            _Header = new Label(GUI, Position + new Vector2(20, 0), 75, Height);
            _IsExpanded = true;
            _Layout = new Layout(GUI, Position + new Vector2(0, 15), _Width, _Height);
            _ItemContent = new List<Component>();
            _Header.Text = "Header";

            //Add the items.
            Add(_Header);
            Add(_Button);

            //Hook up some events.
            _Button.MouseClick += OnHeaderClick;
            _Header.MouseClick += OnHeaderClick;
        }
예제 #12
0
 /// <summary>
 /// Constructor for a form.
 /// </summary>
 /// <param name="gui">The GUI that this form will be a part of.</param>
 /// <param name="position">The position of this form.</param>
 /// <param name="height">The height of this form.</param>
 /// <param name="width">The width of this form.</param>
 public Form(GraphicalUserInterface gui, Vector2 position, float width, float height)
 {
     Initialize(gui, position, width, height);
 }
예제 #13
0
        /// <summary>
        /// Initialize the form.
        /// </summary>
        /// <param name="gui">The GUI that this form will be a part of.</param>
        /// <param name="position">The position of this form.</param>
        /// <param name="height">The height of this form.</param>
        /// <param name="width">The width of this form.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Items = new List<Component>();
            _Layout = new Layout(gui, position, width, height);
            _IsDirty = false;
        }
예제 #14
0
 /// <summary>
 /// Create a treeview node.
 /// </summary>
 /// <param name="gui">The GUI that this node will be a part of.</param>
 /// <param name="parent">The node's parent node.</param>
 /// <param name="position">The position of this node.</param>
 /// <param name="height">The height of this node.</param>
 /// <param name="width">The width of this node.</param>
 public TreeNode(GraphicalUserInterface gui, TreeNode parent, Vector2 position, float width, float height)
 {
     //Initialize some variables.
     _ParentNode = parent;
     Initialize(gui, position, width, height);
 }
예제 #15
0
        /// <summary>
        /// Initialize the treeview node.
        /// </summary>
        /// <param name="gui">The GUI that this node will be a part of.</param>
        /// <param name="position">The position of this trenodeeview.</param>
        /// <param name="height">The height of this treenodeview.</param>
        /// <param name="width">The width of this treevnodeiew.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Nodes = new List<TreeNode>();
            _Button = new Button(gui, new Vector2(Position.X, Position.Y + (Height / 3)));
            _Checkbox = new Checkbox(gui, new Vector2(Position.X + _Button.Width + 2, Position.Y), width, height);
            _NodeState = TreeNodeState.None;

            //Add the items to the list.
            Add(_Button);
            Add(_Checkbox);

            //Hook up some events.
            _Checkbox.CheckboxTick += OnCheckboxTicked;
            _Button.MouseClick += OnButtonMouseClick;
        }
예제 #16
0
        /// <summary>
        /// Initialize the tab control.
        /// </summary>
        /// <param name="gui">The GUI that this tab control will be a part of.</param>
        /// <param name="position">The position of this tab control.</param>
        /// <param name="height">The height of this tab control.</param>
        /// <param name="width">The width of this tab control.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Tabs = new List<TabPage>();
            _SelectedTab = null;
        }
예제 #17
0
        /// <summary>
        /// Initialize the picturebox.
        /// </summary>
        /// <param name="gui">The GUI that this picturebox will be a part of.</param>
        /// <param name="position">The position of the picturebox.</param>
        /// <param name="width">The width of this picturebox.</param>
        /// <param name="height">The height of this picturebox.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Initialize some variables.
            _Scale = 1;
            _Origin = new Vector2(Width / 2, Height / 2);
            _PictureOrigin = Vector2.Zero;
            _DrawArea = new Rectangle(0, 0, (int)Width, (int)Height);
        }
예제 #18
0
        /// <summary>
        /// Initialize the textbox.
        /// </summary>
        /// <param name="gui">The GUI that this textbox will be a part of.</param>
        /// <param name="position">The position of this textbox.</param>
        /// <param name="height">The height of this textbox.</param>
        /// <param name="width">The width of this textbox.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Text = "";
            _TextStart = 0;
            _VisibleTextLength = 0;
            _MarkerIndex = 0;
            _MarkerCharacter = '_';
            _MarkerPosition = Position;
            _UsedKeys = new Dictionary<Keys, TimeSpan>();
            _FastRepeatKeys = new List<Keys>();
            _KeyRepeatTime = new TimeSpan(0, 0, 0, 0, 500);
            _FastKeyRepeatTime = new TimeSpan(0, 0, 0, 0, 25);
            _TotalElapsedTime = TimeSpan.Zero;
            _Validator = ".*";
            _IsReadOnly = false;
        }
예제 #19
0
        /// <summary>
        /// Initialize the combobox.
        /// </summary>
        /// <param name="gui">The GUI that this combobox will be a part of.</param>
        /// <param name="position">The position of this combobox.</param>
        /// <param name="height">The height of this combobox.</param>
        /// <param name="width">The width of this combobox.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Ratio = .1f;
            _Label = new Label(GUI, Position, (Width * (1 - _Ratio)), Height);
            _Button = new Button(GUI, new Vector2((Position.X + (Width * (1 - _Ratio))), Position.Y), (Width * _Ratio), Height);
            _List = new List(GUI, new Vector2(Position.X, (Position.Y + (_Label.Height + 2))), Width, 118);
            _List.IsActive = false;
            _SelectedItem = null;
            _State = ComboboxState.Closed;
            _Label.Text = "";

            //Add the items.
            Add(_Label);
            Add(_Button);
            Add(_List);

            //Hook up some events.
            _List.ItemSelect += OnItemSelect;
            _Button.MouseClick += OnButtonClick;
        }
예제 #20
0
        /// <summary>
        /// Initialize the field.
        /// </summary>
        /// <param name="gui">The GUI that this field will be a part of.</param>
        /// <param name="position">The position of this field.</param>
        /// <param name="height">The height of this field.</param>
        /// <param name="width">The width of this field.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Ratio = .4f;
            _Label = new Label(GUI, Position, Width * _Ratio, Height);
            _Textbox = new Textbox(GUI, new Vector2(Position.X + Width * _Ratio, Position.Y), Width * (1 - _Ratio), Height);
            _IsFixed = false;
            _Label.Text = "";
            _Textbox.Text = "";

            //Add the items.
            Add(_Label);
            Add(_Textbox);
        }
예제 #21
0
        /// <summary>
        /// Initialize the menu.
        /// </summary>
        /// <param name="gui">The GUI that this menu will be a part of.</param>
        /// <param name="position">The position of this menu.</param>
        /// <param name="height">The height of this menu.</param>
        /// <param name="width">The width of this menu.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Border = 2;
            _ItemWidth = 100;
        }
예제 #22
0
        /// <summary>
        /// Initialize the menu item.
        /// </summary>
        /// <param name="gui">The GUI that this menu item will be a part of.</param>
        /// <param name="position">The position of this menu item.</param>
        /// <param name="height">The height of this menu item.</param>
        /// <param name="width">The width of this menu item.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Label = new Label(GUI, Position, Width, 30);
            _List = new List(GUI, new Vector2(Position.X, (Position.Y + (_Label.Height + 2))), Width, 118);
            _List.IsActive = false;
            _SelectedItem = null;
            _State = MenuState.Closed;
            _Label.Text = "";

            //Add the controls.
            Add(_Label);
            Add(_List);

            //Hook up some events.
            _Label.MouseClick += OnLabelClick;
            _List.ItemSelect += OnItemSelect;
        }
예제 #23
0
        /// <summary>
        /// Initialize the list item.
        /// </summary>
        /// <param name="gui">The GUI that this tabpage will be a part of.</param>
        /// <param name="position">The position of this tabpage.</param>
        /// <param name="height">The height of this tabpage.</param>
        /// <param name="width">The width of this tabpage.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Button = new Button(gui, Position, Width, Height);
            _IsHiding = true;

            //Add the controls.
            Add(_Button);

            //Subscribe to some events.
            _Button.MouseClick += OnButtonClick;
        }
예제 #24
0
        /// <summary>
        /// Initialize the list item.
        /// </summary>
        /// <param name="gui">The GUI that this list item will be a part of.</param>
        /// <param name="position">The position of this list item.</param>
        /// <param name="height">The height of this list item.</param>
        /// <param name="width">The width of this list item.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Field = new Field(gui, Position, Width, Height);
        }
예제 #25
0
 /// <summary>
 /// Create a button.
 /// </summary>
 /// <param name="gui">The GUI that this item will be a part of.</param>
 /// <param name="position">The position of this item.</param>
 public Button(GraphicalUserInterface gui, Vector2 position)
 {
     //Initialize some variables.
     Initialize(gui, position, 15, 15);
 }
예제 #26
0
 /// <summary>
 /// Create a list item.
 /// </summary>
 /// <param name="gui">The GUI that this list item will be a part of.</param>
 /// <param name="list">The list this list item is a part of.</param>
 /// <param name="position">The position of this list item.</param>
 /// <param name="height">The height of this list item.</param>
 /// <param name="width">The width of this list item.</param>
 public ListItem(GraphicalUserInterface gui, List list, Vector2 position, float width, float height)
 {
     //Initialize some variables.
     _List = list;
     Initialize(gui, position, width, height);
 }
예제 #27
0
        /// <summary>
        /// Initialize the component.
        /// </summary>
        /// <param name="gui">The GUI that this component will be a part of.</param>
        /// <param name="position">The position of the component.</param>
        /// <param name="width">The width of this component.</param>
        /// <param name="height">The height of this component.</param>
        protected virtual void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //Initialize some variables.
            _GUI = gui;
            _Position = position;
            _Sprite = new SpriteManager();
            _Width = width;
            _Height = height;
            _IsActive = true;
            _IsVisible = true;
            _HasFocus = false;
            _IsMouseHovering = false;
            _Transparence = .5f;
            _MaxTransparence = 0;
            _MinTransparence = 1;
            _DrawOrder = 0;
            _CellStyle = CellStyle.Dynamic;
            _Items = new List<Component>();
            _Parent = null;

            //Subscribe to events.
            _GUI.FocusNotification += OnFocusNotification;
        }
예제 #28
0
 /// <summary>
 /// Create a property list.
 /// </summary>
 /// <param name="gui">The GUI that this property list will be a part of.</param>
 /// <param name="position">The position of this property list.</param>
 /// <param name="height">The height of this property list.</param>
 /// <param name="width">The width of this property list.</param>
 public Propertylist(GraphicalUserInterface gui, Vector2 position, float width, float height)
     : base(gui, position, width, height)
 {
     //Initialize some variables.
     Initialize(gui, position, width, height);
 }
예제 #29
0
        /// <summary>
        /// Initialize the animation bar.
        /// </summary>
        /// <param name="gui">The GUI that this animation bar will be a part of.</param>
        /// <param name="animation">The animation that this item will play through.</param>
        /// <param name="position">The position of this animation bar.</param>
        /// <param name="height">The height of this animation bar.</param>
        /// <param name="width">The width of this animation bar.</param>
        public void Initialize(GraphicalUserInterface gui, Animation animation, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Animation = animation;
            _CurrentFrame = 0;
            _MarkerPosition = Vector2.Add(Position, new Vector2(25, 0));
            _SelectedFrameNumber = 0;
            _FrameMarkerNumber = 0;
            _FrameWidth = (100 * _Animation.FrameTime);
            _PlayButton = new Button(GUI, position, 20, 20);
            _IsPlaying = false;
            _FramePositionStart = (Position.X + 25);

            //Hook up some events.
            _PlayButton.MouseClick += OnPlayButtonClick;
            _Animation.KeyframeAdded += OnKeyframesChange;
            _Animation.KeyframeRemoved += OnKeyframesChange;
        }
예제 #30
0
        /// <summary>
        /// Builds the model managed by this project using external compiler.
        /// </summary>
        /// <param name="traceMessage">Action to be used to trace the .</param>
        void IProjectConfigurationManagement.Build(Action <string> traceMessage)
        {
            string _filePath = RelativeFilePathsCalculator.CalculateAbsoluteFileName(this.m_ISolutionConfigurationManagement.DefaultDirectory, m_UAModelDesignerProject.FileName);

            if (!File.Exists(this.DefaultFileName))
            {
                string msg = string.Format(Resources.BuildError_Fie_DoesNotExist, _filePath);
                traceMessage(msg);
                GraphicalUserInterface.MessageBoxShowError(msg, Resources.Build_Caption);
                return;
            }
            (string CSVFileName, string OutputDirectory) = BuildCalculateFileNames();
            if (!Directory.Exists(OutputDirectory))
            {
                Directory.CreateDirectory(OutputDirectory);
            }
            if (!File.Exists(CSVFileName))
            {
                string msg = string.Format(Resources.BuildError_Fie_DoesNotExist_doyouwanttocreateone, CSVFileName);
                if (GraphicalUserInterface.MessageBoxShowWarningAskYN(msg, Resources.Build_Caption))
                {
                    using (StreamWriter myCsvFile = new StreamWriter(CSVFileName, false))//we are creating an blank file (one empty line inside)
                    {
                        myCsvFile.WriteLine(" ");
                        myCsvFile.Flush();
                    }
                }
                else
                {
                    traceMessage(string.Format(Resources.BuildError_Fie_DoesNotExist, CSVFileName));
                    return;
                }
            }
            string           _commandLine  = string.Format(Properties.Settings.Default.Build_ProjectCompilationString, _filePath, CSVFileName, OutputDirectory);
            string           _compilerPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), Properties.Settings.Default.ProjectCompilationExecutable);
            ProcessStartInfo myStartInfo   = new ProcessStartInfo(_compilerPath)
            {
                Arguments = _commandLine,
                RedirectStandardOutput = true,
                RedirectStandardError  = true,
                UseShellExecute        = false,
                CreateNoWindow         = true
            };

            traceMessage($"{_compilerPath}  ");
            traceMessage(_commandLine);
            traceMessage("");
            Process _buildProcess = new Process
            {
                StartInfo = myStartInfo
            };

            if (!_buildProcess.Start())
            {
                GraphicalUserInterface.MessageBoxShowWarning(Resources.Build_click_ok_when_build_has_finished, Resources.Build_Caption);
            }
            else
            {
                _buildProcess.WaitForExit();
                string _outputfrombuildprocess      = _buildProcess.StandardOutput.ReadToEnd();
                string _erroroutputfrombuildprocess = _buildProcess.StandardError.ReadToEnd();
                if (!string.IsNullOrEmpty(_erroroutputfrombuildprocess))
                {
                    _erroroutputfrombuildprocess = string.Format(Resources.BuildError_error_occured, _erroroutputfrombuildprocess);
                }
                else
                {
                    _erroroutputfrombuildprocess = Resources.Build_project_ok;
                }
                _outputfrombuildprocess += _erroroutputfrombuildprocess;
                if (!string.IsNullOrEmpty(_outputfrombuildprocess))
                {
                    traceMessage(_outputfrombuildprocess);
                }
            }
        }
예제 #31
0
        /// <summary>
        /// Initialize the scroller.
        /// </summary>
        /// <param name="gui">The GUI that this scroller will be a part of.</param>
        /// <param name="position">The position of the scroller.</param>
        /// <param name="type">The scroller type, that is whether it scrolls horizontally or vertically.</param>
        /// <param name="length">The length of this scroller. Minimum is 80.</param>
        public void Initialize(GraphicalUserInterface gui, Vector2 position, ScrollerType type, float length)
        {
            //Call the base class and pass along the appropriate information.
            if (type == ScrollerType.Horizontal) { base.Initialize(gui, position, Math.Max(length, 80), 15); }
            else { base.Initialize(gui, position, 15, Math.Max(length, 80)); }

            //Initialize some variables.
            _Type = type;
            _Value = 0;
            _Thumb = new Button(GUI, Position);
            _Backward = new Button(GUI, Position);
            _Forward = new Button(GUI, Position);

            //Add the controls.
            Add(_Thumb);
            Add(_Backward);
            Add(_Forward);

            //Hook up some events.
            _Thumb.MouseDown += OnThumbDown;
            _Backward.MouseDown += OnBackwardDown;
            _Forward.MouseDown += OnForwardDown;
            _Backward.MouseClick += OnBackwardClick;
            _Forward.MouseClick += OnForwardClick;
        }
예제 #32
0
 /// <summary>
 /// Create a treeview.
 /// </summary>
 /// <param name="gui">The GUI that this treeview will be a part of.</param>
 /// <param name="position">The position of this treeview.</param>
 /// <param name="height">The height of this treeview.</param>
 /// <param name="width">The width of this treeview.</param>
 public TreeView(GraphicalUserInterface gui, Vector2 position, float width, float height)
 {
     //Initialize some variables.
     Initialize(gui, position, width, height);
 }
예제 #33
0
 /// <summary>
 /// Create a scroller.
 /// </summary>
 /// <param name="gui">The GUI that this scroller will be a part of.</param>
 /// <param name="position">The position of this scroller.</param>
 /// <param name="type">Whether the item scrolls horizontally or vertically.</param>
 /// <param name="length">The length of this scroller.</param>
 public Scroller(GraphicalUserInterface gui, Vector2 position, ScrollerType type, float length)
 {
     //Initialize some variables.
     Initialize(gui, position, type, length);
 }
예제 #34
0
 /// <summary>
 /// Create an animation bar.
 /// </summary>
 /// <param name="gui">The GUI that this animation bar will be a part of.</param>
 /// <param name="animation">The animation that this item will play through.</param>
 /// <param name="position">The position of this animation bar.</param>
 /// <param name="height">The height of this animation bar.</param>
 /// <param name="width">The width of this animation bar.</param>
 public AnimationBar(GraphicalUserInterface gui, Animation animation, Vector2 position, float width, float height)
 {
     //Initialize some variables.
     Initialize(gui, animation, position, width, height);
 }
예제 #35
0
        /// <summary>
        /// Initialize the list.
        /// </summary>
        /// <param name="gui">The GUI that this list will be a part of.</param>
        /// <param name="position">The position of this list.</param>
        /// <param name="height">The height of this list.</param>
        /// <param name="width">The width of this list.</param>
        protected override void Initialize(GraphicalUserInterface gui, Vector2 position, float width, float height)
        {
            //The inherited method.
            base.Initialize(gui, position, width, height);

            //Intialize some variables.
            _Scroller = new Scroller(GUI, CalculateScrollerPosition(), ScrollerType.Vertical, (Height - 10));
            _Border = 2;
            _ItemHeight = 15;
            _IsScrollable = true;
            _IsFixed = true;
            _IsDirty = true;

            //Hook up some events.
            _Scroller.ValueChange += OnScrollerChange;
        }