public void ExecuteAddNotepadCommand(object parameter)
 {
     try
     {
         Notepad notepad = new Notepad();
         notepad.Name = NotepadNameString;
         notepad.UserOwner = ActiveUser;
         notepad.Save();
         MessageBox.Show("Adding was success");
     }
     catch (Exception e)
     {
         IsAddingFailed = true;
     }
 }
示例#2
0
        private static void Main()
        {
            try
            {
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);

                using (var notepadView = new Notepad())
                {
                    notepadView.Tag = new NotepadPresenter(notepadView, new FilePathProvider(), new DisplayDialogService());
                    Application.Run(notepadView);
                }
            }
            catch (Exception)
            {
                MessageBox.Show(
                    $@"予期せぬエラーが発生しました。
{AppConst.AppName}を終了します。",
                    AppConst.AppName,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error
                    );
                Application.Exit();
            }
        }
        public async Task <IActionResult> Edit(long id, [Bind("Id,Title,Content,CreateTime")] Notepad notepad)
        {
            if (id != notepad.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(notepad);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!NotepadExists(notepad.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(notepad));
        }
示例#4
0
        public IHttpActionResult PutNotepad(Guid id, Notepad notepad)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != notepad.Id)
            {
                return(BadRequest());
            }

            db.Entry(notepad).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NotepadExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#5
0
        //---------------------------------------------------------------------------------------------

        public static string GetGlobalConfigValueOrDefault(string xpath, string attrName, string defaultValue)
        {
            XmlDocument doc = CalebConfig.GlobalDocument;

            if (doc != null)
            {
                XmlElement itm = doc.DocumentElement.SelectSingleNode(xpath) as XmlElement;
                if (itm != null && itm.HasAttribute(attrName))
                {
                    try
                    {
                        string strval = itm.GetAttribute(attrName);
                        return(strval);
                    }
                    catch (Exception ex)
                    {
                        if (Game.Debug)
                        {
                            Notepad.WriteLine("GetGlobalConfigValueOrDefault ex: " + ex.Message);
                        }
                    }
                }
                else
                {
                    if (Game.Debug)
                    {
                        Notepad.WriteLine("GetGlobalConfigValueOrDefault !itm: " + xpath + " HasAttribute: " + attrName);
                    }
                }
            }
            return(defaultValue);
        }
示例#6
0
        private void 打开oToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Notepad MDIChild = new Notepad();

            MDIChild.MdiParent = this;
            MDIChild.Show();
        }
示例#7
0
        public IHttpActionResult PostNotepad(Notepad notepad)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Notepads.Add(notepad);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateException)
            {
                if (NotepadExists(notepad.Id))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(Ok(notepad));
        }
        public void NotepadTests()
        {
            var notepad = new Notepad();

            notepad.EditText("This is some text");
            notepad.Close();
        }
示例#9
0
        public void TextChanged(Notepad notepad, RichTextBox richTextBox1,
                                ToolStripMenuItem undo, ToolStripMenuItem cut,
                                ToolStripMenuItem copy, ToolStripMenuItem paste,
                                ToolStripMenuItem delete, ToolStripMenuItem find,
                                ToolStripMenuItem font)
        {
            if (notepad.Text != "Блокнот" && notepad.Text[0] != '*')
            {
                string name = "*" + notepad.Text;
                notepad.Text = name;
            }

            if (notepad.Text != "")
            {
                undo.Enabled   = true;
                cut.Enabled    = true;
                copy.Enabled   = true;
                paste.Enabled  = true;
                delete.Enabled = true;
                find.Enabled   = true;
                font.Enabled   = true;
            }
            else
            {
                undo.Enabled   = false;
                cut.Enabled    = false;
                copy.Enabled   = false;
                paste.Enabled  = false;
                delete.Enabled = false;
                find.Enabled   = false;
                font.Enabled   = false;
            }
        }
        public async Task <IActionResult> PutNotepad([FromRoute] long id, [FromBody] Notepad notepad)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != notepad.Id)
            {
                return(BadRequest());
            }

            _context.Entry(notepad).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NotepadExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
示例#11
0
        public SupplyCounter(UOObject container, List <UOItemTypeBase> types)
        {
            this.types = new List <UOItemTypeBase>();
            if (!container.Serial.IsValid)
            {
                throw new ArgumentException("container");
            }

            this.container = container;
            //this.type = type;
            //this.color = color;
            this.types.AddRange(types.ToArray());

            if (container is UOItem)
            {
                collection = ((UOItem)container).AllItems;
            }
            else if (container is UOCharacter)
            {
                collection = ((UOCharacter)container).Layers;

                if (Track)
                {
                    Notepad.WriteLine("Layers " + ((UOCharacter)container).Layers.Count());
                }
            }
            else
            {
                throw new ArgumentException("Invalid container type.");
            }

            container.Changed += new ObjectChangedEventHandler(container_Changed);
            // Init count
            Recalc();
        }
示例#12
0
        private void MouseClicked(Point CurMouse)
        {
            //Icon sizes & Positions

            /*Point ShutdownStart = new Point(750, 20);
             * int ShutdownSize = 30;
             * Point DrawStart = new Point(750, 60);
             * int DrawSize = 30;*/

            if ((CurMouse.X > ShutdownStart.X) && (CurMouse.X < ShutdownStart.X + ShutdownEnd.X))
            {
                if ((CurMouse.Y > ShutdownStart.Y) && (CurMouse.Y < ShutdownStart.Y + YSize))
                {
                    Sys.Power.Shutdown();
                }
            }
            if ((CurMouse.X > DrawStart.X) && (CurMouse.X < DrawStart.X + DrawEnd.X))
            {
                if ((CurMouse.Y > DrawStart.Y) && (CurMouse.Y < DrawStart.Y + YSize))
                {
                    DrawApp Draw = new DrawApp();
                    Draw.Draw(C);
                    Initialize();
                }
            }
            if ((CurMouse.X > TextBoxStart.X) && (CurMouse.X < TextBoxStart.X + TextBoxEnd.X))
            {
                if ((CurMouse.Y > TextBoxStart.Y) && (CurMouse.Y < TextBoxStart.Y + YSize))
                {
                    Notepad Note = new Notepad();
                    Note.Launch(C);
                    Initialize();
                }
            }
        }
        public ActionResult DeleteConfirmed(int id)
        {
            Notepad notepad = db.NotePad.Find(id);

            db.NotePad.Remove(notepad);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#14
0
        public static void PrintRealDistance()
        {
            World.Player.Print("[Vyber ..]");

            var o = Targeting.GetTarget(null);

            Notepad.WriteLine(String.Format("Serial: {0:X} RealDistance: {1:N10}", o.Object.Serial, o.Object.GetDistance()));
        }
示例#15
0
        void OpenNotepad()
        {
            if (notepad == null || notepad.IsDisposed)
            {
                notepad = new Notepad();
            }

            notepad.Show();
        }
示例#16
0
    // Use this for initialization
    void Start()
    {
        AppSoftware     = GameObject.Find("Applications");
        HackingSoftware = GameObject.Find("Hacking");
        SysSoftware     = GameObject.Find("System");
        //Computer = GameObject.Find("Computer");

        //System
        clk    = SysSoftware.GetComponent <Clock>();
        defalt = SysSoftware.GetComponent <Defalt>();
        am     = SysSoftware.GetComponent <AppMenu>();
        cmd    = SysSoftware.GetComponent <CLI>();
        com    = SysSoftware.GetComponent <Computer>();
        sc     = SysSoftware.GetComponent <SoundControl>();
        appman = SysSoftware.GetComponent <AppMan>();
        boot   = SysSoftware.GetComponent <Boot>();
        post   = SysSoftware.GetComponent <POST>();
        os     = SysSoftware.GetComponent <OS>();
        mouse  = SysSoftware.GetComponent <Mouse>();
        desk   = SysSoftware.GetComponent <Desktop>();

        //Applications
        al = AppSoftware.GetComponent <AccLog>();
        sm = AppSoftware.GetComponent <SystemMap>();
        ib = AppSoftware.GetComponent <InternetBrowser>();

        //Hacking
        prog  = HackingSoftware.GetComponent <Progtive>();
        trace = HackingSoftware.GetComponent <Tracer>();
        cy    = HackingSoftware.GetComponent <Descy>();
        ds    = HackingSoftware.GetComponent <DirSearch>();

        mb    = GetComponent <MissionBrow>();
        cc    = GetComponent <CurContracts>();
        sl    = GetComponent <SiteList>();
        note  = GetComponent <Notepad>();
        fav   = GetComponent <Favs>();
        tv    = GetComponent <TreeView>();
        mPass = GetComponent <MonitorBypass>();
        wsv   = GetComponent <WebSecViewer>();
        sdp   = GetComponent <ShutdownProm>();
        Audio = GetComponent <AudioSource>();

        windowRect.x = Customize.cust.windowx[windowID];
        windowRect.y = Customize.cust.windowy[windowID];

        Audio.volume = Customize.cust.Volume;
        DesktopY     = -50;
        StartTime    = 0.030f;
        Snap         = false;

        if (Size == 0)
        {
            Size = 21;
        }
    }
示例#17
0
 private void Zero_Btn_Click(object sender, EventArgs e)
 {   //Appends the value of the WordBuilder text box to the notepad.
     Notepad.AppendText(WordBuilder.Text.ToString());
     //Followed by a sapce in the notepad.
     Notepad.AppendText(" ");
     //Empty the KeySequence textbox.
     KeySequence_TextBox.Clear();
     //Empty the WordBuilder
     WordBuilder.Clear();
 }
 public ActionResult Edit([Bind(Include = "ID,Task")] Notepad notepad)
 {
     if (ModelState.IsValid)
     {
         db.Entry(notepad).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(notepad));
 }
        public async Task <IActionResult> Create([Bind("Id,Title,Content,CreateTime")] Notepad notepad)
        {
            if (ModelState.IsValid)
            {
                _context.Add(notepad);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(notepad));
        }
示例#20
0
        public IHttpActionResult GetNotepad(Guid id)
        {
            Notepad notepad = db.Notepads.Find(id);

            if (notepad == null)
            {
                return(NotFound());
            }

            return(Ok(notepad));
        }
示例#21
0
    void Start()
    {
        SysSoftware     = GameObject.Find("System");
        AppSoftware     = GameObject.Find("Applications");
        HackingSoftware = GameObject.Find("Hacking");

        com  = SysSoftware.GetComponent <Computer>();
        ib   = AppSoftware.GetComponent <InternetBrowser>();
        note = AppSoftware.GetComponent <Notepad>();
        prog = HackingSoftware.GetComponent <Progtive>();
        al   = SysSoftware.GetComponent <AccLog>();

        trace = HackingSoftware.GetComponent <Tracer>();

        cy      = SysSoftware.GetComponent <Descy>();
        ds      = SysSoftware.GetComponent <DirSearch>();
        tv      = SysSoftware.GetComponent <TreeView>();
        al      = AppSoftware.GetComponent <AccLog>();
        cmd     = SysSoftware.GetComponent <CLI>();
        sm      = AppSoftware.GetComponent <SystemMap>();
        clk     = SysSoftware.GetComponent <Clock>();
        defalt  = SysSoftware.GetComponent <Defalt>();
        sc      = SysSoftware.GetComponent <SoundControl>();
        appmenu = SysSoftware.GetComponent <AppMenu>();
        appman  = SysSoftware.GetComponent <AppMan>();

        windowRect.x = Customize.cust.windowx[windowID];
        windowRect.y = Customize.cust.windowy[windowID];

        native_height = Customize.cust.native_height;
        native_width  = Customize.cust.native_width;

        UpdateUI();
        for (Index = 0; Index < GameControl.control.ProgramFiles.Count; Index++)
        {
            if (GameControl.control.ProgramFiles[Index].Name == "Gateway")
            {
                TestCheck = true;
            }
        }

        if (Index >= GameControl.control.ProgramFiles.Count)
        {
            if (TestCheck == false)
            {
                Test();
            }
        }

        X     = -350;
        Speed = 600;

        windowID = appmenu.windowID;
    }
    private void CreateNotepadObject()
    {
        GameObject original = Resources.Load("Prefabs/TempPrefabs/Items/Item/notebook") as GameObject;

        this.m_Notepad       = UnityEngine.Object.Instantiate <GameObject>(original);
        this.m_NotepadHolder = this.m_Notepad.transform.FindDeepChild("Holder");
        Notepad component = this.m_Notepad.GetComponent <Notepad>();

        MenuNotepad.Get().SetNotepadObject(component);
        MenuNotepad.Get().gameObject.SetActive(true);
        HUDNotepad.Get().OnCreateNotepad(component);
    }
        public async Task <IActionResult> PostNotepad([FromBody] Notepad notepad)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            _context.Notepad.Add(notepad);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetNotepad", new { id = notepad.Id }, notepad));
        }
示例#24
0
 public void SetNotepadObject(Notepad notepad)
 {
     this.m_Notepad = notepad;
     if (this.m_Notepad != null)
     {
         this.m_MeshFilter = this.m_Notepad.gameObject.transform.FindDeepChild("notebook 1").GetComponent <MeshFilter>();
     }
     this.m_NotepadMesh          = this.m_MeshFilter.mesh;
     this.m_NotepadMeshVertices  = this.m_NotepadMesh.vertices;
     this.m_NotepadMeshTriangles = this.m_NotepadMesh.triangles;
     this.m_NotepadMeshUV2       = this.m_NotepadMesh.uv2;
 }
        public ActionResult Create([Bind(Include = "ID,Task")] Notepad notepad)
        {
            notepad.MachineName         = takeMachineName();
            notepad.TimeWhenTaskCreated = DateTime.UtcNow;
            if (ModelState.IsValid)
            {
                db.NotePad.Add(notepad);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(notepad));
        }
示例#26
0
        public ActionResult Index()
        {
            SqlCommand cmd = new SqlCommand("getHeaderReciept", con);

            cmd.CommandType = CommandType.StoredProcedure;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataSet        ds = new DataSet();

            da.Fill(ds);
            Notepad obj = new Notepad();

            obj.TopicContent = ds.Tables[0].Rows[0]["TitleName"].ToString();
            return(View(obj));
        }
        // GET: Notepad/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Notepad notepad = db.NotePad.Find(id);

            if (notepad == null)
            {
                return(HttpNotFound());
            }
            return(View(notepad));
        }
示例#28
0
        public IHttpActionResult DeleteNotepad(Guid id)
        {
            Notepad notepad = db.Notepads.Find(id);

            if (notepad == null)
            {
                return(NotFound());
            }

            db.Notepads.Remove(notepad);
            db.SaveChanges();

            return(Ok(notepad));
        }
示例#29
0
        public ActionResultVM SaveNote(Notepad mo)
        {
            var vm = new ActionResultVM();

            if (string.IsNullOrWhiteSpace(mo.NoteTitle) || string.IsNullOrWhiteSpace(mo.NoteContent))
            {
                vm.Set(ARTag.lack);
            }
            else
            {
                var uinfo = new Func.UserAuthAid(HttpContext).Get();

                using var db = new ContextBase();
                var now = DateTime.Now;
                if (mo.NoteId == 0)
                {
                    mo.NoteCreateTime = now;
                    mo.NoteUpdateTime = now;
                    mo.Uid            = uinfo.UserId;

                    db.Notepad.Add(mo);

                    int num = db.SaveChanges();
                    vm.Set(num > 0);
                    vm.data = mo.NoteId;
                }
                else
                {
                    var currmo = db.Notepad.Find(mo.NoteId);
                    if (currmo.Uid == uinfo.UserId)
                    {
                        currmo.NoteTitle      = mo.NoteTitle;
                        currmo.NoteContent    = mo.NoteContent;
                        currmo.NoteUpdateTime = now;

                        db.Notepad.Update(currmo);

                        int num = db.SaveChanges();

                        vm.Set(num > 0);
                    }
                    else
                    {
                        vm.Set(ARTag.unauthorized);
                    }
                }
            }

            return(vm);
        }
示例#30
0
        private Notepad DestinationNotepad(string templateHeader, string templateBody, string templateFooter, int rowID, int rowMax)
        {
            if (this.notepad == null)
            {
                this.notepad = new Notepad(templateHeader + Environment.NewLine);
                this.notepad.Show(System.Windows.Forms.Application.OpenForms[0]);
            }

            this.notepad.Append(templateBody + Environment.NewLine);

            if (rowID + 1 >= rowMax)
            {
                this.notepad.Append(templateFooter);
            }
            return(notepad);
        }
示例#31
0
 public void OnCreateNotepad(Notepad notepad)
 {
     this.m_ItemsCounter.bookmark               = notepad.m_ItemsTabCollider;
     this.m_StoryCounter.bookmark               = notepad.m_StoryTabCollider;
     this.m_SkillsCounter.bookmark              = notepad.m_SkillsTabCollider;
     this.m_ConstructionsCounter.bookmark       = notepad.m_ConstructionsTabCollider;
     this.m_TrapsCounter.bookmark               = notepad.m_TrapsTabCollider;
     this.m_FirecampCounter.bookmark            = notepad.m_FirecampTabCollider;
     this.m_WaterConstructionsCounter.bookmark  = notepad.m_WaterConstructionsTabCollider;
     this.m_HealingItemsCounter.bookmark        = notepad.m_HealingItemsTabCollider;
     this.m_PlantsCounter.bookmark              = notepad.m_PlantsTabCollider;
     this.m_CustomConstructionsCounter.bookmark = notepad.m_CustomConstructionsTabCollider;
     this.m_MudCounter.bookmark             = notepad.m_MudBuildingsTabCollider;
     this.m_StoryObjectivesCounter.bookmark = notepad.m_StoryObjectivesTabCollider;
     this.m_NotepadCreated = true;
 }
示例#32
0
    public void Dispossess()
    {
        if ( OnPlayerEvent != null )
            OnPlayerEvent ( PlayerEvent.Dispossess );

        charRootTransform.GetComponentInChildren<AI>().enabled = true;
        notepad = null;

        head.Dispossess();
            head = null;

        handsController.holdNotepad = false;
            handsController = null;

        Destroy(animatorIKHandler);
    }
示例#33
0
    public void InitializeForNewCharacter( int characterIndex )
    {
        this.characterIndex = characterIndex;
        charRootTransform = characters[ characterIndex ];
        charRootTransform.GetComponentInChildren<AI>().enabled = false;
        animator = charRootTransform.GetComponentInChildren<Animator>();
        animatorIKHandler = animator.gameObject.AddComponent<AnimatorIKHandler>();

        handsController = charRootTransform.GetComponentInChildren<HandsController>();
            handsController.holdNotepad = true;

        head = charRootTransform.GetComponentInChildren<Head>();
            head.Possess();

        notepad = charRootTransform.Find("Notepad").GetComponent<Notepad>();
            notepad.text = "";

        if ( OnPlayerEvent != null )
            OnPlayerEvent ( PlayerEvent.Possess );
    }